
Advanced encryption standard hardware accelerator (AES)
RM0351
830/1830
DocID024597 Rev 5
Note:
In this stage, no output is provided in AES_DOUTR register.
d) Set GCMPH=”01” in AES_CR to indicate that we are in the header phase.
e) Enable the AES by setting EN bit in AES_CR.
f)
Insert B0 for first transfer, and then B for further transfers.
g) Write 4 times the header message into AES_DINR register.
h) Wait until the computation flag CCF (AES_SR) is set (or use the corresponding
interrupt).
i)
Erase CCF by setting CCFC in AES_CR.
j)
Repeat (g), (h), and (i) until each of the header blocks is inserted. Alternatively,
DMA may be used.
•
CMAC Final Phase:
in this last step, we generate the authorization tag.
Note:
In this stage, The authorization tag of the message is provided in AES_DOUTR register.
k) Choose the combination GCMPH[1:0] = 11 in AES_CR.
l)
Write 4 times the input into the AES_DIN register: the input must be the 128-bit
value formatted from the original B0 packet.(i.e bits [7:3] of B0 should be forced to
zero value).
m) Wait until computation flag CCF is set in AES_SR.
n) Read 4 times the AES_DOUTR: the output is the “auth tag”.
o) Erase the flag by raising CCFC bit in AES_CR.
p) Disable
AES.
Note:
1
The hardware does not manage the formatting operation of the original B0 and B1, the latter
having to contain the header length. This task must be handled by software.
2
No need to disable/enable AES processor when moving from header phase to tag phase.
3
The software should filter the Auth Tag output with tag length to obtain the valid TAG.
Suspend mode in CMAC mode
In CMAC algorithm, suspend mode can be performed only during header phase. It is
advised to not use suspend mode in tag phase since suspend mode has no benefit in this
phase: