* denotes zero or more repeats.
InitKey(key) { For each packet do: SetNonce(nonce) { AddAAD(aad-chunk) }* StartEncrypt() { ciphertext-chunk <-- Update(plaintext-chunk) }* tag <-- FinishEncrypt() }* Destroy()
InitKey(key) { For each packet do: SetNonce(nonce) { AddAAD(aad-chunk) }* StartDecrypt(tag-to-check) { plaintext-chunk <-- Update(ciphertext-chunk) }* (OK|FAIL) <-- FinishDecrypt() }* Destroy()
Notes on incremental mode:
AEAD_FinishDecrypt
returns either OK or FAIL and throw it all away if FAIL is returned.
AEAD_InitKey
at any time will delete any existing state ready to start again with the same key.
AEAD_Destroy
is similar except all state including the key is destroyed.