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

Defines all functions of mcuxClHash. More...

Functions

mcuxClHash_Status_t mcuxClHash_compute (mcuxClSession_Handle_t session, mcuxClHash_Algo_t algorithm, mcuxCl_InputBuffer_t pIn, uint32_t inSize, mcuxCl_Buffer_t pOut, uint32_t *const pOutSize)
 One-shot Hash computation function.
mcuxClHash_Status_t mcuxClHash_init (mcuxClSession_Handle_t session, mcuxClHash_Context_t pContext, mcuxClHash_Algo_t algorithm)
 Multi-part Hash initialization function.
mcuxClHash_Status_t mcuxClHash_process (mcuxClSession_Handle_t session, mcuxClHash_Context_t pContext, mcuxCl_InputBuffer_t pIn, uint32_t inSize)
 Multi-part Hash processing function.
mcuxClHash_Status_t mcuxClHash_finish (mcuxClSession_Handle_t session, mcuxClHash_Context_t pContext, mcuxCl_Buffer_t pOut, uint32_t *const pOutSize)
 Multi-part Hash computation finalization function.

Detailed Description

Defines all functions of mcuxClHash.

Function Documentation

◆ mcuxClHash_compute()

mcuxClHash_Status_t mcuxClHash_compute ( mcuxClSession_Handle_t session,
mcuxClHash_Algo_t algorithm,
mcuxCl_InputBuffer_t pIn,
uint32_t inSize,
mcuxCl_Buffer_t pOut,
uint32_t *const pOutSize )

One-shot Hash computation function.

This function performs a hash computation over the input message pIn, using the hash function provided by the algorithm input parameter, in one shot. Up to 2^32 bytes of data can be hashed with this function.

For example, to perform a SHA256 computation, the following needs to be provided:

  • SHA256 algorithm
  • Input data
  • Output hash buffer

The input parameter session has to be initialized by the function mcuxClSession_init prior to calling this function.

Parameters
[in/out]session Handle for the current CL session.
[in]algorithmHash algorithm that should be used during the computation.
[in]pInPointer to the input buffer that contains the data that needs to be hashed.
[in]inSizeNumber of bytes of data in the pIn buffer.
[out]pOutPointer to the output buffer where the computed hash value is written.
[out]pOutSizeWill be set to the number of bytes of data that have been written to the pOut buffer.
Returns
status
Return values
MCUXCLHASH_STATUS_OKHash operation successful
MCUXCLHASH_STATUS_FAILUREError occured during Hash operation
MCUXCLHASH_STATUS_INVALID_PARAMSThe provided function parameters do not fulfill requirements
MCUXCLHASH_STATUS_FAULT_ATTACKA fault attack was detected
Examples
mcuxClHashModes_sha224_oneshot_example.c, mcuxClHashModes_sha256_longMsgOneshot_example.c, mcuxClHashModes_sha256_oneshot_dma_nonBlocking_example.c, mcuxClHashModes_sha256_oneshot_example.c, mcuxClHashModes_sha384_oneshot_example.c, mcuxClHashModes_sha512_oneshot_example.c, and mcuxClRsa_Signature_RSASSA_PSS_example.c.

◆ mcuxClHash_init()

mcuxClHash_Status_t mcuxClHash_init ( mcuxClSession_Handle_t session,
mcuxClHash_Context_t pContext,
mcuxClHash_Algo_t algorithm )

Multi-part Hash initialization function.

This function performs the initialization for a multi-part hash operation.

Parameters
[in/out]session Handle for the current CL session.
[out]pContextHash context which is used to maintain the state and store other relevant information about the operation (word-aligned).
[in]algorithmHash algorithm that should be used during the computation operation.
Returns
status
Return values
MCUXCLHASH_STATUS_OKInitialization successful
MCUXCLHASH_STATUS_FAILUREError occurred during initialization function
Examples
mcuxClHashModes_sha256_streaming_dma_nonBlocking_example.c, and mcuxClHashModes_sha256_streaming_example.c.

◆ mcuxClHash_process()

mcuxClHash_Status_t mcuxClHash_process ( mcuxClSession_Handle_t session,
mcuxClHash_Context_t pContext,
mcuxCl_InputBuffer_t pIn,
uint32_t inSize )

Multi-part Hash processing function.

This function performs the processing of (a part of) a data stream for a Hash operation. The algorithm to be used will be determined based on the context that is provided.

Parameters
[in/out]session Handle for the current CL session.
[in/out]pContext Hash context which is used to maintain the state and store other relevant information about the operation (word-aligned).
[in]pInPointer to the input buffer that contains the data that needs to be processed.
[in]inSizeNumber of bytes of data in the pIn buffer.
Returns
status
Return values
MCUXCLHASH_STATUS_OKHash operation successful
MCUXCLHASH_STATUS_FAILUREError occurred during Hash operation
MCUXCLHASH_STATUS_INVALID_PARAMSThe provided function parameters do not fulfill requirements
MCUXCLHASH_STATUS_FAULT_ATTACKA fault attack was detected
Examples
mcuxClHashModes_sha256_streaming_dma_nonBlocking_example.c, and mcuxClHashModes_sha256_streaming_example.c.

◆ mcuxClHash_finish()

mcuxClHash_Status_t mcuxClHash_finish ( mcuxClSession_Handle_t session,
mcuxClHash_Context_t pContext,
mcuxCl_Buffer_t pOut,
uint32_t *const pOutSize )

Multi-part Hash computation finalization function.

This function performs the finalization of a Hash computation operation. The algorithm to be used will be determined based on the context that is provided

Parameters
[in/out]session Handle for the current CL session.
[in/out]pContext Hash context which is used to maintain the state and store other relevant information about the operation (word-aligned).
[out]pOutPointer to the output buffer where the computed hash value needs to be written.
[out]pOutSizeWill be set to the number of bytes of data that have been written to the pOut buffer.
Returns
status
Return values
MCUXCLHASH_STATUS_OKHash operation successful
MCUXCLHASH_STATUS_FAILUREError occurred during Hash operation
MCUXCLHASH_STATUS_INVALID_PARAMSThe provided function parameters do not fulfill requirements
MCUXCLHASH_STATUS_FAULT_ATTACKA fault attack was detected
Examples
mcuxClHashModes_sha256_streaming_dma_nonBlocking_example.c, and mcuxClHashModes_sha256_streaming_example.c.