MCUX CLNS
MCUX Crypto Library Normal Secure
 
Loading...
Searching...
No Matches
mcuxClEls_Hash_Functions

Defines all functions of mcuxClEls_Hash. More...

Functions

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Hash_Async (mcuxClEls_HashOption_t options, uint8_t const *pInput, size_t inputLength, uint8_t *pDigest)
 Computes the hash of a message.
 

Detailed Description

Defines all functions of mcuxClEls_Hash.

Function Documentation

◆ mcuxClEls_Hash_Async()

MCUXCLELS_API mcuxClEls_Status_t mcuxClEls_Hash_Async ( mcuxClEls_HashOption_t  options,
uint8_t const *  pInput,
size_t  inputLength,
uint8_t *  pDigest 
)

Computes the hash of a message.

Call mcuxClEls_WaitForOperation to complete the operation.

Parameters
[in]optionsThe command options. For more information, see mcuxClEls_HashOption_t.
[in]pInputPadded input data to be hashed
[in]inputLengthSize of pInput in bytes. Since the input is padded, the length must be a multiple of the block size, see MCUXCLELS_HASH_BLOCK_SIZE_.
[in,out]pDigestPointer to the memory area that contains/receives the (intermediate) hash digest, allocated by the caller, see MCUXCLELS_HASH_STATE_SIZE_.

The properties of some parameters change with respect to selected options.

Parameter properties
options.hashini == MCUXCLELS_HASH_INIT_ENABLE

options.hashld has no effect and shall be MCUXCLELS_HASH_LOAD_DISABLE. No data is read from pDigest.

options.hashld == MCUXCLELS_HASH_LOAD_DISABLE

pDigest is not expected to contain an initial state. No data is read from pDigest.

options.rtfoe == MCUXCLELS_HASH_RTF_UPDATE_ENABLE

When this option is used the current runtime fingerprint (RTF) value will be appended to the output pDigest; an additional MCUXCLELS_HASH_RTF_OUTPUT_SIZE bytes has to be allocated for pDigest.

options.hashoe == MCUXCLELS_HASH_OUTPUT_ENABLE

The hash state is written to pDigest. The size varies depending on the choice of options.hashmd, for more information see MCUXCLELS_HASH_STATE_SIZE_ . In cases where the state size and output size differ - see MCUXCLELS_HASH_OUTPUT_SIZE_ -, the state must be truncated by the caller to obtain the final hash value.

Returns
An error code that can be any error code in MCUXCLELS_STATUS_, see individual documentation for more information
Return values
MCUXCLELS_STATUS_SW_INVALID_PARAMif invalid parameters were specified
MCUXCLELS_STATUS_SW_CANNOT_INTERRUPTif a running operation prevented the request
MCUXCLELS_STATUS_OK_WAITon successful request
Examples
mcuxClEls_Hash_HW_Security_Counter_example.c, mcuxClEls_Hash_Sha224_One_Block_example.c, mcuxClEls_Hash_Sha256_One_Block_example.c, mcuxClEls_Hash_Sha384_One_Block_example.c, and mcuxClEls_Hash_Sha512_One_Block_example.c.