4.3.2.2 Crypto_Hash_Sha_Update
crypto_Hash_Status_E Crypto_Hash_Sha_Update(
st_Crypto_Sha_Hash_Ctx *ptr_shaCtx_st,
uint8_t *ptr_data,
uint32_t dataLen
);Description
This API performs hash calculation for different variants of SHA-1, SHA-2, and SHA-3 (Excluding SHAKE) algorithms in multi-steps. Initialize context by calling Crypto_Hash_Sha_Init function before calling this API and after this API call Crypto_Hash_Sha_Final to get hash/digest.
Parameters
| No. | Argument Type | Argument Name | Type | Description |
|---|---|---|---|---|
| 1 | st_Crypto_Sha_Hash_Ctx* | ptr_shaCtx_st | Output | Hash algorithm and crypto handler selection |
| 2 | uint8_t* | ptr_data | Input | Input data to be hashed |
| 3 | uint32_t | dataLen | Input | Length of the input data in number of bytes |
Returns
| Return Type | Description |
|---|---|
| crypto_Hash_Status_E | Function returns the status of the API. |
Prerequisites
- To use the HW handler, the algorithm must be enabled in Crypto v4 in MPLAB® Code Configurator.
- To use the SW handler, the algorithm must be enabled in wolfCrypt, and linked to Crypto V4 in MPLAB® Code Configurator.
- Crypto_Hash_Sha_Init must be called before calling Crypto_Hash_Sha_Update.
Example
Example provided in Crypto_Hash_Sha_Final.
