Visible to Intel only — GUID: GUID-4C473436-1E29-42D2-8586-14B88E9C5CED
Visible to Intel only — GUID: GUID-4C473436-1E29-42D2-8586-14B88E9C5CED
Keyed Hash Functions
The Intel® Cryptography Primitives Library HMAC primitive functions, described in this section, use various HMAC schemes based on one-way hash functions described in One-Way Hash Primitives.
Usage model of the generalized HMAC functions is similar to the model explained below.
Each HMAC scheme is implemented as a set of the primitive functions. Each primitive implementing HMAC uses the HashState context as an operational vehicle to carry all necessary variables to manage computation of the chaining 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 HMAC_GetSize to get the size required to configure the HashState context.
Ensure that the required memory space is properly allocated. With the allocated memory, call the function HMAC_Init with the value of hashAlg equal to ippHashAlg_SHA1 to set up key material and the initial context state with the SHA-1 specified initialization vectors.
Keep calling the function HMAC_Update to digest incoming message stream in the queue till its completion. To determine the current value of the message digest, call HMAC_GetTag between the two calls to HMACUpdate.
Call the function HMAC_Final to pad the partial block into a final SHA-1 message block and transform it into a resulting HMAC value.
Clean up secret data stored in the context.
Call the operating system memory free service function to release the HashState context.
The HashState context is position-dependent. The HMACPack, HMACUnpack functions transform it to a position-independent form and vice versa:
Important
The crypto community does not consider HMACSHA1 or HMACMD5 secure anymore.Recommendation: use a more secure hash algorithm (for example, any algorithm from the SHA-2 family) instead of HMACSHA1 or HMACMD5.
Related Information