|
Botan 3.13.0
Crypto and TLS for C&
|
#include <polyval.h>
Public Member Functions | |
| void | clear () override |
| void | final (std::span< uint8_t, BS > out) |
| Write the current state to out, and reset the state. | |
| 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 |
| std::string | provider () const |
| void | set_key (const OctetString &key) |
| void | set_key (const uint8_t key[], size_t length) |
| void | set_key (std::span< const uint8_t > key) |
| void | update (std::span< const uint8_t > input) |
| bool | valid_keylength (size_t length) const |
| void | zero_pad () |
| Zero pad the input to a multiple of the block size. | |
Protected Member Functions | |
| void | assert_key_material_set () const |
| void | assert_key_material_set (bool predicate) const |
POLYVAL universal hash (RFC 8452), used by AES-GCM-SIV
This is not a secure MAC; it must only be used as a component of a construction (like GCM-SIV) which encrypts its output.
|
inlineprotectedinherited |
Throw Key_Not_Set unless a key has been set on this object
Definition at line 180 of file sym_algo.h.
References assert_key_material_set(), and has_keying_material().
Referenced by assert_key_material_set(), Botan::Salsa20::cipher_bytes(), Botan::Lion::decrypt_n(), Botan::Lion::encrypt_n(), Botan::GHASH::final(), Botan::Polyval::final(), Botan::Salsa20::generate_keystream(), Botan::GHASH::nonce_hash(), Botan::GHASH::reset_associated_data(), Botan::ChaCha::seek(), Botan::CTR_BE::seek(), Botan::Salsa20::seek(), Botan::GHASH::set_associated_data(), Botan::OCB_Mode::set_associated_data_n(), Botan::Salsa20::set_iv_bytes(), Botan::GHASH::update(), Botan::Polyval::update(), Botan::GHASH::update_associated_data(), and Botan::Polyval::zero_pad().
|
inlineprotectedinherited |
Throw Key_Not_Set unless the predicate holds
| predicate | if false, a Key_Not_Set exception is thrown |
Definition at line 186 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 141 of file polyval.cpp.
References Botan::secure_scrub_memory(), and Botan::zap().
| void Botan::Polyval::final | ( | std::span< uint8_t, BS > | out | ) |
Write the current state to out, and reset the state.
Definition at line 127 of file polyval.cpp.
References Botan::SymmetricAlgorithm::assert_key_material_set(), BOTAN_STATE_CHECK, Botan::copy_mem(), and Botan::secure_scrub_memory().
|
overridevirtual |
Test whether a key has been set on this object
Implements Botan::SymmetricAlgorithm.
Definition at line 51 of file polyval.cpp.
|
inlineoverridevirtual |
Return the key lengths supported by this algorithm
Implements Botan::SymmetricAlgorithm.
Definition at line 34 of file polyval.h.
|
inlineinherited |
Return the largest acceptable key length
Definition at line 130 of file sym_algo.h.
References key_spec().
|
inlineinherited |
Return the smallest acceptable key length
Definition at line 136 of file sym_algo.h.
References key_spec().
|
inlineoverridevirtual |
Return the name of this algorithm
Implements Botan::SymmetricAlgorithm.
Definition at line 40 of file polyval.h.
| std::string Botan::Polyval::provider | ( | ) | const |
Definition at line 29 of file polyval.cpp.
References Botan::CPUFeature::AVX512_CLMUL, Botan::CPUID::check(), Botan::CPUFeature::HW_CLMUL, and Botan::CPUFeature::SIMD_4X32.
|
inherited |
Set the symmetric key of this object.
| key | the SymmetricKey to be set. |
Definition at line 14 of file sym_algo.cpp.
References Botan::OctetString::begin(), Botan::OctetString::length(), and 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(), Botan::TLS::TLS_NULL_HMAC_AEAD_Mode::reset(), and 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 162 of file sym_algo.h.
References set_key().
Referenced by set_key().
|
inherited |
Set the symmetric key of this object.
| key | the contiguous byte range to be set. |
Definition at line 22 of file sym_algo.cpp.
References name(), and valid_keylength().
| void Botan::Polyval::update | ( | std::span< const uint8_t > | input | ) |
Definition at line 101 of file polyval.cpp.
References Botan::SymmetricAlgorithm::assert_key_material_set(), BOTAN_ASSERT_NOMSG, and Botan::BufferSlicer::empty().
|
inlineinherited |
Check whether a given key length is valid for this algorithm.
| length | the key length to be checked. |
Definition at line 143 of file sym_algo.h.
References key_spec().
Referenced by set_key().
| void Botan::Polyval::zero_pad | ( | ) |
Zero pad the input to a multiple of the block size.
Definition at line 119 of file polyval.cpp.
References Botan::SymmetricAlgorithm::assert_key_material_set().