Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 997 Bytes

GUID-9165664B-EF21-4D37-A47E-130E9A3FE5FB.md

File metadata and controls

48 lines (29 loc) · 997 Bytes

CRYPT_SHA384_Initialize Function

Parent topic:MPLAB® Harmony Crypto Library

C

int CRYPT_SHA384_Initialize(
    CRYPT_SHA384_CTX* sha384
);

Description

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

Preconditions

None.

Parameters

Parameters Description
sha384 Pointer to CRYPT_SHA384_CTX structure which holds the hash values.

Returns

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

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

Remarks

All SHA384 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_SHA384_CTX sha384;
uint8_t shaSum[SHA384_DIGEST_SIZE];

CRYPT_SHA384_Initialize(&sha384);
CRYPT_SHA384_DataAdd(&sha384, buffer, sizeof(buffer));
CRYPT_SHA384_Finalize(&sha384, shaSum);