AI_HMAC

AI_HMAC

Purpose:

This AI allows you to create a message authentication code using a keyed hashing algorithm called Hash-Based Message Authentication Code (HMAC).

Type of information this allows you to use:

the specified digest algorithm for performing HMAC as defined in the SET draft standard, a subset of the Draft-IETF-IPSEC-AH-HMAC-SHA-04.

Format of info supplied to B_SetAlgorithmInfo:

pointer to a B_DIGEST_SPECIFIER structure:

typedef struct { B_INFO_TYPE digestInfoType; POINTER digestInfoParams;

}B_DIGEST_SPECIFIER;

Crypto-C 4.3 supports AI_SHA1 and AI_MD5 as a digestInfoType, with NULL_PTR as the digestInfoParams.

Format of info returned by B_GetAlgorithmInfo:

pointer to a B_DIGEST_SPECIFIER structure.

Crypto-C procedures to use with algorithm object:

B_DigestInit, B_DigestUpdate, and B_DigestFinal. You must pass a key object compatible with KI_Item with at least one byte of keying material as the keyObject argument in B_DigestInit. It is recommended that minimally 20 bytes of key be used when SHA1 is the hash function. More bytes are recommended if the key bytes are weakly random (low entropy keys).

Algorithm methods to include in application’s algorithm chooser:

The appropriate AM for the digest specified; for instance, AM_SHA when the digestInfoType is AI_SHA1, and AM_MD5 for AI_MD5.

C h a p t e r 2 A l g o r i t h m I n f o Ty p e s

91

Page 101
Image 101
RSA Security 5 manual Aihmac, Pointer to a Bdigestspecifier structure