Botan 3.5.0
Crypto and TLS for C&
|
#include <xof.h>
Public Member Functions | |
virtual bool | accepts_input () const =0 |
virtual size_t | block_size () const =0 |
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<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) |
virtual std::string | provider () const |
void | start (std::span< const uint8_t > salt={}, std::span< const uint8_t > key={}) |
void | update (std::span< const uint8_t > input) |
virtual bool | valid_salt_length (size_t salt_len) const |
XOF () | |
virtual | ~XOF ()=default |
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) |
This class represents an eXtendable Output Function (XOF) objects
A XOF transforms an arbitrary length input message into an indefinite stream of output bits. Typically, it is illegal to call update()
after the first call to output()
.
|
virtualdefault |
|
pure virtual |
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 Implemented in Botan::AES_256_CTR_XOF, Botan::cSHAKE_XOF, and Botan::SHAKE_XOF.
|
pure virtual |
Implemented in Botan::AES_256_CTR_XOF, Botan::cSHAKE_XOF, and Botan::SHAKE_XOF.
|
inline |
|
pure virtual |
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.
|
static |
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 provider().
Referenced by create_or_throw().
|
static |
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 create(), and provider().
Referenced by Botan::FrodoKEMConstants::FrodoKEMConstants(), and Botan::Dilithium_Common_Symmetric_Primitives::XOF().
|
inlinevirtual |
Reimplemented in Botan::AES_256_CTR_XOF.
Definition at line 99 of file xof.h.
Referenced by start().
|
pure virtual |
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 start().
|
pure virtual |
Implemented in Botan::AES_256_CTR_XOF, Botan::cSHAKE_128_XOF, Botan::cSHAKE_256_XOF, Botan::SHAKE_128_XOF, and Botan::SHAKE_256_XOF.
|
inline |
bytes
output bytes as the specified container type T
. Definition at line 155 of file xof.h.
References T.
Referenced by Botan::FrodoMatrix::make_sample_generator(), and Botan::Kyber_Symmetric_Primitives::PRF().
|
inline |
|
inline |
|
inline |
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 167 of file xof.h.
|
virtual |
Reimplemented in Botan::cSHAKE_XOF, and Botan::SHAKE_XOF.
Definition at line 54 of file xof.cpp.
Referenced by create(), and create_or_throw().
|
static |
algo_spec | algorithm name |
Definition at line 50 of file xof.cpp.
References Botan::probe_providers_of().
void Botan::XOF::start | ( | std::span< const uint8_t > | salt = {}, |
std::span< const uint8_t > | key = {} ) |
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(), key_spec(), name(), and valid_salt_length().
|
inline |
Add input
data to the XOF's internal state
input | the data that shall be |
Definition at line 142 of file xof.h.
|
inlinevirtual |
Reimplemented in Botan::AES_256_CTR_XOF, and Botan::cSHAKE_XOF.
Definition at line 91 of file xof.h.
Referenced by start().