Legend:
Library
Module
Module type
Parameter
Class
Class type
Agile, multiplexing AEAD interface exposing AES128-GCM, AES256-GCM, and Chacha20-Poly1305
To use the agile AEAD interface, users first need to initialise an internal state using init. This state will then need to be passed to every call to encrypt and decrypt. It can be reused as many times as needed. Users are not required to manually free the state.
The tag buffer must be 16 bytes long. For key and iv, each algorithm has different constraints:
encrypt key iv ad pt takes a key, an initial value iv, additional data ad, and plaintext pt and, if successful, returns a tuple containing the encrypted pt and the authentication tag for the plaintext and the associated data.
decrypt key iv ad ct tag takes a key, the initial value iv, additional data ad, ciphertext ct, and authentication tag tag, and, if successful, returns the decrypted ct.