Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 965 Bytes

GUID-D0E6A58C-11C9-42D2-8D33-05753C8666D5.md

File metadata and controls

48 lines (29 loc) · 965 Bytes

CRYPT_SHA224_Initialize Function

Parent topic:MPLAB® Harmony Crypto Library

C

int CRYPT_SHA224_Initialize(
    CRYPT_SHA256_CTX* sha224
);

Description

This function initializes the internal structures necessary for SHA224 hash calculations.

Preconditions

None.

Parameters

Parameters Description
sha224 Pointer to context which saves state between calls.

Returns

  • BAD_FUNC_ARG - An invalid pointer was passed to the function.

  • 0 - An invalid pointer was not passed to the function.

Remarks

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.

Example

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);