46.5.3.1.2 Authentication Header Processing

Follow these steps to process the authentication header:

  1. Configure the CTRLA register as follows:
    1. CTRLA.STARTMODE as manual.
    2. CTRLA.CIPHER as encryption.
    3. CTRLA.KEYSIZE as per the key used.
    4. CTRLA.AESMODE as GCM.
    5. CTRLA.CTYPE as per the countermeasures required.
  2. Set CTRLA.ENABLE.
  3. Write the key in KEYWORD register.
  4. Set CTRLB.GFMUL.
  5. Write the Authentication Data (authdata) to INDATA register.
  6. Set CTRLB.START as ‘1’.
  7. Wait for INTFLAG.GFMCMP to be set.
  8. AES Hardware generates output in the GHASH register.
  9. 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.