Botan
1.11.15
|
#include <gcm.h>
Public Member Functions | |
void | clear () override |
secure_vector< byte > | final () |
Key_Length_Specification | key_spec () const |
size_t | maximum_keylength () const |
size_t | minimum_keylength () const |
std::string | name () const |
secure_vector< byte > | nonce_hash (const byte nonce[], size_t len) |
void | set_associated_data (const byte ad[], size_t ad_len) |
void | set_key (const SymmetricKey &key) |
template<typename Alloc > | |
void | set_key (const std::vector< byte, Alloc > &key) |
void | set_key (const byte key[], size_t length) |
void | start (const byte nonce[], size_t len) |
void | update (const byte in[], size_t len) |
bool | valid_keylength (size_t length) const |
void Botan::GHASH::clear | ( | ) | [override, virtual] |
Implements Botan::SymmetricAlgorithm.
Definition at line 145 of file gcm.cpp.
References Botan::zeroise().
secure_vector< byte > Botan::GHASH::final | ( | ) |
Key_Length_Specification Botan::GHASH::key_spec | ( | ) | const [inline, virtual] |
Implements Botan::SymmetricAlgorithm.
Definition at line 124 of file gcm.h.
{ return Key_Length_Specification(16); }
size_t Botan::SymmetricAlgorithm::maximum_keylength | ( | ) | const [inline, inherited] |
Definition at line 36 of file sym_algo.h.
References Botan::Key_Length_Specification::maximum_keylength().
{ return key_spec().maximum_keylength(); }
size_t Botan::SymmetricAlgorithm::minimum_keylength | ( | ) | const [inline, inherited] |
Definition at line 44 of file sym_algo.h.
{ return key_spec().minimum_keylength(); }
std::string Botan::GHASH::name | ( | ) | const [inline, virtual] |
secure_vector< byte > Botan::GHASH::nonce_hash | ( | const byte | nonce[], |
size_t | len | ||
) |
Definition at line 134 of file gcm.cpp.
References BOTAN_ASSERT.
{ BOTAN_ASSERT(m_ghash.size() == 0, "nonce_hash called during wrong time"); secure_vector<byte> y0(16); ghash_update(y0, nonce, nonce_len); add_final_block(y0, 0, nonce_len); return y0; }
void Botan::GHASH::set_associated_data | ( | const byte | ad[], |
size_t | ad_len | ||
) |
Definition at line 97 of file gcm.cpp.
References Botan::zeroise().
{ zeroise(m_H_ad); ghash_update(m_H_ad, input, length); m_ad_len = length; }
void Botan::SymmetricAlgorithm::set_key | ( | const SymmetricKey & | key | ) | [inline, inherited] |
Set the symmetric key of this object.
key | the SymmetricKey to be set. |
Definition at line 63 of file sym_algo.h.
References Botan::OctetString::begin(), and Botan::OctetString::length().
Referenced by Botan::aont_package(), Botan::aont_unpackage(), botan_mac_set_key(), Botan::TLS::Session::decrypt(), Botan::TLS::Session::encrypt(), and Botan::pbkdf2().
{ set_key(key.begin(), key.length()); }
void Botan::SymmetricAlgorithm::set_key | ( | const std::vector< byte, Alloc > & | key | ) | [inline, inherited] |
Definition at line 69 of file sym_algo.h.
{ set_key(&key[0], key.size()); }
void Botan::SymmetricAlgorithm::set_key | ( | const byte | key[], |
size_t | length | ||
) | [inline, inherited] |
Set the symmetric key of this object.
key | the to be set as a byte array. |
length | in bytes of key param |
Definition at line 79 of file sym_algo.h.
{ if(!valid_keylength(length)) throw Invalid_Key_Length(name(), length); key_schedule(key, length); }
void Botan::GHASH::start | ( | const byte | nonce[], |
size_t | len | ||
) |
void Botan::GHASH::update | ( | const byte | in[], |
size_t | len | ||
) |
Definition at line 105 of file gcm.cpp.
References BOTAN_ASSERT.
{ BOTAN_ASSERT(m_ghash.size() == 16, "Key was set"); m_text_len += length; ghash_update(m_ghash, input, length); }
bool Botan::SymmetricAlgorithm::valid_keylength | ( | size_t | length | ) | const [inline, inherited] |
Check whether a given key length is valid for this algorithm.
length | the key length to be checked. |
Definition at line 54 of file sym_algo.h.
Referenced by Botan::aont_package(), and Botan::aont_unpackage().
{ return key_spec().valid_keylength(length); }