Botan 3.6.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 | h (secure_vector< uint8_t > &result, std::span< const uint8_t > key, 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_keygen (secure_vector< uint8_t > &result, std::span< const uint8_t > key, std::span< const uint8_t > data) |
XMSS_Hash (const XMSS_Hash &hash) | |
XMSS_Hash (const XMSS_Parameters ¶ms) | |
XMSS_Hash (XMSS_Hash &&hash)=default | |
~XMSS_Hash ()=default | |
A collection of pseudorandom hash functions required for XMSS and WOTS computations.
Definition at line 23 of file xmss_hash.h.
Botan::XMSS_Hash::XMSS_Hash | ( | const XMSS_Parameters & | params | ) |
Definition at line 23 of file xmss_hash.cpp.
References BOTAN_ASSERT, Botan::fmt(), and Botan::XMSS_Parameters::hash_function_name().
Botan::XMSS_Hash::XMSS_Hash | ( | const XMSS_Hash & | hash | ) |
Definition at line 18 of file xmss_hash.cpp.
|
default |
|
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 85 of file xmss_hash.h.
|
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 97 of file xmss_hash.h.
Referenced by Botan::XMSS_Common_Ops::randomize_tree_hash().
|
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 112 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 49 of file xmss_hash.cpp.
Referenced by Botan::XMSS_Signature_Operation::sign().
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 34 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 45 of file xmss_hash.cpp.
Referenced by h_msg(), and Botan::XMSS_Signature_Operation::update().
|
inline |
Definition at line 34 of file xmss_hash.h.
Referenced by Botan::XMSS_Signature_Operation::hash_function(), and Botan::XMSS_Verification_Operation::hash_function().
|
inline |
Definition at line 147 of file xmss_hash.h.
|
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 57 of file xmss_hash.h.
Referenced by Botan::XMSS_Common_Ops::randomize_tree_hash(), and Botan::XMSS_WOTS_PrivateKey::XMSS_WOTS_PrivateKey().
|
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 72 of file xmss_hash.h.