AS_Cryptographic co-processor (C3)
RM0082
398/844
Doc ID 018672 Rev 1
21.11.11 HMAC
instruction
There are 4 different HMAC instructions:
●
HMAC MD5
●
HMAC SHA1
●
HMAC CONTEXT
The first 3 instructions are used for computing the HMAC of a message and work in the
same way. The last one is used for saving and restoring the context.
21.11.12 HMAC
[MD5/SHA1] instructions
Each HMAC [MD5/SHA1] instruction is composed by 3 sub-instructions:
●
INIT
●
APPEND
●
END
21.11.13 INIT
The HMAC [MD5/SHA1] INIT instruction is 2 words long. This instruction is used to set the
Function and the Source Address Register for the HMAC key.
Bits ‘aa’ in the above table are used to set the algorithm to use and have the same encoding
as in the HASH INIT instruction (
Bits 15 to 0 in the first instruction word (cccc in
) represent the length in Bytes of
the key.
21.11.14 APPEND
The HMAC [MD5/SHA1] APPEND instruction is 2 words long. This instruction is used to set
the Source Address Register for the message and to start the computation of the HMAC.
The length of the message is encoded in the first instruction word, while the second word
represents the Source Address for the message.
Bits ‘aa’ in the above table are used to set the algorithm to use and have the same encoding
as in the INIT instruction(
Table 338.
HMAC INIT Instruction bit encoding
W#
Bit Encoding
1
xxxx 011a a00x xxxx cccc cccc cccc cccc
2
32 bit Source Address for the key
Table 339.
HMAC APPEND Instruction bit encoding
W#
Bit Encoding
1
xxxx 011a a01x xxxx cccc cccc cccc cccc
2
32 bit Source Address for the message