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. | |
Defines all functions of mcuxClEls_Hash.
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.
[in] | options | The command options. For more information, see mcuxClEls_HashOption_t. |
[in] | pInput | Padded input data to be hashed |
[in] | inputLength | Size 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] | pDigest | Pointer 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.
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.
MCUXCLELS_STATUS_SW_INVALID_PARAM | if invalid parameters were specified |
MCUXCLELS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the request |
MCUXCLELS_STATUS_OK_WAIT | on successful request |