I'm currently migrating a project to use the bouncy castle GCM mode. I understand that using an authenticated mode removes the need for a HMAC, however I want to be sure that I'm using this mode correctly. When applying a HMAC to ciphertext, I know it's imperative to include in the HMAC'd data any params that could affect the outcome of the decryption (IV, block-size, algorithm name, etc). The bouncy castle GCM implementation accepts AEAD parameters, one of which is 'Associated Text'.
With authenticated modes, is it correct to:
- use encryption params as Associated Text
- encrypt cleartext (without params appended)
- append params to ciphertext (in cleartext) to facilitate future decryption
I assume this workflow applies to EAX mode as well?