Keyed Hash Functions

The Intel IPP HMAC primitive functions, described in this section, use various HMAC schemes based on one-way hash functions described in One-Way Hash Primitives.

Table “Intel IPP HMAC Functions” lists the Intel IPP HMAC functions.

Intel IPP HMAC Functions

Function Base Name

Operation

HMACSHA1GetSize

Gets the size of the IppsHMACSHA1State context.

HMACSHA1Init

Initializes user-supplied memory as IppsHMACSHA1State context for future use.

HMACSHA1Pack, HMACSHA1Unpack

Packs/unpacks the IppsHMACSHA1State context into/from a user-defined buffer.

HMACSHA1Duplicate

Copies one IppsHMACSHA1State context to another.

HMACSHA1Update

Digests the current input message stream of the specified length using SHA1-based MAC.

HMACSHA1Final

Completes computation of the SHA1-based MAC value.

HMACSHA1GetTag

Computes the current HMAC value of the processed part of the message.

HMACSHA1MessageDigest

Computes the SHA1-based MAC value of an entire message.

HMACSHA224GetSize

Gets the size of the IppsHMACSHA224State context.

HMACSHA224Init

Initializes user-supplied memory as IppsHMACSHA224State context for future use.

HMACSHA224Pack, HMACSHA224Unpack

Packs/unpacks the IppsHMACSHA224State context into/from a user-defined buffer.

HMACSHA224Duplicate

Copies one IppsHMACSHA224State context to another.

HMACSHA224Update

Digests the current input message stream of the specified length using SHA224-based MAC.

HMACSHA224Final

Completes computation of the SHA224-based MAC value.

HMACSHA224GetTag

Computes the current SHA224-based MAC value of the processed part of the message.

HMACSHA224MessageDigest

Computes the SHA224-based MAC value of an entire message.

HMACSHA256GetSize

Gets the size of the IppsHMACSHA256State context.

HMACSHA256Init

Initializes user-supplied memory as IppsHMACSHA256State context for future use.

HMACSHA256Pack, HMACSHA256Unpack

Packs/unpacks the IppsHMACSHA256State context into/from a user-defined buffer.

HMACSHA256Duplicate

Copies one IppsHMACSHA256State context to another.

HMACSHA256Update

Digests the current input message stream of the specified length using SHA256-based MAC.

HMACSHA256Final

Completes computation of the SHA254-based MAC value.

HMACSHA256GetTag

Computes the current SHA256-based MAC value of the processed part of the message.

HMACSHA256MessageDigest

Computes the SHA256-based MAC value of an entire message.

HMACSHA384GetSize

Gets the size of the IppsHMACSHA384State context.

HMACSHA384Init

Initializes user-supplied memory as IppsHMACSHA384State context for future use.

HMACSHA384Pack, HMACSHA384Unpack

Packs/unpacks the IppsHMACSHA384State context into/from a user-defined buffer.

HMACSHA384Duplicate

Copies one IppsHMACSHA384State context to another.

HMACSHA384Update

Digests the current input message stream of the specified length using SHA384-based MAC.

HMACSHA384Final

Completes computation of the SHA384-based MAC value.

HMACSHA384GetTag

Computes the current SHA384-based MAC value of the processed part of the message.

HMACSHA384MessageDigest

Computes the SHA384-based MAC value of an entire message.

HMACSHA512GetSize

Gets the size of the IppsHMACSHA512State context.

HMACSHA512Init

Initializes user-supplied memory as IppsHMACSHA512State context for future use.

HMACSHA512Pack, HMACSHA512Unpack

Packs/unpacks the IppsHMACSHA512State context into/from a user-defined buffer.

HMACSHA512Duplicate

Copies one IppsHMACSHA512State context to another.

HMACSHA512Update

Digests the current input message stream of the specified length using SHA512-based MAC.

HMACSHA512Final

Completes computation of the SHA512-based MAC value.

HMACSHA512GetTag

Computes the current SHA512-based MAC value of the processed part of the message.

HMACSHA512MessageDigest

Computes the SHA512-based MAC value of an entire message.

HMACMD5GetSize

Gets the size of the IppsHMACMD5State context.

HMACMD5Init

Initializes user-supplied memory as IppsHMACMD5State context for future use.

HMACMD5Pack, HMACMD5Unpack

Packs/unpacks the IppsHMACMD5State context into/from a user-defined buffer.

HMACMD5Duplicate

Copies one IppsHMACMD5State context to another.

HMACMD5Update

Digests the current input message stream of the specified length using MD5-based MAC.

HMACMD5Final

Completes computation of the MD5-based MAC value.

HMACMD5GetTag

Computes the current MD5-based MAC value of the processed part of the message.

HMACMD5MessageDigest

Computes the MD5-based MAC value of an entire message.

Each HMAC scheme is implemented as a set of the primitive functions tabled above.

For example, the primitive implementing HMAC that is based on SHA-1 hash algorithm uses the ippsHMACSHA1State context as an operational vehicle to carry all necessary variables to manage computation of chaining digest value.

The function HMACSHA1Init initializes the context and sets up the specified initialization vectors. After the initialization, the function HMACSHA1Update digests the input message stream with the selected hash algorithm till it exhausts all message blocks.

The function HMACSHA1Final is designed to pad the partial message block into a final message block with the specified padding scheme, and then use the hash algorithm to transform the final block into a message digest value.

The following example illustrates how the application code can apply the implemented HMAC-SHA1 hash standard to digest the input message stream:


  1. Call the function HMACSHA1GetSize to get the size required to configure the IppsHMACSHA1State context.

  2. Ensure that the required memory space is properly allocated. With the allocated memory, call the function HMACSHA1Init to set up key material and the initial context state with the SHA-1 specified initialization vectors.

  3. Keep calling the function HMACSHA1Update to digest incoming message stream in the queue till its completion. To determine the current value of the message digest, call HMACSHA1GetTag between the two calls to HMACSHA1Update.

  4. Call the function HMACSHA1Final for padding the partial block into a final SHA-1 message block and transforming it into a resulting HMAC value.

  5. Call the operating system memory free service function to release the IppsHMACSHA1State context.

The contexts used by the HMAC primitives (for example, ippsHMACSHA1State) are position-dependent. The following functions transform the respective position-dependent context to a position-independent form and vice versa:

See Also

Submit feedback on this help topic

Copyright © 2000 - 2010, Intel Corporation. All rights reserved.