Datasheet

2. Pad the rest of the SHA _ODIGEST_x and SHA_IDIGEST registers with zeros.
3. Load the message in the SHA_DATA_n_IN FIFO registers.
4. Enable HMAC key processing by setting the HMAC_KEY_PROC bit in the SHA_MODE register.
5. Select the SHA-1 hash function by programming the ALGO bit in the SHA_MODE register to
0x1.
6. Select the already loaded key by programming the ALGO_CONSTANT bit in the SHA_MODE
register to 0x0.
7. Set the CLOSE_HASH bit and the HMAC_OUTER_HASH bit in the SHA_MODE register so that
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.
Subsequence - Continuing a Prior HMAC Using the SHA-1 Hash Function
The procedure in continues a prior HMAC calculation interrupted from a high priority task.
Table 15-8. Continuing a Prior HMAC
ValueRegister/Bit Field/Programming ModelStep
-SHA_IDIGEST_i[31:0] DATALoad the initial digest for the used hash algorithm.
-SHA_DIGEST_COUNT[31:0] COUNTRestore the digest counter with the value before the switch
to the high-priority task.
0x0SHA_MODE[5] HMAC_KEY_PROCUse the already loaded in the engine key.
0x0SHA_MODE[3] ALGO_CONSTANTDo not use the constants of the selected hash algorithm.
0x1SHA_MODE[2:1] ALGOSelect the SHA-1 hash algorithm.
User decisionIF: This is the last 64-byte data block from the input
message?
0x1SHA_MODE[4] CLOSE_HASHClose the hash; an appropriate padding is added.
ENDIF
-SHA_LENGTH[31:0] LENGTHLoad the block length; this is the trigger to start processing.
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 .
Subsequence - Hashing a Key Bigger than 512 Bits with the SHA-1 Hash Function
The procedure in creates a hash value from the key in only one pass.
1055June 18, 2014
Texas Instruments-Production Data
Tiva
TM4C129ENCPDT Microcontroller