9#ifndef BOTAN_SP_HASH_H_
10#define BOTAN_SP_HASH_H_
12#include <botan/hash.h>
13#include <botan/sp_parameters.h>
14#include <botan/internal/sp_address.h>
15#include <botan/internal/sp_types.h>
34 static std::unique_ptr<Sphincs_Hash_Functions> create(
const Sphincs_Parameters& sphincs_params,
37 std::tuple<SphincsHashedMessage, XmssTreeIndexInLayer, TreeNodeIndex> H_msg(
56 template <
typename... BufferTs>
58 auto& hash = tweak_hash(address, (std::forward<BufferTs>(in).size() + ...));
59 (hash.update(std::forward<BufferTs>(in)), ...);
63 template <
typename OutT = std::vector<u
int8_t>,
typename... BufferTs>
65 OutT t(m_sphincs_params.n());
66 T(t, address, std::forward<BufferTs>(in)...);
71 T(out, address, sk_seed);
75 T(out, address, sk_seed);
void T(std::span< uint8_t > out, const Sphincs_Address &address, BufferTs &&... in)
OutT T(const Sphincs_Address &address, BufferTs &&... in)
const SphincsPublicSeed & m_pub_seed
virtual HashFunction & tweak_hash(const Sphincs_Address &address, size_t input_length)=0
const Sphincs_Parameters & m_sphincs_params
virtual void PRF_msg(StrongSpan< SphincsMessageRandomness > out, StrongSpan< const SphincsSecretPRF > sk_prf, StrongSpan< const SphincsOptionalRandomness > opt_rand, const SphincsMessageInternal &msg)=0
virtual ~Sphincs_Hash_Functions()=default
virtual std::vector< uint8_t > H_msg_digest(StrongSpan< const SphincsMessageRandomness > r, const SphincsTreeNode &root, const SphincsMessageInternal &message)=0
void PRF(StrongSpan< WotsNode > out, const SphincsSecretSeed &sk_seed, const Sphincs_Address &address)
void PRF(StrongSpan< ForsLeafSecret > out, const SphincsSecretSeed &sk_seed, const Sphincs_Address &address)
virtual std::string msg_hash_function_name() const =0
M' representation of FIPS 205 (the input to slh_sign_internal and slh_verify_internal)