Message Authentication Code (MAC) Algorithms (humac.h)

The functions in this section allow you to use Message Authentication Codes (MACs) in an abstract fashion. The MAC algorithm is selected when you create a key object. The algorithm identifier must be one of the following constants defined in humac.h:

  • HU_DIGEST_MD5
  • HU_DIGEST_SHA1
  • HU_DIGEST_SHA224
  • HU_DIGEST_SHA256
  • HU_DIGEST_SHA384
  • HU_DIGEST_SHA512
  • HU_MAC_XCBC_AES
  • HU_MAC_CMAC_AES_128
  • HU_MAC_CMAC_AES_192
  • HU_MAC_CMAC_AES_256

You create a key object by calling hu_MACKeySet() (when you already have a key value you wish to use), or hu_MACKeyGen() (when you wish to use a key generated from random data). The key object can then be used to initialize a MAC context (using hu_MACBegin()) or to compute the MAC in one call (using hu_MACMsg()).

Last modified: 2014-05-14



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus