1.66 CRYPT_SHA384_Initialize Function

C

int CRYPT_SHA384_Initialize(
    CRYPT_SHA384_CTX* sha384
);

Description

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

Preconditions

None.

Parameters

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