|
Botan 3.14.1
Crypto and TLS for C&
|
#include <hash_engine.h>
Public Member Functions | |
| void | batch_hash (std::span< std::span< uint8_t > > outputs, std::span< std::span< const uint8_t > > inputs) |
| virtual void | batch_hash (std::span< std::span< uint8_t > > outputs, std::span< std::span< const uint8_t > > inputs1, std::span< std::span< const uint8_t > > inputs2)=0 |
| Hash_Engine (const Hash_Engine &other)=delete | |
| Hash_Engine (Hash_Engine &&other)=delete | |
| virtual std::string | name () const =0 |
| Hash_Engine & | operator= (const Hash_Engine &other)=delete |
| Hash_Engine & | operator= (Hash_Engine &&other)=delete |
| virtual size_t | output_length () const =0 |
| virtual size_t | parallelism () const =0 |
| virtual std::string | provider () const =0 |
| virtual size_t | uncached_prefix_bytes () const |
| virtual | ~Hash_Engine ()=default |
Static Public Member Functions | |
| static std::unique_ptr< Hash_Engine > | create_or_null (std::string_view hash_fn, std::span< const uint8_t > common_prefix={}, std::string_view provider="") |
| static std::unique_ptr< Hash_Engine > | create_or_throw (std::string_view hash_fn, std::span< const uint8_t > common_prefix={}, std::string_view provider="") |
| static std::vector< std::string > | possible_providers (std::string_view hash_fn) |
Protected Member Functions | |
| void | check_batch_args (std::span< std::span< uint8_t > > outputs, std::span< std::span< const uint8_t > > inputs1, std::span< std::span< const uint8_t > > inputs2) const |
| std::span< const uint8_t > | common_prefix () const |
| Hash_Engine (std::span< const uint8_t > common_prefix) | |
Definition at line 20 of file hash_engine.h.
|
delete |
References Hash_Engine().
Referenced by Hash_Engine(), Hash_Engine(), Botan::MDx_MB_Engine< W >::MDx_MB_Engine(), operator=(), and operator=().
|
delete |
References Hash_Engine().
|
virtualdefault |
|
inlineexplicitprotected |
Definition at line 121 of file hash_engine.h.
References common_prefix().
|
inline |
Hash many inputs
Computes H(common_prefix || inputs[i]) into outputs[i]. Each input must be exactly identical length.
outputs[i] may alias inputs[i], but must not otherwise overlap any other input or output.
Definition at line 57 of file hash_engine.h.
References batch_hash().
Referenced by batch_hash(), and Botan::lmots_compute_pubkeys().
|
pure virtual |
Hash many inputs, each formed from two parts
Computes H(common_prefix || inputs1[i] || inputs2[i]) into outputs[i]. All inputs1 must be exactly identical length, as must all inputs2. Alternately inputs2 may be an empty list.
outputs[i] may alias inputs1[i] and/or inputs2[i], but must not otherwise overlap any other input or output.
Implemented in Botan::MDx_MB_Engine< W >.
References common_prefix(), and create_or_throw().
|
protected |
Verify the batch_hash argument contract, throwing Invalid_Argument if violated
Definition at line 248 of file hash_engine.cpp.
References BOTAN_ARG_CHECK, and output_length().
Referenced by Botan::MDx_MB_Engine< W >::batch_hash().
|
inlineprotected |
Definition at line 127 of file hash_engine.h.
Referenced by batch_hash(), Botan::MDx_MB_Engine< W >::batch_hash(), create_or_null(), create_or_throw(), Hash_Engine(), Botan::MDx_MB_Engine< W >::MDx_MB_Engine(), uncached_prefix_bytes(), and Botan::MDx_MB_Engine< W >::uncached_prefix_bytes().
|
static |
Create a new Hash_Engine
| hash_fn | the hash function to compute |
| common_prefix | implicitly prepended to each message hashed; implementations may precompute the resulting hash state |
| provider | if set, use this specific implementation |
Definition at line 268 of file hash_engine.cpp.
References common_prefix(), Botan::Thread_Pool::global_instance(), and provider().
Referenced by create_or_throw().
|
static |
Create a new Hash_Engine
| hash_fn | the hash function to compute |
| common_prefix | implicitly prepended to each message hashed; implementations may precompute the resulting hash state |
| provider | if set, use this specific implementation |
The default provider splits sufficiently large batches over the global Thread_Pool, whose threads are started on the first such batch, or over the executor installed with Work_Executor::set_global.
Throws Lookup_Error if the hash function or requested provider is not available
Definition at line 291 of file hash_engine.cpp.
References common_prefix(), create_or_null(), and provider().
Referenced by batch_hash(), Botan::create_shake_row_generator(), Botan::XMSS_Hash::f_batch(), Botan::XMSS_Hash::h_batch(), Botan::lmots_compute_pubkey_from_sig(), Botan::Kyber_Symmetric_Primitives::shake_XOF_batch(), Botan::LMOTS_Private_Key::sign(), and Botan::Sphincs_Hash_Functions_Sha2::Sphincs_Hash_Functions_Sha2().
|
pure virtual |
Implemented in Botan::MDx_MB_Engine< W >.
|
delete |
References Hash_Engine().
|
delete |
References Hash_Engine().
|
pure virtual |
Implemented in Botan::MDx_MB_Engine< W >.
Referenced by check_batch_args().
|
pure virtual |
Implemented in Botan::MDx_MB_Engine< W >.
|
static |
Return a list of possible providers for this hash function
Definition at line 301 of file hash_engine.cpp.
References BOTAN_UNUSED.
|
pure virtual |
Implemented in Botan::MDx_MB_Engine< W >.
Referenced by create_or_null(), and create_or_throw().
|
inlinevirtual |
Reimplemented in Botan::MDx_MB_Engine< W >.
Definition at line 46 of file hash_engine.h.
References common_prefix().