46.5.3.1.2 Authentication Header Processing
Follow these steps to process the authentication header:
- Configure the CTRLA register as follows:
- CTRLA.STARTMODE as manual.
- CTRLA.CIPHER as encryption.
- CTRLA.KEYSIZE as per the key used.
- CTRLA.AESMODE as GCM.
- CTRLA.CTYPE as per the countermeasures required.
- Set CTRLA.ENABLE.
- Write the key in KEYWORD register.
- Set CTRLB.GFMUL.
- Write the Authentication Data (authdata) to INDATA register.
- Set CTRLB.START as ‘1’.
- Wait for INTFLAG.GFMCMP to be set.
- AES Hardware generates output in the GHASH register.
- Continue steps 4 to 7 for remaining Authentication Header.
Note: If the authdata is less than 128 bit, it must be padded with
zero to make it 128 bit aligned as shown in the figure below.
