SHA-3 - 2023.1 English

Standalone Library Documentation: BSP and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2023-05-16
Version
2023.1 English

This block uses the NIST-approved SHA-3 algorithm to generate a 384-bit hash on the input data. Because the SHA-3 hardware only accepts 104 byte blocks as the minimum input size, the input data will be padded with user selectable Keccak or NIST SHA-3 padding and is handled internally in the SHA-3 library.

Initialization & Configuration

The SHA-3 driver instance can be initialized using the XSecure_Sha3Initialize() function. A pointer to CsuDma instance has to be passed during initialization as the CSU DMA will be used for data transfers to the SHA module.

SHA-3 Function Usage

When all the data is available on which the SHA3 hash must be calculated, the XSecure_Sha3Digest() can be used with the appropriate parameters as described. When all the data is not available, use the SHA3 functions in the following order:
  1. XSecure_Sha3Start()
  2. XSecure_Sha3Update() - This function can be called multiple times until all input data has been passed to the SHA-3 cryptographic core.
  3. XSecure_Sha3Finish() - Provides the final hash of the data. To get intermediate hash values after each XSecure_Sha3Update() , you can call XSecure_Sha3_ReadHash() after the XSecure_Sha3Update() call.