MCUXpresso SDK API Reference Manual  Rev 2.16.100
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Caam_driver_hmac

Overview

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...
 

Function Documentation

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.

Parameters
baseCAAM peripheral base address
handleHandle used for this request.
[out]ctxOutput HMAC context
algoUnderlaying algorithm to use for HMAC computation.
keyInput key
keySizeSize of input key in bytes
Returns
Status of initialization
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.

Parameters
baseCAAM peripheral base address
handleHandle used for this request.
algoUnderlaying algorithm to use for MAC computation.
inputInput data
inputSizeSize of input data in bytes
keyInput key
keySizeSize of input key in bytes
[out]outputOutput MAC data
[out]outputSizeOutput parameter storing the size of the output MAC in bytes
Returns
Status of the one call hash operation.