The following procedure is used to begin a new HMAC operation, starting from initial digest values.
- Load the key value in the S_ODIGEST_A/_IDIGEST_A
to S_ODIGEST_H/S_IDIGEST_H (or alternatively S_HASH512_X) registers.
- Pad the rest of the ODIGEST and IDIGEST registers
with zeros.
- Load the message in the S_DATAn_IN FIFO
registers.
- Enable HMAC key processing by setting the
HMAC_KEY_PROC bit in the S_MODE register.
- Select the SHA-1 hash function by programming the
ALGORITHM bit in the S_HASH512_MODE register to 0x010.
- Select the already loaded key by programming the
ALGO_CONSTANT bit in the S_MODE register to 0x0.
- Set the CLOSE_HASH bit and the HMAC_OUTER_HASH
bit in the S_MODE register so that appropriate padding is inserted and the outer hash is
performed immediately after the inner hash has finished.
- Program the S_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
(S_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 Section 7.3.4.5.1.4.1.4.