Datasheet
SHA_ODIGEST_D, the SHA-1 outer digest from registers SHA_ODIGEST_A to
SHA_ODIGEST_E, and the SHA-224 and SHA-256 outer digest from
registersSHA_ODIGEST_A to SHA_ODIGEST_H.
Note: The HMAC key is not preserved. If another block must be authenticated using the same
key, the key must be reloaded by the host. If the same key must be used many times, it is
advisable to do a HMAC key processing-only pass to obtain the inner and outer digest
precomputes and load these precomputes for subsequent passes (only the inner digest
must be reloaded if the outer digest is not modified by the host), because this saves two
hash blocks worth of computation time.
Inner Digest Registers
The SHA_IDIGEST_A to SHA_IDIGEST_H registers are used for HMAC and hash operations.
The inner/initial digest for HMAC and hash continue operations (HMAC_KEY_PROC = 0 and
ALGO_CONSTANT = 0) must be written to these registers before starting the operation by writing to
the SHA_MODE register. Only the relevant digest registers for the selected algorithm must be
written:
■ SHA_IDIGEST_A to SHA_IDIGEST_D registers for MD5
■ SHA_IDIGEST_A to SHA_IDIGEST_E registers for SHA-1
■ SHA_IDIGEST_A to SHA_IDIGEST_H registers for SHA-2
When ALGO_CONSTANT = 1 in the SHA_MODE register, the SHA Inner Digest n (SHA_IDIGEST_n)
registers do not need to be written by the application because they are overwritten with the appropriate
algorithm constants.
When HMAC_KEY_PROC is 1, these registers must be written with the upper 256 bits of the HMAC
key to be processed in little-endian format (first byte of key string in bits [7:0]).
Note: If the HMAC key is less than 512 bits, it must be properly padded with zeros: all 16 HMAC
key registers must be written explicitly; the core does not pad. Additionally, if the HMAC
key is larger than 512 bits, the host must perform a preprocessing step to reduce it to one
512-bit block. This involves hashing the large key and padding the hash result with zeros
until it is 512 bits wide.
The order of the bytes within the digest is such that it can be fed back unmodified into the little-endian
data input when preprocessing HMAC keys larger than 64 bytes, or it can typically be inserted
unmodified into a little-endian data stream (for example, IPSEC packets), regardless of the selected
algorithm.
Note: The HMAC key or inner digest is not preserved. If another block must be authenticated
using the same key, the key or inner digest must be reloaded by the host. If the same key
must be used many times, it is advisable to do a HMAC key processing-only pass to obtain
the inner and outer digest precomputes and load these precomputes for subsequent passes
(only the inner digest must be reloaded if the outer digest is not modified by the host),
because this saves two hash blocks worth of computation time.
Closing a Hash
The amount of data to hash is not necessarily a multiple of 64 bytes. The CLOSE_HASH bit in the
SHA_MODE register is set to append padding so that the message size becomes a multiple of 64
bytes. Consequently, a minimum of 9 bytes must be added to the message. Nine bytes is the
minimum number of bytes that contains the minimum 65-bit padding specified by FIPS 180-1.
June 18, 20141050
Texas Instruments-Production Data
SHA/MD5 Accelerator