1.5.2.1 DRV_CRYPTO_HASH_Digest()

HASH_ERROR DRV_CRYPTO_HASH_Digest (void * contextData, HASHCON_MODE mode, const uint8_t * data, uint32_t dataLength, const uint8_t * digest, uint32_t digestLength)

This function performs a complete hash operation and generates a digest.

Parameters:
contextData

A pointer to the context block that contains the hash context data.

mode

The HASHCON_MODE to use.

data

The data to add to the operation.

dataLength

The length of the data.

digest

Buffer to contain the digest.

digestLength

The size of the digest buffer.

Return values:
HASH_NO_ERROR

Success.

HASH_CONTEXT_ERROR

Invalid or corrupted hash context.

HASH_INITIALIZE_ERROR

Failure during hash initialization.

HASH_STATE_ERROR

Invalid or unexpected hash state.

HASH_EXECUTE_ERROR

Failure during hash execution.

Note:

A hash operation must be in progress (initialized by DRV_HASH_CRYPTO_Initialize()).