|
Botan 3.14.1
Crypto and TLS for C&
|
#include <xmss_hash.h>
Public Member Functions | |
| void | f (secure_vector< uint8_t > &result, std::span< const uint8_t > key, std::span< const uint8_t > data) |
| void | f_batch (std::span< std::span< uint8_t > > outputs, std::span< std::span< const uint8_t > > keys, std::span< std::span< const uint8_t > > data) |
| void | h (secure_vector< uint8_t > &result, std::span< const uint8_t > key, std::span< const uint8_t > data) |
| void | h_batch (std::span< std::span< uint8_t > > outputs, std::span< std::span< const uint8_t > > keys, std::span< std::span< const uint8_t > > data) |
| secure_vector< uint8_t > | h_msg (std::span< const uint8_t > randomness, std::span< const uint8_t > root, std::span< const uint8_t > index_bytes, std::span< const uint8_t > data) |
| secure_vector< uint8_t > | h_msg_final () |
| void | h_msg_init (std::span< const uint8_t > randomness, std::span< const uint8_t > root, std::span< const uint8_t > index_bytes) |
| void | h_msg_update (std::span< const uint8_t > data) |
| std::string | hash_function () const |
| XMSS_Hash & | operator= (const XMSS_Hash &)=delete |
| XMSS_Hash & | operator= (XMSS_Hash &&)=default |
| size_t | output_length () const |
| void | prf (secure_vector< uint8_t > &result, std::span< const uint8_t > key, std::span< const uint8_t > data) |
| void | prf_batch (std::span< std::span< uint8_t > > outputs, std::span< const uint8_t > key, std::span< std::span< const uint8_t > > data) |
| void | prf_keygen (secure_vector< uint8_t > &result, std::span< const uint8_t > key, std::span< const uint8_t > data) |
| void | prf_keygen_batch (std::span< std::span< uint8_t > > outputs, std::span< const uint8_t > key, std::span< std::span< const uint8_t > > data) |
| XMSS_Hash (const XMSS_Hash &hash) | |
| XMSS_Hash (const XMSS_Parameters ¶ms) | |
| XMSS_Hash (std::string_view hash_function_name, size_t hash_id_size) | |
| XMSS_Hash (XMSS_Hash &&hash)=default | |
| ~XMSS_Hash ()=default | |
A collection of pseudorandom hash functions required for XMSS and WOTS computations.
Definition at line 25 of file xmss_hash.h.
|
explicit |
Definition at line 24 of file xmss_hash.cpp.
References XMSS_Hash().
Referenced by operator=(), operator=(), XMSS_Hash(), XMSS_Hash(), and XMSS_Hash().
| Botan::XMSS_Hash::XMSS_Hash | ( | std::string_view | hash_function_name, |
| size_t | hash_id_size ) |
Definition at line 26 of file xmss_hash.cpp.
References BOTAN_ASSERT, and Botan::fmt().
| Botan::XMSS_Hash::XMSS_Hash | ( | const XMSS_Hash & | hash | ) |
Definition at line 19 of file xmss_hash.cpp.
References XMSS_Hash().
|
default |
References XMSS_Hash().
|
default |
|
inline |
F is a keyed cryptographic hash function used by the WOTS+ algorithm.
| [out] | result | The hash calculated using key and data. |
| [in] | key | key of length n bytes. |
| [in] | data | string of arbitrary length. |
Definition at line 88 of file xmss_hash.h.
|
inline |
Batched variant of f: outputs[i] = f(keys[i], data[i])
Definition at line 171 of file xmss_hash.h.
References Botan::Hash_Engine::create_or_throw().
Referenced by Botan::xmss_wots_chains().
|
inline |
Cryptographic hash function h accepting n byte keys and 2n byte strings of data.
| [out] | result | The hash calculated using key and data. |
| [in] | key | key of length n bytes. |
| [in] | data | string of 2n bytes length. |
Definition at line 100 of file xmss_hash.h.
Referenced by Botan::XMSS_Common_Ops::randomize_tree_hash().
|
inline |
Batched variant of h: outputs[i] = h(keys[i], data[i])
Definition at line 185 of file xmss_hash.h.
References Botan::Hash_Engine::create_or_throw().
Referenced by Botan::XMSS_Common_Ops::create_l_trees().
|
inline |
Cryptographic hash function h accepting 3n byte keys and data strings of arbitrary length.
| randomness | n-byte value. |
| root | n-byte root node. |
| index_bytes | Index value padded with leading zeros. |
| data | string of arbitrary length. |
Definition at line 115 of file xmss_hash.h.
References h_msg_init(), h_msg_update(), and Botan::root().
| secure_vector< uint8_t > Botan::XMSS_Hash::h_msg_final | ( | ) |
Finalizes buffered h_msg computation and retrieves the result.
Definition at line 52 of file xmss_hash.cpp.
| void Botan::XMSS_Hash::h_msg_init | ( | std::span< const uint8_t > | randomness, |
| std::span< const uint8_t > | root, | ||
| std::span< const uint8_t > | index_bytes ) |
Initializes buffered h_msg computation with prefix data.
| randomness | random n-byte value. |
| root | n-byte root node. |
| index_bytes | Index value padded with leading zeros. |
Definition at line 37 of file xmss_hash.cpp.
References Botan::root().
Referenced by h_msg().
| void Botan::XMSS_Hash::h_msg_update | ( | std::span< const uint8_t > | data | ) |
Adds a message block to buffered h_msg computation.
| data | A message block |
Definition at line 48 of file xmss_hash.cpp.
Referenced by h_msg().
|
inline |
Definition at line 37 of file xmss_hash.h.
References XMSS_Hash().
References XMSS_Hash().
|
inline |
Definition at line 196 of file xmss_hash.h.
Referenced by Botan::xmss_wots_chains(), and Botan::XMSS_WOTS_PrivateKey::XMSS_WOTS_PrivateKey().
|
inline |
Pseudorandom function creating a hash out of a key and data using a cryptographic hash function.
| [out] | result | The hash calculated using key and data. |
| [in] | key | An n-byte key value. |
| [in] | data | A 32-byte XMSS_Address data value |
Definition at line 60 of file xmss_hash.h.
Referenced by Botan::XMSS_Common_Ops::randomize_tree_hash(), and Botan::XMSS_WOTS_PrivateKey::XMSS_WOTS_PrivateKey().
|
inline |
Batched variant of prf with a shared key: outputs[i] = prf(key, data[i])
Definition at line 153 of file xmss_hash.h.
Referenced by Botan::XMSS_Common_Ops::create_l_trees(), and Botan::xmss_wots_chains().
|
inline |
Pseudoranom function creating a hash out of a key and data using a cryptographic hash function for key derivation.
This function is described in NIST SP.800-208 Section 5 as a separate PRF to avoid a multi-target attack vector.
| [out] | result | The hash calculated using key and data. |
| [in] | key | An n-byte key value. |
| [in] | data | A 32-byte XMSS_Address data value |
Definition at line 75 of file xmss_hash.h.
|
inline |
Batched variant of prf_keygen with a shared key: outputs[i] = prf_keygen(key, data[i])
Definition at line 162 of file xmss_hash.h.
Referenced by Botan::XMSS_WOTS_PrivateKey::XMSS_WOTS_PrivateKey().