Botan 3.6.1
Crypto and TLS for C&
|
The internal HSS-LMS public key. More...
#include <hss.h>
Public Member Functions | |
void | _const_time_unpoison () const |
std::string | algo_name () const |
The algorithm name for HSS-LMS. | |
AlgorithmIdentifier | algorithm_identifier () const |
The algorithm identifier for HSS-LMS. | |
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. | |
OID | object_identifier () const |
The object identifier for HSS-LMS. | |
size_t | size () const |
Returns the size in bytes the key would have in its encoded format. | |
std::vector< uint8_t > | to_bytes () const |
Returns the key in its encoded format. | |
bool | verify_signature (std::span< const uint8_t > msg, const HSS_Signature &sig) const |
Verify a HSS-LMS signature. | |
Static Public Member Functions | |
static HSS_LMS_PublicKeyInternal | create (const HSS_LMS_PrivateKeyInternal &hss_sk) |
Create the public HSS-LMS key from its private key. | |
static std::shared_ptr< HSS_LMS_PublicKeyInternal > | from_bytes_or_throw (std::span< const uint8_t > key_bytes) |
Parse a public HSS-LMS key. | |
The internal HSS-LMS public key.
Format according to RFC 8554: u32str(L) || pub[0]
|
inline |
|
inline |
Definition at line 308 of file hss.h.
|
inline |
The algorithm name for HSS-LMS.
Definition at line 295 of file hss.h.
Referenced by object_identifier().
AlgorithmIdentifier Botan::HSS_LMS_PublicKeyInternal::algorithm_identifier | ( | ) | const |
The algorithm identifier for HSS-LMS.
Definition at line 331 of file hss.cpp.
References object_identifier(), and Botan::AlgorithmIdentifier::USE_EMPTY_PARAM.
|
static |
Create the public HSS-LMS key from its private key.
hss_sk | The private HSS-LMS key. |
Definition at line 298 of file hss.cpp.
References Botan::HSS_LMS_PrivateKeyInternal::hss_derive_root_lms_private_key(), HSS_LMS_PublicKeyInternal(), and Botan::HSS_LMS_PrivateKeyInternal::hss_params().
Referenced by Botan::HSS_LMS_PrivateKey::HSS_LMS_PrivateKey(), and Botan::HSS_LMS_PrivateKey::HSS_LMS_PrivateKey().
|
static |
Parse a public HSS-LMS key.
key_bytes | The public key bytes to parse. |
Decoding_Error | If parsing the public key fails. |
Definition at line 307 of file hss.cpp.
References Botan::BufferSlicer::empty(), Botan::LMS_PublicKey::from_bytes_or_throw(), lms_pub_key(), Botan::load_be(), and Botan::BufferSlicer::take().
|
inline |
Returns the public LMS key of the top LMS tree.
Definition at line 275 of file hss.h.
Referenced by from_bytes_or_throw(), and verify_signature().
OID Botan::HSS_LMS_PublicKeyInternal::object_identifier | ( | ) | const |
The object identifier for HSS-LMS.
Definition at line 335 of file hss.cpp.
References algo_name(), and Botan::OID::from_string().
Referenced by algorithm_identifier().
size_t Botan::HSS_LMS_PublicKeyInternal::size | ( | ) | const |
Returns the size in bytes the key would have in its encoded format.
Definition at line 339 of file hss.cpp.
References Botan::LMS_Instance::lms_params(), and Botan::LMS_PublicKey::size().
std::vector< uint8_t > Botan::HSS_LMS_PublicKeyInternal::to_bytes | ( | ) | const |
Returns the key in its encoded format.
Definition at line 327 of file hss.cpp.
References Botan::concat(), Botan::store_be(), and Botan::LMS_PublicKey::to_bytes().
bool Botan::HSS_LMS_PublicKeyInternal::verify_signature | ( | std::span< const uint8_t > | msg, |
const HSS_Signature & | sig ) const |
Verify a HSS-LMS signature.
See RFC 8554 6.3.
msg | The signed message. |
sig | The already parsed HSS-LMS signature. |
Definition at line 343 of file hss.cpp.
References Botan::HSS_Signature::bottom_sig(), Botan::checked_cast_to(), Botan::LMOTS_Params::hash_name(), Botan::LMS_Params::hash_name(), Botan::LMS_Instance::lmots_params(), Botan::LMS_Instance::lms_params(), lms_pub_key(), Botan::HSS_Signature::Nspk(), Botan::HSS_Signature::Signed_Pub_Key::public_key(), Botan::HSS_Signature::Signed_Pub_Key::signature(), Botan::HSS_Signature::signed_pub_key(), Botan::LMS_PublicKey::to_bytes(), and Botan::LMS_PublicKey::verify_signature().