HMACMD5MessageDigest

Computes the HMAC value of the message in a single call.

Syntax

IppStatus ippsHMACMD5MessageDigest(const Ipp8u *pSrcMesg, int mesgLen, const Ipp8u *pKey, int keyLen, Ipp8u *pMAC, int macLen);

Parameters

pSrcMesg

Pointer to the input message.

mesgLen

Message length in bytes.

pKey

Pointer to the user-supplied key.

keyLen

Key length in bytes.

pMAC

Pointer to the resultant HMAC value.

macLen

Specified HMAC length.

Description

This function is declared in the ippcp.h file. The function takes the input key pKey of the specified key length keyLen and applies the keyed hash-based message authentication code scheme to transform the input message into the respective message authentication code pMAC of the specified length macLen.

Return Values

ippStsNoErr

Indicates no error. Any other value indicates an error or warning.

ippStsNullPtrErr

Indicates an error condition if any of the specified pointers is NULL.

ippStsLengthErr

Indicates an error condition if msgLen is less than zero and macLen is less than one or greater than the length of the hash value.

MD5 HMAC of a Message

void HMACMD5_sample(void){
   // define key
   Ipp8u key[] = "the key for HMAC scheme";

   // define message
   Ipp8u msg[] = "abcdefghijklmnopqrstuvwxyz";

   // as soon as whole message placed into memory
   // one can use integrated primitive
   int macLen = 12;
   Ipp8u mac[16];
   ippsHMACMD5MessageDigest(msg, strlen((char*)msg),
                            key, strlen((char*)key),
                            mac, macLen);
}

See Also

Submit feedback on this help topic

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