Botan 3.6.1
Crypto and TLS for C&
|
#include <sp_hash_sha2.h>
Public Member Functions | |
std::tuple< SphincsHashedMessage, XmssTreeIndexInLayer, TreeNodeIndex > | H_msg (StrongSpan< const SphincsMessageRandomness > r, const SphincsTreeNode &root, const SphincsMessageInternal &message) |
std::string | msg_hash_function_name () const override |
void | PRF (StrongSpan< ForsLeafSecret > out, const SphincsSecretSeed &sk_seed, const Sphincs_Address &address) |
void | PRF (StrongSpan< WotsNode > out, const SphincsSecretSeed &sk_seed, const Sphincs_Address &address) |
void | PRF_msg (StrongSpan< SphincsMessageRandomness > out, StrongSpan< const SphincsSecretPRF > sk_prf, StrongSpan< const SphincsOptionalRandomness > opt_rand, const SphincsMessageInternal &msg) override |
Sphincs_Hash_Functions_Sha2 (const Sphincs_Parameters &sphincs_params, const SphincsPublicSeed &pub_seed) | |
template<typename OutT = std::vector<uint8_t>, typename... BufferTs> | |
OutT | T (const Sphincs_Address &address, BufferTs &&... in) |
template<typename... BufferTs> | |
void | T (std::span< uint8_t > out, const Sphincs_Address &address, BufferTs &&... in) |
Static Public Member Functions | |
static std::unique_ptr< Sphincs_Hash_Functions > | create (const Sphincs_Parameters &sphincs_params, const SphincsPublicSeed &pub_seed) |
Protected Attributes | |
const SphincsPublicSeed & | m_pub_seed |
Implementation of SLH-DSA hash function abstraction for SHA2
Definition at line 26 of file sp_hash_sha2.h.
|
inline |
Definition at line 64 of file sp_hash_sha2.h.
References BOTAN_ASSERT_NOMSG, and Botan::Sphincs_Parameters::n().
|
staticinherited |
Creates a Sphincs_Hash_Functions object instantiating the hash functions used for the specified sphincs_params
. The pub_seed
is used to seed the hash functions (possibly padded). This is pre-computed and the respective state is copied on the further calls on H(seed) with tweak_hash, i.e., T and PRF.
Definition at line 34 of file sp_hash.cpp.
References BOTAN_ASSERT_UNREACHABLE, Botan::Haraka, Botan::Sphincs_Parameters::hash_type(), Botan::Sha256, and Botan::Shake256.
Referenced by Botan::SphincsPlus_PrivateKey::SphincsPlus_PrivateKey().
|
inherited |
Definition at line 78 of file sp_hash.cpp.
References BOTAN_ASSERT_NOMSG, Botan::BufferSlicer::copy(), Botan::BufferSlicer::empty(), Botan::Sphincs_Hash_Functions::H_msg_digest(), Botan::Sphincs_Hash_Functions::m_sphincs_params, Botan::root(), and Botan::BufferSlicer::take().
|
inlineoverridevirtual |
Implements Botan::Sphincs_Hash_Functions.
Definition at line 105 of file sp_hash_sha2.h.
|
inlineinherited |
Definition at line 70 of file sp_hash.h.
References T.
Referenced by Botan::fors_sign_and_pkgen(), and Botan::wots_sign_and_pkgen().
|
inlineinherited |
|
inlineoverridevirtual |
Using SK.PRF, the optional randomness, and a message, computes the message random R, and the tree and leaf indices.
out | output location for the message hash |
sk_prf | SK.PRF |
opt_rand | optional randomness |
msg | message |
Implements Botan::Sphincs_Hash_Functions.
Definition at line 91 of file sp_hash_sha2.h.
References Botan::StrongSpan< T >::begin(), Botan::Buffered_Computation::final(), Botan::SphincsMessageInternal::message, Botan::SphincsMessageInternal::prefix, Botan::SymmetricAlgorithm::set_key(), Botan::StrongSpan< T >::size(), and Botan::Buffered_Computation::update().
|
inlineinherited |
|
inlineinherited |
Definition at line 57 of file sp_hash.h.
Referenced by Botan::compute_root(), Botan::fors_public_key_from_signature(), Botan::fors_sign_and_pkgen(), Botan::ht_verify(), Botan::treehash(), and Botan::wots_sign_and_pkgen().
|
protectedinherited |
Definition at line 103 of file sp_hash.h.
Referenced by Botan::Sphincs_Hash_Functions_Shake::Sphincs_Hash_Functions_Shake().