hu_HMACMD5Msg()

Generates a MAC tag of the specified length for the given data using HMAC-MD5.

Synopsis:

#include "humd5.h"
 
int hu_HMACMD5Msg(size_t keyLen, const unsigned char *key, sb_YieldCtx yieldCtx, size_t dataBlkLen, const unsigned char *dataBlk, size_t tagLen, unsigned char *tag, sb_GlobalCtx sbCtx)

Since:

BlackBerry 10.0.0

Arguments:

keyLen

The length (in bytes) of the key.

key

A key value.

yieldCtx

Ignored.

dataBlkLen

The length (in bytes) of the data.

dataBlk

The data buffer.

tagLen

The length (in bytes) of MAC tag. This value must be between SB_HMAC_MD5_64_TAG_LEN and SB_HMAC_MD5_128_TAG_LEN, inclusive.

tag

The MAC tag buffer.

sbCtx

A global context.

Library:

libhuapi (For the qcc command, use the -l huapi option to link against this library)

Description:

Note: Yielding is not supported for message digest operations.

Note: This function should only be called for data that can be stored entirely in memory.

Returns:

SB_ERR_NULL_KEY

key is NULL.

SB_ERR_NULL_INPUT_BUF

dataBlk is NULL.

SB_ERR_BAD_OUTPUT_BUF_LEN

The tag buffer length is invalid.

SB_ERR_NULL_OUTPUT_BUF

The tag buffer is NULL.

SB_FAIL_ALLOC

Memory allocation failure.

SB_SUCCESS

Success.