SPRUJ17H March 2022 – October 2024 AM2631 , AM2631-Q1 , AM2632 , AM2632-Q1 , AM2634 , AM2634-Q1
To start a new hash, perform the following steps:
After the configuration is complete, the hash engine can receive the data to process (the INPUT_READY bit is 1 in the S_IRQSTATUS register). Data must be written to the 16 × 32-bit S_DATAn_IN registers that provide storage for one 64-byte block of data. Unless the CLOSE_HASH bit is set in the S_MODE (or S_HASH512_MODE) register, the S_DATAn_IN 64-byte input buffer must be filled. Data can be written by single write transactions to the 16 registers from a processor or by a DMA transfer.
For a DMA transfer, the SDAM_EN bit must be set in the S_SYSCONFIG register before starting the new hash and the DMA channel for SHA/MD5 data in request must be configured. The DMA must be configured to the appropriate hash transfer size. A DMA done is asserted after the last S_DATAn_IN register is filled.
The module detects that a 64-byte block is available, and then moves the data to a working register space for processing and sets the INPUT_READY bit to 1 in the S_IRQSTATUS register. If the SDMA_EN bit is set in the S_SYSCONFIG register, then a new DMA request triggers a new block transfer; otherwise, the processor polls the INPUT_READY bit in the S_IRQSTATUS register and writes the 16 data words of 32 bits when it equals 1.
This operation repeats until the length of the message to hash is reached. The OUTPUT_READY bit in the S_IRQSTATUS register then indicates that the hash operation is complete. If the SIT_EN bit in the S_SYSCONFIG register is set, an interrupt (active low) is also generated to indicate the hash completion.