Defines all functions of mcuxClHash.
More...
|
| 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.
|
Defines all functions of mcuxClHash.
◆ mcuxClHash_compute()
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] | algorithm | Hash algorithm that should be used during the computation. |
| [in] | pIn | Pointer to the input buffer that contains the data that needs to be hashed. |
| [in] | inSize | Number of bytes of data in the pIn buffer. |
| [out] | pOut | Pointer to the output buffer where the computed hash value is written. |
| [out] | pOutSize | Will be set to the number of bytes of data that have been written to the pOut buffer. |
- Returns
- status
- Return values
-
- 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()
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] | pContext | Hash context which is used to maintain the state and store other relevant information about the operation (word-aligned). |
| [in] | algorithm | Hash algorithm that should be used during the computation operation. |
- Returns
- status
- Return values
-
- Examples
- mcuxClHashModes_sha256_streaming_dma_nonBlocking_example.c, and mcuxClHashModes_sha256_streaming_example.c.
◆ mcuxClHash_process()
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] | pIn | Pointer to the input buffer that contains the data that needs to be processed. |
| [in] | inSize | Number of bytes of data in the pIn buffer. |
- Returns
- status
- Return values
-
- Examples
- mcuxClHashModes_sha256_streaming_dma_nonBlocking_example.c, and mcuxClHashModes_sha256_streaming_example.c.
◆ mcuxClHash_finish()
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] | pOut | Pointer to the output buffer where the computed hash value needs to be written. |
| [out] | pOutSize | Will be set to the number of bytes of data that have been written to the pOut buffer. |
- Returns
- status
- Return values
-
- Examples
- mcuxClHashModes_sha256_streaming_dma_nonBlocking_example.c, and mcuxClHashModes_sha256_streaming_example.c.