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. More...
|
|
mcuxClHash_Status_t | mcuxClHash_init (mcuxClSession_Handle_t session, mcuxClHash_Context_t pContext, mcuxClHash_Algo_t algorithm) |
| Multi-part Hash initialization function. More...
|
|
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. More...
|
|
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. More...
|
|
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. (MCUXCL_FEATURE_SESSION_HAS_RTF)
- 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 incremented by the number of bytes of data that have been written to the pOut buffer. |
- Returns
- status
- Return values
-
MCUXCLHASH_STATUS_OK | Hash operation successful |
MCUXCLHASH_STATUS_FAILURE | Error occured during Hash operation |
MCUXCLHASH_STATUS_INVALID_PARAMS | The provided function parameters do not fulfill requirements |
MCUXCLHASH_STATUS_FAULT_ATTACK | A fault attack was detected |
◆ 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. |
[in] | algorithm | Hash algorithm that should be used during the computation operation. |
- Returns
- status
- Return values
-
MCUXCLHASH_STATUS_OK | Initialization successful |
MCUXCLHASH_STATUS_FAILURE | Error occurred during initialization function |
◆ 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. |
[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
-
MCUXCLHASH_STATUS_OK | Hash operation successful |
MCUXCLHASH_STATUS_FAILURE | Error occurred during Hash operation |
MCUXCLHASH_STATUS_INVALID_PARAMS | The provided function parameters do not fulfill requirements |
MCUXCLHASH_STATUS_FAULT_ATTACK | A fault attack was detected |
◆ 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. |
[out] | pOut | Pointer to the output buffer where the computed hash value needs to be written. |
[out] | pOutSize | Will be incremented by the number of bytes of data that have been written to the pOut buffer. |
- Returns
- status
- Return values
-
MCUXCLHASH_STATUS_OK | Hash operation successful |
MCUXCLHASH_STATUS_FAILURE | Error occurred during Hash operation |
MCUXCLHASH_STATUS_INVALID_PARAMS | The provided function parameters do not fulfill requirements |
MCUXCLHASH_STATUS_FAULT_ATTACK | A fault attack was detected |