Botan 3.6.1
Crypto and TLS for C&
|
#include <cshake_xof.h>
Public Member Functions | |
bool | accepts_input () const final |
size_t | block_size () const final |
void | clear () |
virtual std::unique_ptr< XOF > | copy_state () const =0 |
virtual Key_Length_Specification | key_spec () const |
virtual std::string | name () const =0 |
virtual std::unique_ptr< XOF > | new_object () const =0 |
template<size_t count> | |
std::array< uint8_t, count > | output () |
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>> | |
T | output (size_t bytes) |
void | output (std::span< uint8_t > output) |
uint8_t | output_next_byte () |
std::vector< uint8_t > | output_stdvec (size_t bytes) |
std::string | provider () const final |
void | start (std::span< const uint8_t > salt={}, std::span< const uint8_t > key={}) |
void | update (std::span< const uint8_t > input) |
bool | valid_salt_length (size_t salt_length) const final |
Static Public Member Functions | |
static std::unique_ptr< XOF > | create (std::string_view algo_spec, std::string_view provider="") |
static std::unique_ptr< XOF > | create_or_throw (std::string_view algo_spec, std::string_view provider="") |
static std::vector< std::string > | providers (std::string_view algo_spec) |
Protected Member Functions | |
cSHAKE_XOF (size_t capacity, std::span< const uint8_t > function_name) | |
cSHAKE_XOF (size_t capacity, std::string_view function_name) | |
cSHAKE_XOF (size_t capacity, std::vector< uint8_t > function_name) | |
const std::vector< uint8_t > & | function_name () const |
Base class for cSHAKE-based XOFs
Definition at line 23 of file cshake_xof.h.
|
protected |
Defines a concrete instance of a cSHAKE XOF.
capacity | either 256 or 512 |
function_name | a domain separator for Keccak-based functions derived from cSHAKE |
Definition at line 19 of file cshake_xof.cpp.
References BOTAN_ASSERT_NOMSG.
|
protected |
Definition at line 24 of file cshake_xof.cpp.
References function_name().
|
protected |
Definition at line 27 of file cshake_xof.cpp.
References Botan::cast_char_ptr_to_uint8(), and function_name().
|
inlinefinalvirtual |
Typically, this is true
for new objects and becomes false
once output()
was called for the first time.
update()
is legal in the current object state Implements Botan::XOF.
Definition at line 43 of file cshake_xof.h.
|
finalvirtual |
Implements Botan::XOF.
Definition at line 41 of file cshake_xof.cpp.
References Botan::Keccak_Permutation::byte_rate().
|
inlineinherited |
Reset the state.
Definition at line 66 of file xof.h.
Referenced by Botan::Dilithium_Symmetric_Primitives_Base::H(), Botan::Dilithium_Symmetric_Primitives_Base::H(), Botan::Dilithium_Symmetric_Primitives_Base::H_256(), and Botan::FrodoKEMConstants::SHAKE_XOF().
|
pure virtualinherited |
Return a new XOF object with the same state as *this.
If the XOF is not yet in the output phase, it efficiently allows using several messages with a common prefix. Otherwise, the copied state will produce the same output bit stream as the original object at the time of this invocation.
This function should be called clone
but for consistency with other classes it is called copy_state
.
Implemented in Botan::AES_256_CTR_XOF, Botan::cSHAKE_128_XOF, Botan::cSHAKE_256_XOF, Botan::SHAKE_128_XOF, and Botan::SHAKE_256_XOF.
|
staticinherited |
Create an instance based on a name, or return null if the algo/provider combination cannot be found. If provider is empty then best available is chosen.
Definition at line 22 of file xof.cpp.
References Botan::SCAN_Name::algo_name(), Botan::SCAN_Name::arg_count(), and Botan::XOF::provider().
Referenced by Botan::XOF::create_or_throw().
|
staticinherited |
Create an instance based on a name If provider is empty then best available is chosen.
algo_spec | algorithm name |
provider | provider implementation to use Throws Lookup_Error if not found. |
Definition at line 42 of file xof.cpp.
References Botan::XOF::create(), and Botan::XOF::provider().
|
inlineprotected |
Definition at line 46 of file cshake_xof.h.
Referenced by cSHAKE_XOF(), and cSHAKE_XOF().
|
inlinevirtualinherited |
Reimplemented in Botan::AES_256_CTR_XOF.
Definition at line 99 of file xof.h.
Referenced by Botan::XOF::start().
|
pure virtualinherited |
Implemented in Botan::AES_256_CTR_XOF, Botan::cSHAKE_128_XOF, Botan::cSHAKE_256_XOF, Botan::SHAKE_128_XOF, and Botan::SHAKE_256_XOF.
Referenced by Botan::XOF::start().
|
pure virtualinherited |
Implemented in Botan::AES_256_CTR_XOF, Botan::cSHAKE_128_XOF, Botan::cSHAKE_256_XOF, Botan::SHAKE_128_XOF, and Botan::SHAKE_256_XOF.
|
inlineinherited |
|
inlineinherited |
bytes
output bytes as the specified container type T
. Definition at line 155 of file xof.h.
References T.
Referenced by Botan::DilithiumMessageHash::final(), Botan::Dilithium_Symmetric_Primitives_Base::H(), Botan::Dilithium_Symmetric_Primitives_Base::H_256(), Botan::FrodoMatrix::make_sample_generator(), and Botan::Kyber_Symmetric_Primitives::PRF().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Convenience overload to generate a std::vector<uint8_t>. Same as calling XOF::output<std::vector<uint8_t>>()
.
bytes
output bytes as a byte vector. Definition at line 177 of file xof.h.
|
finalvirtual |
Reimplemented from Botan::XOF.
Definition at line 37 of file cshake_xof.cpp.
References Botan::Keccak_Permutation::provider().
|
staticinherited |
algo_spec | algorithm name |
Definition at line 50 of file xof.cpp.
References Botan::probe_providers_of().
|
inherited |
Some XOFs can be parameterized with a salt
and/or key
. If required, this must be called before calling XOF::update().
Definition at line 58 of file xof.cpp.
References Botan::fmt(), Botan::XOF::key_spec(), Botan::XOF::name(), and Botan::XOF::valid_salt_length().
|
inlineinherited |
Add input
data to the XOF's internal state
input | the data that shall be |
Definition at line 142 of file xof.h.
Referenced by Botan::Dilithium_Symmetric_Primitives_Base::H(), Botan::Dilithium_Symmetric_Primitives_Base::H(), Botan::Dilithium_Symmetric_Primitives_Base::H_256(), and Botan::DilithiumMessageHash::update().
|
finalvirtual |
Reimplemented from Botan::XOF.
Definition at line 45 of file cshake_xof.cpp.