EasyManua.ls Logo

Texas Instruments CC3235 SimpleLink Series - Page 698

Texas Instruments CC3235 SimpleLink Series
799 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
SHA/MD5 Functional Description
www.ti.com
698
SWRU543January 2019
Submit Documentation Feedback
Copyright © 2019, Texas Instruments Incorporated
SHA/MD5 Accelerator
19.1.3.1.2 Outer Digest Registers
The SHAMD5_ODIGEST_A to SHAMD5_ODIGEST_H registers are relevant only for HMAC operations;
the contents are ignored for hash operations.
Before writing to the digest registers, the operation must be configured in the SHA Mode
(SHAMD5_MODE) register. For HMAC operations without key processing, the HMAC_KEY_PROC bit
must be clear in the SHAMD5_MODE register before starting operations. Once the algorithm has been
programmed in the SHAMD5_MODE register, only the relevant digest registers for the selected algorithm
must be written:
SHAMD5_ODIGEST_A to SHAMD5_ODIGEST_D registers for MD5
SHAMD5_ODIGEST_A to SHAMD5_ODIGEST_E registers for SHA-1
SHAMD5_ODIGEST_A to SHAMD5_ODIGEST_H registers for SHA-2 (224 to 256)
When HMAC key processing is enabled (HMAC_KEY_PROC=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]).
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 computed outer digest can be read from these registers when the SHA Interrupt Status
(SHAMD5_IRQSTATUS) register when the OUTPUT_READY bit has been set indicating that the
operation is done.
NOTE: If no HMAC key processing is performed, the value read is identical to the value written
initially. The MD5 outer digest is available from registers SHAMD5_ODIGEST_A to
SHAMD5_ODIGEST_D, the SHA-1 outer digest from registers SHAMD5_ODIGEST_A to
SHAMD5_ODIGEST_E, and the SHA-224 and SHA-256 outer digest from
registersSHAMD5_ODIGEST_A to SHAMD5_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.
19.1.3.1.3 Inner Digest Registers
The SHAMD5_IDIGEST_A to SHAMD5_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
SHAMD5_MODE register. Only the relevant digest registers for the selected algorithm must be written:
SHAMD5_IDIGEST_A to SHAMD5_IDIGEST_D registers for MD5
SHAMD5_IDIGEST_A to SHAMD5_IDIGEST_E registers for SHA-1
SHAMD5_IDIGEST_A to SHAMD5_IDIGEST_H registers for SHA-2
When ALGO_CONSTANT = 1 in the SHAMD5_MODE register, the SHA Inner Digest n
(SHAMD5_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]).

Table of Contents

Related product manuals