Botan

Interface for AEAD modes

License
Botan is released under the Simplified BSD License (see LICENSE.md)

abstract class  AEADMode: botan.modes.cipher_mode.CipherMode, botan.algo_base.transform.Transformation;

Interface for AEAD (Authenticated Encryption with Associated Data) modes. These modes provide both encryption and message authentication, and can authenticate additional per-message data which is not included in the ciphertext (for instance a sequence number).


abstract void  setAssociatedData(const(ubyte)* ad, size_t ad_len);

Set associated data that is not included in the ciphertext but that should be authenticated. Must be called after setKey and before finish.

Unless reset by another call, the associated data is kept between messages. Thus, if the AD does not change, calling once (after setKey) is the optimum.

Parameters
const(ubyte)* ad the associated data
size_t ad_len length of add in bytes

const size_t  defaultNonceLength();

Default AEAD nonce size (a commonly supported value among AEAD modes, and large enough that random collisions are unlikely).


abstract const size_t  tagSize();

Return the size of the authentication tag used (in bytes)


AEADMode  getAead(in string algo_spec, CipherDir direction);

Get an AEAD mode by name (eg "AES-128/GCM" or "Serpent/EAX")