original_docstring: 
      Wrapper function for the supported hmac in COSE
      :param key: key for computation of the hmac
      :param to_be_maced: byte string whose integrity need to be protected
      :param algorithm: chosen hmac, supports hmac with sha256, sha384 and sha512
      :return: returns the digest calculated with the chosen hmac function
      
docstring: Wrapper function for the supported hmac in COSE
docstring_tokens: Wrapper function for the supported hmac in COSE
code: def calc_tag_wrapper(key, to_be_maced, algorithm):
      """
      Wrapper function for the supported hmac in COSE
      :param key: key for computation of the hmac
      :param to_be_maced: byte string whose integrity need to be protected
      :param algorithm: chosen hmac, supports hmac with sha256, sha384 and sha512
      :return: returns the digest calculated with the chosen hmac function
      """
  
      try:
          primitive = cmacs[algorithm]
          c = cmac.CMAC(primitive(key), backend=default_backend())
          c.update(to_be_maced)
          digest = c.finalize()
  
          if algorithm == 'AES-MAC-256/64':
              # truncate the result to the first 64 bits
              digest = digest[:8]
      except KeyError:
          try:
              primitive = hmacs[algorithm]
              h = hmac.HMAC(key, primitive(), backend=default_backend())
              h.update(to_be_maced)
              digest = h.finalize()
  
              if algorithm == 'HS256/64':
                  # truncate the result to the first 64 bits
                  digest = digest[:8]
  
          except KeyError as e:
              raise CoseUnsupportedMAC("This cipher is not supported by the COSE specification: {}".format(e))
  
      return digest
code_tokens: def calc_tag_wrapper ( key , to_be_maced , algorithm ) : try : primitive = cmacs [ algorithm ] c = cmac . CMAC ( primitive ( key ) , backend = default_backend ( ) ) c . update ( to_be_maced ) digest = c . finalize ( ) if algorithm == 'AES-MAC-256/64' : digest = digest [ : 8 ] except KeyError : try : primitive = hmacs [ algorithm ] h = hmac . HMAC ( key , primitive ( ) , backend = default_backend ( ) ) h . update ( to_be_maced ) digest = h . finalize ( ) if algorithm == 'HS256/64' : digest = digest [ : 8 ] except KeyError as e : raise CoseUnsupportedMAC ( "This cipher is not supported by the COSE specification: {}" . format ( e ) ) return digest
short_docstring: Wrapper function for the supported hmac in COSE
short_docstring_tokens: Wrapper function for the supported hmac in COSE
comment: """
      Wrapper function for the supported hmac in COSE
      :param key: key for computation of the hmac
      :param to_be_maced: byte string whose integrity need to be protected
      :param algorithm: chosen hmac, supports hmac with sha256, sha384 and sha512
      :return: returns the digest calculated with the chosen hmac function
      """$SEP$# truncate the result to the first 64 bits$SEP$# truncate the result to the first 64 bits