46.5.3.1.3 Plain Text Processing

Follow these steps for processing the plain text:

  1. Set CTRLB.NEWMSG for the new set of plain text processing.
  2. Load the CIPLEN register.
  3. Load (J0+1) in the INTVECT register.
  4. As described in NIST documentation J 0 = IV || 0 31 || 1 when len (IV) = 96 and J0 = GHASHH (IV || 0 s+64 || [len (IV)] 64 ) (where, ‘s’ is the minimum number of zeroes that must be padded with the Initialization Vector to make it a multiple of 128) if len (IV) ! = 96.
  5. Load plain text in the INDATA register.
  6. Set CTRLB.START as ‘1’.
  7. Wait for INTFLAG.ENCCMP to be set.
  8. AES hardware generates output in the INDATA register.
  9. Intermediate GHASH is stored in the GHASH register and ciphertext is available in the INDATA register.
  10. Continue Step 3 to 6 till the input of plain text to get the ciphertext and the HashKeys.
  11. At the last input, set CTRLB.EOM.
  12. Write last in-data to the INDATA register.
  13. Set CTRLB.START as 1.
  14. Wait for INTFLAG.ENCCMP to be set.
  15. AES Hardware generates output in the INDATA register and final HashKey in the GHASH register.
  16. Load [LEN(A)]64||[LEN(C)]64 in the INDATA register and set CTRLB.GFMUL and CTRLB.START as ‘1’.
  17. Wait for INTFLAG.GFMCMP to be set.
  18. AES Hardware generates final GHASH value in the GHASH register.