SHA/MD5 Functional Description
1596
SLAU723A – October 2017 – Revised October 2018
Copyright © 2017–2018, Texas Instruments Incorporated
SHA/MD5 Accelerator
appropriate padding is inserted and the outer hash is performed immediately after the inner hash has
finished.
8. Program the SHA_LENGTH register with the block length. Writing this register triggers the HMAC
engine to begin processing.
NOTE:
If more than one pass is used during the process (SHA_MODE[4] CLOSE_HASH == 0x0),
the block length value must be a 64-byte multiple. From this point, three operational modes
are possible to continue with the processing: polling, interrupt, and DMA. For more
information, see the Operational Modes Configuration section.
25.1.7.1.2.1 Subsequence – Continuing a Prior HMAC Using the SHA-1 Hash Function
The following procedure is used to continue a prior HMAC calculation interrupted from a high priority task
(see
Table 25-8. Continuing a Prior HMAC
Step
Register / Bit Field / Programming Model
Value
Load the initial digest for the used hash algorithm.
SHA_IDIGEST_i[31:0] DATA
-
Restore the digest counter with the value before the switch to the
high-priority task.
SHA_DIGEST_COUNT[31:0] COUNT
-
Use the already loaded in the engine key.
SHA_MODE[5] HMAC_KEY_PROC
0x0
Do not use the constants of the selected hash algorithm.
SHA_MODE[3] ALGO_CONSTANT
0x0
Select the SHA-1 hash algorithm.
SHA_MODE[2:1] ALGO
0x1
IF: This is the last 64-byte data block from the input message?
User decision
-
Close the hash; an appropriate padding is added.
SHA_MODE[4] CLOSE_HASH
0x1
ENDIF
-
Load the block length; this is the trigger to start processing.
SHA_LENGTH[31:0] LENGTH
-
NOTE:
This initial digest is the intermediate digest from the previous calculation before switching to
the high priority task. The value is equal to context1 in.
NOTE:
The value is equal to context2 in.
NOTE:
The block length is equal to the context3 value in.
25.1.7.1.2.2 Subsequence – Hashing a Key Bigger Than 512 Bits With the SHA-1 Hash Function
The following procedure is used to create a hash value from the key in only one pass (see
).
Table 25-9. SHA-1 Apply on the Key
Step
Register / Bit Field / Programming Model
Value
Load the first part of the key (here, the key is like a message).
SHA_DATA_n_IN (i = 0 to 15)
-
Select the SHA-1 hash function.
SHA_MODE[2:1] ALGO
0x1
Select a new hash operation.
SHA_MODE[3] ALGO_CONSTANT
0x1
Close the hash; the key is processed in single pass.
SHA_MODE[4] CLOSE_HASH
0x1