12#include <botan/asn1_obj.h>
14#include <botan/internal/ct_utils.h>
15#include <botan/internal/int_utils.h>
16#include <botan/internal/lms.h>
62 m_lms_params(std::move(p_lms_params)), m_lmots_params(std::move(p_lmots_params)) {}
72 explicit HSS_LMS_Params(std::vector<LMS_LMOTS_Params_Pair> lm_lmots_params);
103 HSS_Level L()
const {
return checked_cast_to<HSS_Level>(m_lms_lmots_params.size()); }
116 std::vector<LMS_LMOTS_Params_Pair> m_lms_lmots_params;
143 static std::shared_ptr<HSS_LMS_PrivateKeyInternal> from_bytes_or_throw(std::span<const uint8_t> key_bytes);
180 std::vector<uint8_t> sign(std::span<const uint8_t> msg);
234 const size_t m_sig_size;
262 static std::shared_ptr<HSS_LMS_PublicKeyInternal> from_bytes_or_throw(std::span<const uint8_t> key_bytes);
265 m_L(L), m_top_lms_pub_key(std::move(top_lms_pub_key)) {}
270 std::vector<uint8_t> to_bytes()
const;
290 OID object_identifier()
const;
358 static HSS_Signature from_bytes_or_throw(std::span<const uint8_t> sig_bytes);
391 m_signed_pub_keys(std::move(signed_pub_keys)), m_sig(std::move(sig)) {}
393 std::vector<Signed_Pub_Key> m_signed_pub_keys;
Represents a pair of LMS and LMOTS parameters associated with one LMS tree layer.
const LMS_Params & lms_params() const
The LMS parameters.
const LMOTS_Params & lmots_params() const
The LMOTS parameters.
LMS_LMOTS_Params_Pair(LMS_Params p_lms_params, LMOTS_Params p_lmots_params)
Construct a new params pair.
const LMS_LMOTS_Params_Pair & params_at_level(HSS_Level level) const
Returns the LMS an LM-OTS parameters at the specified level of the HSS tree.
HSS_Level L() const
Returns the number of layers the HSS tree has.
HSS_Sig_Idx max_sig_count() const
The maximal number of signatures allowed for these HSS parameters.
The internal HSS-LMS private key.
HSS_Sig_Idx get_idx() const
Get the idx of the next signature to generate.
void _const_time_poison() const
const HSS_LMS_Params & hss_params() const
Returns the used HSS-LMS parameters.
size_t signature_size() const
Returns the size in bytes of a signature created by this key.
void _const_time_unpoison() const
The internal HSS-LMS public key.
std::string algo_name() const
The algorithm name for HSS-LMS.
void _const_time_unpoison() const
HSS_LMS_PublicKeyInternal(HSS_Level L, LMS_PublicKey top_lms_pub_key)
const LMS_PublicKey & lms_pub_key() const
Returns the public LMS key of the top LMS tree.
A LMS public key signed by the HSS layer above it.
const LMS_Signature & signature() const
The signature of the public key.
const LMS_PublicKey & public_key() const
The signed public key.
const LMS_Signature & bottom_sig() const
Returns the LMS signature by the bottom layer of the signed message.
HSS_Level Nspk() const
Returns the number of signed public keys (Nspk = L-1).
const Signed_Pub_Key & signed_pub_key(HSS_Level layer) const
Returns the signed LMS key signed by a specific layer.
Representation of an LMS Private key.
Container for LMS Signature data.
int(* final)(unsigned char *, CTX *)
bool verify_signature(std::span< const uint8_t, ED448_LEN > pk, bool phflag, std::span< const uint8_t > context, std::span< const uint8_t > sig, std::span< const uint8_t > msg)
Verify a signature(RFC 8032 5.2.7)
std::vector< T, secure_allocator< T > > secure_vector