SLAU723A October 2017 – October 2018 MSP432E401Y , MSP432E411Y
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 SHA_IRQSTATUS register). Data must be written to the 16 x 32-bit SHA_DATA_n_IN registers that provide storage for one 64-byte block of data. Unless the CLOSE_HASH bit is set in the SHA_MODE register, the SHA_DATA_n_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 SHA_SYSCONFIG register before starting the new hash and the µDMA channel for SHA/MD5 0 Data In Request must be configured. The µDMA must be configured to the appropriate hash transfer size. See Section 8 for more information on programming the µDMA. A µDMA done is asserted after the last SHA_DATA_n_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 SHA_IRQSTATUS register. If the DMA_EN bit is set in the SHA_SYSCONFIG register, then a new µDMA request triggers a new block transfer; otherwise, the processor polls the INPUT_READY bit in the SHA_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 SHA_IRQSTATUS register then indicates that the hash operation is complete. If the IT_EN bit in the SHA_SYSCONFIG register is set, an interrupt (active low) is also generated to indicate the hash completion.