www.ti.com
SHA-MD5 Registers
707
SWRU543–January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SHA/MD5 Accelerator
Outer digest registers are only relevant for HMAC operations; contents are ignored for hash operations.
• SHAMD5_ODIGEST_A
• SHAMD5_ODIGEST_B
• SHAMD5_ODIGEST_C
• SHAMD5_ODIGEST_D
• SHAMD5_ODIGEST_E
• SHAMD5_ODIGEST_F
• SHAMD5_ODIGEST_G
• SHAMD5_ODIGEST_H
The outer digest for HMAC operations without key processing (HMAC key processing = 0) must be written
to these registers before starting the operation by writing to SHAMD5_MODE. Only the relevant digest
registers for the selected algorithm must be written, A-D for MD5, A-E for SHA-1, A-H for SHA-2 (224 and
256).
When HMAC key processing is 1, these registers must be written with the lower 256 bits of the HMAC key
to be processed, in little-endian format (first byte of key string in bits [7:0]). If the HMAC key is less than
512 bits in size, it must be properly padded to the block size with zeroes on the most significant bytes. All
16 HMAC key registers must be written explicitly, as the core does not pad the HMAC key. Additionally, if
the HMAC key is larger than 512 bits, the host is responsible for performing a preprocessing step to
reduce it to one 512-bit block. This involves hashing the large key and padding the hash result with zeroes
until it is 512 bits wide.
The computed outer digest can be read from these registers when the status register indicates that the
operation is done or suspended due to a context switch request. If no HMAC key processing is performed,
the value read here would be identical to the value written initially. The MD5 outer digest is available from
digest registers A-D, the SHA-1 outer digest from registers A-E, and the SHA-224 and 256 outer digest
from registers A-H.
The HMAC key itself cannot be read back from these registers, but it is preserved for future processing as
long as the SHAMD5_ODIGEST registers are not overwritten; this allows reuse of the HMAC key (without
having to redo the HMAC key processing) for subsequent data blocks without having to reload it. This is
done by setting HMAC key processing to 0 and Reuse HMAC key to 1 in the SHAMD5_MODE register.