Botan  1.11.15
Public Types | Public Member Functions
Botan::AEAD_Mode Class Reference

#include <aead.h>

Inheritance diagram for Botan::AEAD_Mode:
Botan::Cipher_Mode Botan::Keyed_Transform Botan::Transform Botan::CCM_Mode Botan::ChaCha20Poly1305_Mode Botan::EAX_Mode Botan::GCM_Mode Botan::OCB_Mode Botan::SIV_Mode Botan::CCM_Decryption Botan::CCM_Encryption Botan::ChaCha20Poly1305_Decryption Botan::ChaCha20Poly1305_Encryption Botan::EAX_Decryption Botan::EAX_Encryption Botan::GCM_Decryption Botan::GCM_Encryption Botan::OCB_Decryption Botan::OCB_Encryption Botan::SIV_Decryption Botan::SIV_Encryption

List of all members.

Public Types

typedef SCAN_Name Spec

Public Member Functions

bool authenticated () const override
virtual void clear ()=0
size_t default_nonce_length () const override
virtual void finish (secure_vector< byte > &final_block, size_t offset=0)=0
virtual Key_Length_Specification key_spec () const =0
virtual size_t minimum_final_size () const =0
virtual std::string name () const =0
virtual size_t output_length (size_t input_length) const =0
virtual std::string provider () const
template<typename Alloc >
void set_ad (const std::vector< byte, Alloc > &ad)
virtual void set_associated_data (const byte ad[], size_t ad_len)=0
template<typename Alloc >
void set_associated_data_vec (const std::vector< byte, Alloc > &ad)
template<typename Alloc >
void set_key (const std::vector< byte, Alloc > &key)
void set_key (const SymmetricKey &key)
void set_key (const byte key[], size_t length)
template<typename Alloc >
secure_vector< bytestart (const std::vector< byte, Alloc > &nonce)
secure_vector< bytestart (const byte nonce[], size_t nonce_len)
secure_vector< bytestart ()
virtual secure_vector< bytestart_raw (const byte nonce[], size_t nonce_len)=0
template<typename Alloc >
secure_vector< bytestart_vec (const std::vector< byte, Alloc > &nonce)
virtual size_t tag_size () const
virtual void update (secure_vector< byte > &blocks, size_t offset=0)=0
virtual size_t update_granularity () const =0
bool valid_keylength (size_t length) const
virtual bool valid_nonce_length (size_t nonce_len) const =0

Detailed Description

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).

Definition at line 22 of file aead.h.


Member Typedef Documentation

typedef SCAN_Name Botan::Transform::Spec [inherited]

Definition at line 27 of file transform.h.


Member Function Documentation

bool Botan::AEAD_Mode::authenticated ( ) const [inline, override, virtual]

Returns true iff this mode provides authentication as well as confidentiality.

Reimplemented from Botan::Cipher_Mode.

Definition at line 25 of file aead.h.

{ return true; }
virtual void Botan::Transform::clear ( ) [pure virtual, inherited]
size_t Botan::AEAD_Mode::default_nonce_length ( ) const [inline, override, virtual]

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

Implements Botan::Transform.

Reimplemented in Botan::CCM_Mode.

Definition at line 57 of file aead.h.

{ return 12; }
virtual void Botan::Transform::finish ( secure_vector< byte > &  final_block,
size_t  offset = 0 
) [pure virtual, inherited]
virtual Key_Length_Specification Botan::Keyed_Transform::key_spec ( ) const [pure virtual, inherited]
virtual size_t Botan::Transform::minimum_final_size ( ) const [pure virtual, inherited]
virtual std::string Botan::Transform::name ( ) const [pure virtual, inherited]
virtual size_t Botan::Transform::output_length ( size_t  input_length) const [pure virtual, inherited]
virtual std::string Botan::Transform::provider ( ) const [inline, virtual, inherited]

Return some short name describing the provider of this tranformation. Useful in cases where multiple implementations are available (eg, different implementations of AES). Default "core" is used for the 'standard' implementation included in the library.

Definition at line 120 of file transform.h.

{ return "core"; }
template<typename Alloc >
void Botan::AEAD_Mode::set_ad ( const std::vector< byte, Alloc > &  ad) [inline]

Definition at line 48 of file aead.h.

         {
         set_associated_data(&ad[0], ad.size());
         }
virtual void Botan::AEAD_Mode::set_associated_data ( const byte  ad[],
size_t  ad_len 
) [pure virtual]

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

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

Parameters:
adthe associated data
ad_lenlength of add in bytes

Implemented in Botan::OCB_Mode, Botan::SIV_Mode, Botan::CCM_Mode, Botan::ChaCha20Poly1305_Mode, Botan::GCM_Mode, and Botan::EAX_Mode.

template<typename Alloc >
void Botan::AEAD_Mode::set_associated_data_vec ( const std::vector< byte, Alloc > &  ad) [inline]

Definition at line 42 of file aead.h.

         {
         set_associated_data(&ad[0], ad.size());
         }
template<typename Alloc >
void Botan::Keyed_Transform::set_key ( const std::vector< byte, Alloc > &  key) [inline, inherited]

Definition at line 148 of file transform.h.

Referenced by botan_cipher_set_key().

         {
         set_key(&key[0], key.size());
         }
void Botan::Keyed_Transform::set_key ( const SymmetricKey key) [inline, inherited]

Definition at line 153 of file transform.h.

References Botan::OctetString::begin(), and Botan::OctetString::length().

         {
         set_key(key.begin(), key.length());
         }
void Botan::Keyed_Transform::set_key ( const byte  key[],
size_t  length 
) [inline, inherited]

Set the symmetric key of this transform

Parameters:
keycontains the key material
lengthin bytes of key param

Definition at line 163 of file transform.h.

         {
         if(!valid_keylength(length))
            throw Invalid_Key_Length(name(), length);
         key_schedule(key, length);
         }
template<typename Alloc >
secure_vector<byte> Botan::Transform::start ( const std::vector< byte, Alloc > &  nonce) [inline, inherited]

Begin processing a message.

Parameters:
noncethe per message nonce

Definition at line 34 of file transform.h.

Referenced by botan_cipher_start().

         {
         return start(&nonce[0], nonce.size());
         }
secure_vector<byte> Botan::Transform::start ( const byte  nonce[],
size_t  nonce_len 
) [inline, inherited]

Begin processing a message.

Parameters:
noncethe per message nonce
nonce_lenlength of nonce

Definition at line 55 of file transform.h.

         {
         return start_raw(nonce, nonce_len);
         }
secure_vector<byte> Botan::Transform::start ( ) [inline, inherited]

Begin processing a message.

Definition at line 63 of file transform.h.

         {
         return start_raw(nullptr, 0);
         }
virtual secure_vector<byte> Botan::Transform::start_raw ( const byte  nonce[],
size_t  nonce_len 
) [pure virtual, inherited]
template<typename Alloc >
secure_vector<byte> Botan::Transform::start_vec ( const std::vector< byte, Alloc > &  nonce) [inline, inherited]

Begin processing a message.

Parameters:
noncethe per message nonce

Definition at line 45 of file transform.h.

         {
         return start(&nonce[0], nonce.size());
         }
virtual size_t Botan::Cipher_Mode::tag_size ( ) const [inline, virtual, inherited]

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

Reimplemented in Botan::SIV_Mode, Botan::CCM_Mode, Botan::OCB_Mode, Botan::ChaCha20Poly1305_Mode, Botan::GCM_Mode, and Botan::EAX_Mode.

Definition at line 31 of file cipher_mode.h.

Referenced by botan_cipher_get_tag_length().

{ return 0; }
virtual void Botan::Transform::update ( secure_vector< byte > &  blocks,
size_t  offset = 0 
) [pure virtual, inherited]
virtual size_t Botan::Transform::update_granularity ( ) const [pure virtual, inherited]
bool Botan::Keyed_Transform::valid_keylength ( size_t  length) const [inline, inherited]

Check whether a given key length is valid for this algorithm.

Parameters:
lengththe key length to be checked.
Returns:
true if the key length is valid.

Definition at line 142 of file transform.h.

References Botan::Key_Length_Specification::valid_keylength().

         {
         return key_spec().valid_keylength(length);
         }
virtual bool Botan::Transform::valid_nonce_length ( size_t  nonce_len) const [pure virtual, inherited]

The documentation for this class was generated from the following file: