![Texas Instruments SimpleLink Ethernet MSP432E401Y Technical Reference Manual Download Page 1594](http://html1.mh-extra.com/html/texas-instruments/simplelink-ethernet-msp432e401y/simplelink-ethernet-msp432e401y_technical-reference-manual_10955781594.webp)
SHA/MD5 Functional Description
1594
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
SHA/MD5 Accelerator
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.
25.1.5.2.2 Closing a Hash
The amount of data to hash is not necessarily a multiple of 64 bytes. In this case, the CLOSE_HASH bit in
the SHA_MODE register must be set to append padding so that the message size becomes a multiple of
64 bytes. See the previous MD5 algorithm for more information on padding.
The module is fed with a 64-byte block of data, as long as enough data is available. However, a pad is
appended on the last block of data. This can result in the creation of an extra 64-byte block.
The one or two last blocks that contain the padding are processed the same way as the other blocks.
Hash completion is then indicated the same way as for a new hash, and the 128-bit result can be read in
the digest registers. The SHA_DIGESTCOUNT register returns restored digest count and length when it is
read, and hashing completes.
25.1.5.3 Generating an Software Interrupt
If the IT_EN bit is 1 in the SHA_SYSCONFIG register, an interrupt is generated at the completion of the
hash by the following steps:
1. Receive last block of data (= 64 bytes). (The number of data bytes defined by the SHA_LENGTH
register is received in the digest registers, from SHA_ODIGEST_A and SHA_IDIGEST_A to
SHA_ODIGEST_H and SHA_IDIGEST_H.
2. If required, apply padding to the last block of data.
3. Hash the last block of data (80 cycles in SHA-1 mode and 64 cycles in MD5, SHA-224, and SHA-256
modes).
4. If required, add an extra 64-byte block of data to complete the padding.
5. Hash this extra block of data (80 cycles in SHA-1 mode and 64 cycles in MD5, SHA-224, and SHA-256
modes).
6. An interrupt is generated (active low).
25.1.6 SHA/MD5 Performance Information
The following table lists the performance for all supported key sizes and modes of operations. It assumed
that the engine is kept fully utilized (that is, the host is supplying input block and retrieving output blocks in
such a way, that the engine never has to wait for input) and that the previous output has been retrieved
before the next output is ready.
Maximum throughput does not include per operation overhead cycles, as the impact on the throughput
depends on the size of the block being processed, and would be negligible for large blocks anyway.
Table 25-7. SHA/MD5 Performance
Operation
Algorithm
Cycles per
Operation
Cycles per Block
Hash
MD5
0 / 65
65
SHA-1
0 / 81
81
SHA-224
0 / 65
65
SHA-256
0 / 65
65