![]() |
MCUXpresso SDK API Reference Manual
Rev 2.16.100
NXP Semiconductors
|
Functions | |
status_t | CAAM_HMAC_Init (CAAM_Type *base, caam_handle_t *handle, caam_hash_ctx_t *ctx, caam_hash_algo_t algo, const uint8_t *key, size_t keySize) |
Initialize HMAC context. More... | |
status_t | CAAM_HMAC (CAAM_Type *base, caam_handle_t *handle, caam_hash_algo_t algo, const uint8_t *input, size_t inputSize, const uint8_t *key, size_t keySize, uint8_t *output, size_t *outputSize) |
Create Message Authentication Code (MAC) on given data. More... | |
status_t CAAM_HMAC_Init | ( | CAAM_Type * | base, |
caam_handle_t * | handle, | ||
caam_hash_ctx_t * | ctx, | ||
caam_hash_algo_t | algo, | ||
const uint8_t * | key, | ||
size_t | keySize | ||
) |
This function initializes the HMAC.
For XCBC-MAC, the key length must be 16. For CMAC, the key length can be the AES key lengths supported by AES engine. For MDHA the key length argument is ignored.
This functions is used to initialize the context for both blocking and non-blocking CAAM_HMAC API.
base | CAAM peripheral base address | |
handle | Handle used for this request. | |
[out] | ctx | Output HMAC context |
algo | Underlaying algorithm to use for HMAC computation. | |
key | Input key | |
keySize | Size of input key in bytes |
status_t CAAM_HMAC | ( | CAAM_Type * | base, |
caam_handle_t * | handle, | ||
caam_hash_algo_t | algo, | ||
const uint8_t * | input, | ||
size_t | inputSize, | ||
const uint8_t * | key, | ||
size_t | keySize, | ||
uint8_t * | output, | ||
size_t * | outputSize | ||
) |
Perform the full keyed XCBC-MAC/CMAC, or HMAC-SHA in one function call.
Key shall be supplied if the underlaying algoritm is AES XCBC-MAC, CMAC, or SHA HMAC.
For XCBC-MAC, the key length must be 16. For CMAC, the key length can be the AES key lengths supported by AES engine. For HMAC, the key can have any size.
base | CAAM peripheral base address | |
handle | Handle used for this request. | |
algo | Underlaying algorithm to use for MAC computation. | |
input | Input data | |
inputSize | Size of input data in bytes | |
key | Input key | |
keySize | Size of input key in bytes | |
[out] | output | Output MAC data |
[out] | outputSize | Output parameter storing the size of the output MAC in bytes |