948
SAM4CP [DATASHEET]
43051E–ATPL–08/14
Figure 41-5.
GCM Block Diagram
41.4.5.2 Key Writing and Automatic Hash Subkey Calculation
Whenever a new key (AES_KEYWRx) is written to the hardware, two automatic actions are processed:
GCM Hash Subkey
H
generation - The GCM hash subkey (
H
) is automatically generated. The GCM hash subkey
generation must be complete before doing any other action. The DATRDY bit of the AES_ISR indicates when the
subkey generation is complete (with interrupt if configured). The GCM hash subkey calculation is processed with
the formula
H
= CIPHER (Key, <128 bits to zero>. The generated GCM
H
value is then available in the
AES_GCMHRx. If the application software requires a specific hash subkey, the automatically generated H value
can be overwritten in the AES_GCMHRx.
The AES_GCMHRx can be written after the end of the hash subkey generation (see AES_ISR.DATRDY) and prior
to starting the input data feed.
AES_GHASHRx Clear - The AES_GHASHRx are automatically cleared. If a hash initial value is needed for the
GHASH it must be written to the AES_GHASHRx:
After a write to AES_KEYWRx, if any
Before starting the input data feed
GHASH Engine
AES CTR Engine
Counter 1
Counter 0
Counter N
Incr
32
Incr
32
Plaintext 1
Auth Tag(T)
len(AAD) || len(C)
Plaintext N
Ciphertext 1
Ciphertext N
GF
128
Mult(H)
GF
128
Mult(H)
GF
128
Mult(H)
GF
128
Mult(H)
Cipher(Key)
Cipher(Key)
Cipher(Key)
(AES_AADLENR, AES_CLENR)
(AES_TAGRx)
(AES_GHASHRx)
(AES_IVRx)
(AES_CTRR)
(AES_IDATARx)
(AES_IDATARx)
(AES_CTRR)
(AES_GHASHRx)
AAD 1
GF
128
Mult(H)
(AES_GCMHRx)
(1)
AAD N
(AES_GHASHRx)
(AES_IDATARx)
(AES_IDATARx)
(AES_KEYWRx)
Notes: 1. Optional