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

Overview

Functions

status_t CAAM_HMAC_NonBlocking (CAAM_Type *base, caam_handle_t *handle, caam_desc_hash_t descriptor, 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_NonBlocking ( CAAM_Type *  base,
caam_handle_t handle,
caam_desc_hash_t  descriptor,
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, however the function will block if the supplied key is bigger than the block size of the underlying hashing algorithm (e.g. >64 bytes for SHA256).

The function is not blocking with the exception of supplying large key sizes. In that case the function will block until the large key is hashed down with the supplied hashing algorithm (as per FIPS 198-1), after which operation is resumed to calling non-blocking HMAC.

Parameters
baseCAAM peripheral base address
handleHandle used for this request.
[out]descriptorMemory for the CAAM descriptor.
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.