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.
Function Base Name |
Operation |
---|---|
Gets the size of the IppsHMACSHA1State context. |
|
Initializes user-supplied memory as IppsHMACSHA1State context for future use. |
|
Packs/unpacks the IppsHMACSHA1State context into/from a user-defined buffer. |
|
Copies one IppsHMACSHA1State context to another. |
|
Digests the current input message stream of the specified length using SHA1-based MAC. |
|
Completes computation of the SHA1-based MAC value. |
|
Computes the current HMAC value of the processed part of the message. |
|
Computes the SHA1-based MAC value of an entire message. |
|
Gets the size of the IppsHMACSHA224State context. |
|
Initializes user-supplied memory as IppsHMACSHA224State context for future use. |
|
Packs/unpacks the IppsHMACSHA224State context into/from a user-defined buffer. |
|
Copies one IppsHMACSHA224State context to another. |
|
Digests the current input message stream of the specified length using SHA224-based MAC. |
|
Completes computation of the SHA224-based MAC value. |
|
Computes the current SHA224-based MAC value of the processed part of the message. |
|
Computes the SHA224-based MAC value of an entire message. |
|
Gets the size of the IppsHMACSHA256State context. |
|
Initializes user-supplied memory as IppsHMACSHA256State context for future use. |
|
Packs/unpacks the IppsHMACSHA256State context into/from a user-defined buffer. |
|
Copies one IppsHMACSHA256State context to another. |
|
Digests the current input message stream of the specified length using SHA256-based MAC. |
|
Completes computation of the SHA254-based MAC value. |
|
Computes the current SHA256-based MAC value of the processed part of the message. |
|
Computes the SHA256-based MAC value of an entire message. |
|
Gets the size of the IppsHMACSHA384State context. |
|
Initializes user-supplied memory as IppsHMACSHA384State context for future use. |
|
Packs/unpacks the IppsHMACSHA384State context into/from a user-defined buffer. |
|
Copies one IppsHMACSHA384State context to another. |
|
Digests the current input message stream of the specified length using SHA384-based MAC. |
|
Completes computation of the SHA384-based MAC value. |
|
Computes the current SHA384-based MAC value of the processed part of the message. |
|
Computes the SHA384-based MAC value of an entire message. |
|
Gets the size of the IppsHMACSHA512State context. |
|
Initializes user-supplied memory as IppsHMACSHA512State context for future use. |
|
Packs/unpacks the IppsHMACSHA512State context into/from a user-defined buffer. |
|
Copies one IppsHMACSHA512State context to another. |
|
Digests the current input message stream of the specified length using SHA512-based MAC. |
|
Completes computation of the SHA512-based MAC value. |
|
Computes the current SHA512-based MAC value of the processed part of the message. |
|
Computes the SHA512-based MAC value of an entire message. |
|
Gets the size of the IppsHMACMD5State context. |
|
Initializes user-supplied memory as IppsHMACMD5State context for future use. |
|
Packs/unpacks the IppsHMACMD5State context into/from a user-defined buffer. |
|
Copies one IppsHMACMD5State context to another. |
|
Digests the current input message stream of the specified length using MD5-based MAC. |
|
Completes computation of the MD5-based MAC value. |
|
Computes the current MD5-based MAC value of the processed part of the message. |
|
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:
Call the function HMACSHA1GetSize to get the size required to configure the IppsHMACSHA1State context.
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.
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.
Call the function HMACSHA1Final for padding the partial block into a final SHA-1 message block and transforming it into a resulting HMAC value.
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:
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.