Parent topic:MPLAB® Harmony Crypto Library
int CRYPT_SHA224_Initialize(
CRYPT_SHA256_CTX* sha224
);
This function initializes the internal structures necessary for SHA224 hash calculations.
None.
Parameters | Description |
---|---|
sha224 | Pointer to context which saves state between calls. |
-
BAD_FUNC_ARG - An invalid pointer was passed to the function.
-
0 - An invalid pointer was not passed to the function.
All SHA hashes have to start at a particular value before adding new data to it. This function sets the necessary values for the structure.
CRYPT_SHA256_CTX sha;
uint8_t shaSum[SHA224_DIGEST_SIZE];
CRYPT_SHA224_Initialize(&sha);
CRYPT_SHA224_DataAdd(&sha, buffer, sizeof(buffer));
CRYPT_SHA224_Finalize(&sha, shaSum);