Botan 3.6.1
Crypto and TLS for C&
|
#include <ghash.h>
Public Member Functions | |
void | add_final_block (secure_vector< uint8_t > &x, size_t ad_len, size_t pt_len) |
void | clear () override |
void | final (std::span< uint8_t > out) |
void | ghash_update (secure_vector< uint8_t > &x, std::span< const uint8_t > input) |
bool | has_keying_material () const override |
Key_Length_Specification | key_spec () const override |
size_t | maximum_keylength () const |
size_t | minimum_keylength () const |
std::string | name () const override |
void | nonce_hash (secure_vector< uint8_t > &y0, std::span< const uint8_t > nonce) |
std::string | provider () const |
void | reset () |
void | set_associated_data (std::span< const uint8_t > ad) |
void | set_key (const SymmetricKey &key) |
void | set_key (const uint8_t key[], size_t length) |
void | set_key (std::span< const uint8_t > key) |
void | start (std::span< const uint8_t > nonce) |
void | update (std::span< const uint8_t > in) |
void | update_associated_data (std::span< const uint8_t > ad) |
bool | valid_keylength (size_t length) const |
Protected Member Functions | |
void | assert_key_material_set () const |
void | assert_key_material_set (bool predicate) const |
void Botan::GHASH::add_final_block | ( | secure_vector< uint8_t > & | x, |
size_t | ad_len, | ||
size_t | pt_len ) |
Definition at line 176 of file ghash.cpp.
References ghash_update(), and Botan::store_be().
Referenced by final(), and nonce_hash().
|
inlineprotectedinherited |
Definition at line 139 of file sym_algo.h.
References Botan::SymmetricAlgorithm::assert_key_material_set().
Referenced by Botan::SymmetricAlgorithm::assert_key_material_set(), Botan::Salsa20::cipher_bytes(), Botan::AES_128::decrypt_n(), Botan::AES_192::decrypt_n(), Botan::AES_256::decrypt_n(), Botan::ARIA_128::decrypt_n(), Botan::ARIA_192::decrypt_n(), Botan::ARIA_256::decrypt_n(), Botan::Blowfish::decrypt_n(), Botan::Camellia_128::decrypt_n(), Botan::Camellia_192::decrypt_n(), Botan::Camellia_256::decrypt_n(), Botan::CAST_128::decrypt_n(), Botan::DES::decrypt_n(), Botan::GOST_28147_89::decrypt_n(), Botan::IDEA::decrypt_n(), Botan::Kuznyechik::decrypt_n(), Botan::Lion::decrypt_n(), Botan::Noekeon::decrypt_n(), Botan::SEED::decrypt_n(), Botan::Serpent::decrypt_n(), Botan::SHACAL2::decrypt_n(), Botan::SM4::decrypt_n(), Botan::Threefish_512::decrypt_n(), Botan::TripleDES::decrypt_n(), Botan::Twofish::decrypt_n(), Botan::AES_128::encrypt_n(), Botan::AES_192::encrypt_n(), Botan::AES_256::encrypt_n(), Botan::ARIA_128::encrypt_n(), Botan::ARIA_192::encrypt_n(), Botan::ARIA_256::encrypt_n(), Botan::Blowfish::encrypt_n(), Botan::Camellia_128::encrypt_n(), Botan::Camellia_192::encrypt_n(), Botan::Camellia_256::encrypt_n(), Botan::CAST_128::encrypt_n(), Botan::DES::encrypt_n(), Botan::GOST_28147_89::encrypt_n(), Botan::IDEA::encrypt_n(), Botan::Kuznyechik::encrypt_n(), Botan::Lion::encrypt_n(), Botan::Noekeon::encrypt_n(), Botan::SEED::encrypt_n(), Botan::Serpent::encrypt_n(), Botan::SHACAL2::encrypt_n(), Botan::SM4::encrypt_n(), Botan::Threefish_512::encrypt_n(), Botan::TripleDES::encrypt_n(), Botan::Twofish::encrypt_n(), final(), ghash_update(), Botan::ChaCha::seek(), Botan::CTR_BE::seek(), Botan::Salsa20::seek(), Botan::OCB_Mode::set_associated_data_n(), Botan::Salsa20::set_iv_bytes(), update(), and update_associated_data().
|
inlineprotectedinherited |
Definition at line 141 of file sym_algo.h.
|
overridevirtual |
Reset the internal state. This includes not just the key, but any partial message that may have been in process.
Implements Botan::SymmetricAlgorithm.
Definition at line 210 of file ghash.cpp.
References reset(), and Botan::zap().
void Botan::GHASH::final | ( | std::span< uint8_t > | out | ) |
Definition at line 189 of file ghash.cpp.
References add_final_block(), Botan::SymmetricAlgorithm::assert_key_material_set(), and BOTAN_ARG_CHECK.
void Botan::GHASH::ghash_update | ( | secure_vector< uint8_t > & | x, |
std::span< const uint8_t > | input ) |
Definition at line 82 of file ghash.cpp.
References Botan::SymmetricAlgorithm::assert_key_material_set(), Botan::copy_mem(), and Botan::secure_scrub_memory().
Referenced by add_final_block(), nonce_hash(), set_associated_data(), update(), and update_associated_data().
|
overridevirtual |
Implements Botan::SymmetricAlgorithm.
Definition at line 105 of file ghash.cpp.
|
inlineoverridevirtual |
Implements Botan::SymmetricAlgorithm.
Definition at line 38 of file ghash.h.
|
inlineinherited |
Definition at line 95 of file sym_algo.h.
|
inlineinherited |
Definition at line 100 of file sym_algo.h.
|
inlineoverridevirtual |
Implements Botan::SymmetricAlgorithm.
Definition at line 46 of file ghash.h.
void Botan::GHASH::nonce_hash | ( | secure_vector< uint8_t > & | y0, |
std::span< const uint8_t > | nonce ) |
Definition at line 203 of file ghash.cpp.
References add_final_block(), BOTAN_ASSERT, and ghash_update().
std::string Botan::GHASH::provider | ( | ) | const |
Definition at line 20 of file ghash.cpp.
References Botan::CPUID::has_carryless_multiply(), and Botan::CPUID::has_vperm().
void Botan::GHASH::reset | ( | ) |
Definition at line 216 of file ghash.cpp.
References Botan::zeroise().
Referenced by clear().
void Botan::GHASH::set_associated_data | ( | std::span< const uint8_t > | ad | ) |
Definition at line 153 of file ghash.cpp.
References ghash_update(), and Botan::zeroise().
|
inlineinherited |
Set the symmetric key of this object.
key | the SymmetricKey to be set. |
Definition at line 113 of file sym_algo.h.
References Botan::OctetString::begin(), Botan::OctetString::length(), and Botan::SymmetricAlgorithm::set_key().
Referenced by Botan::create_aes_row_generator(), Botan::Sodium::crypto_stream_salsa20(), Botan::Sodium::crypto_stream_salsa20_xor_ic(), Botan::Sodium::crypto_stream_xsalsa20(), Botan::Sodium::crypto_stream_xsalsa20_xor_ic(), Botan::FPE::fe1_decrypt(), Botan::FPE::fe1_encrypt(), Botan::Sphincs_Hash_Functions_Sha2::PRF_msg(), Botan::Sodium::randombytes_buf_deterministic(), and Botan::SymmetricAlgorithm::set_key().
|
inlineinherited |
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 126 of file sym_algo.h.
References Botan::SymmetricAlgorithm::set_key().
Referenced by Botan::SymmetricAlgorithm::set_key().
|
inherited |
Set the symmetric key of this object.
key | the contiguous byte range to be set. |
Definition at line 17 of file sym_algo.cpp.
References Botan::SymmetricAlgorithm::name(), and Botan::SymmetricAlgorithm::valid_keylength().
void Botan::GHASH::start | ( | std::span< const uint8_t > | nonce | ) |
Definition at line 147 of file ghash.cpp.
References BOTAN_ARG_CHECK.
void Botan::GHASH::update | ( | std::span< const uint8_t > | in | ) |
Definition at line 170 of file ghash.cpp.
References Botan::SymmetricAlgorithm::assert_key_material_set(), and ghash_update().
void Botan::GHASH::update_associated_data | ( | std::span< const uint8_t > | ad | ) |
Definition at line 164 of file ghash.cpp.
References Botan::SymmetricAlgorithm::assert_key_material_set(), and ghash_update().
|
inlineinherited |
Check whether a given key length is valid for this algorithm.
length | the key length to be checked. |
Definition at line 107 of file sym_algo.h.
Referenced by Botan::SymmetricAlgorithm::set_key().