Computes the MAC output on the given data using the specified key.
#include "humac.h"
int hu_MACMsg(sb_Key macKey, size_t dataLen, const unsigned char *data, size_t *tagLen, unsigned char *tag, sb_GlobalCtx sbCtx)
BlackBerry 10.0.0
The MAC key object.
The length (in bytes) of the data.
The data value.
The length (in bytes) of the tag.
The MAC output.
A global context.
To specify the length of the tag value, a pointer to a buffer large enough to hold the tag value should be passed in tag and its length in tagLen. This function will copy the first tagLen bytes of the computed tag into tag. If tagLen is greater than the default tag length, the entire tag value is copied, and the default length of the tag value is set in tagLen.
If tag is NULL, then this function will set the default length of the tag value in tagLen. If tag is not NULL but tagLen is too small, this function will return an error and will also set the default length of the tag value in tagLen.
For HMAC algorithms, the default length of the tag value is the underlying digest's output length. The minimum length of the tag value is half the default length.
For cipher-based MAC algorithms, the default length of the tag value is the block length of the underlying cipher. The minimum length of the tag value is half the default length.
The macKey object is NULL.
The macKey object is invalid.
The tagLen pointer is NULL.
The tagLen value is too small.