Botan 3.5.0
Crypto and TLS for C&
|
The LMS public key. More...
#include <lms.h>
Public Member Functions | |
const LMS_Identifier & | identifier () const |
The identifier of this LMS tree ('I' in RFC 8554) | |
const LMOTS_Params & | lmots_params () const |
The LMOTS parameters used for OTS instances of this LMS instance. | |
const LMS_Params & | lms_params () const |
The LMS parameters for this LMS instance. | |
LMS_PublicKey (const LMS_PrivateKey &sk) | |
Construct a new public key from a given LMS private key (RFC 8554 5.3). | |
LMS_PublicKey (LMS_Params lms_params, LMOTS_Params lmots_params, LMS_Identifier I, LMS_Tree_Node lms_root) | |
Construct a public key for given public key data. | |
std::vector< uint8_t > | to_bytes () const |
Bytes of the full lms public key according to 8554 5.3. | |
bool | verify_signature (const LMS_Message &msg, const LMS_Signature &sig) const |
Verify a LMS signature. | |
Static Public Member Functions | |
static LMS_PublicKey | from_bytes_or_throw (BufferSlicer &slicer) |
Parse a public LMS key. | |
static size_t | size (const LMS_Params &lms_params) |
The expected size of an LMS public key for given lms_params . | |
The LMS public key.
Format according to RFC 8554: u32str(type) || u32str(otstype) || I || T[1]
Botan::LMS_PublicKey::LMS_PublicKey | ( | LMS_Params | lms_params, |
LMOTS_Params | lmots_params, | ||
LMS_Identifier | I, | ||
LMS_Tree_Node | lms_root ) |
Construct a public key for given public key data.
Definition at line 303 of file lms.cpp.
References BOTAN_ARG_CHECK, Botan::LMS_Instance::identifier(), Botan::LMS_IDENTIFIER_LEN, and size().
Referenced by from_bytes_or_throw().
Botan::LMS_PublicKey::LMS_PublicKey | ( | const LMS_PrivateKey & | sk | ) |
Construct a new public key from a given LMS private key (RFC 8554 5.3).
Definition at line 347 of file lms.cpp.
|
static |
Parse a public LMS key.
slicer | The BufferSlicer at the public key bytes' position |
Decoding_Error | If parsing the public key fails. |
Definition at line 263 of file lms.cpp.
References Botan::BufferSlicer::copy(), Botan::LMOTS_Params::create_or_throw(), Botan::LMS_Params::create_or_throw(), Botan::LMOTS_Params::hash_name(), Botan::LMS_Params::hash_name(), Botan::LMS_Instance::lmots_params(), Botan::LMS_IDENTIFIER_LEN, Botan::LMS_Instance::lms_params(), LMS_PublicKey(), Botan::load_be(), Botan::LMS_Params::m(), Botan::BufferSlicer::remaining(), size(), and Botan::BufferSlicer::take().
Referenced by Botan::HSS_LMS_PublicKeyInternal::from_bytes_or_throw(), and Botan::HSS_Signature::from_bytes_or_throw().
|
inlineinherited |
The identifier of this LMS tree ('I' in RFC 8554)
Definition at line 173 of file lms.h.
Referenced by LMS_PublicKey(), Botan::LMS_PrivateKey::sign_and_get_pk(), and to_bytes().
|
inlineinherited |
The LMOTS parameters used for OTS instances of this LMS instance.
Definition at line 168 of file lms.h.
Referenced by from_bytes_or_throw(), Botan::LMS_PrivateKey::sign_and_get_pk(), to_bytes(), Botan::HSS_LMS_PublicKeyInternal::verify_signature(), and verify_signature().
|
inlineinherited |
The LMS parameters for this LMS instance.
Definition at line 163 of file lms.h.
Referenced by from_bytes_or_throw(), Botan::LMS_PrivateKey::sign_and_get_pk(), Botan::HSS_LMS_PublicKeyInternal::size(), size(), to_bytes(), Botan::HSS_LMS_PublicKeyInternal::verify_signature(), and verify_signature().
|
static |
The expected size of an LMS public key for given lms_params
.
Definition at line 312 of file lms.cpp.
References Botan::LMS_IDENTIFIER_LEN, Botan::LMS_Instance::lms_params(), and Botan::LMS_Params::m().
Referenced by from_bytes_or_throw(), LMS_PublicKey(), Botan::HSS_LMS_PrivateKeyInternal::sign(), Botan::HSS_LMS_PublicKeyInternal::size(), Botan::HSS_Signature::size(), and verify_signature().
std::vector< uint8_t > Botan::LMS_PublicKey::to_bytes | ( | ) | const |
Bytes of the full lms public key according to 8554 5.3.
pub_key_bytes = u32str(type) || u32str(otstype) || I || T[1]
Definition at line 293 of file lms.cpp.
References Botan::concat(), Botan::LMS_Instance::identifier(), Botan::LMS_Instance::lmots_params(), Botan::LMS_Instance::lms_params(), and Botan::store_be().
Referenced by Botan::HSS_LMS_PublicKeyInternal::to_bytes(), and Botan::HSS_LMS_PublicKeyInternal::verify_signature().
bool Botan::LMS_PublicKey::verify_signature | ( | const LMS_Message & | msg, |
const LMS_Signature & | sig ) const |
Verify a LMS signature.
See RFC 8554 5.4.2 - Algorithm 6.
msg | The signed message. |
sig | The already parsed LMS signature. |
Definition at line 351 of file lms.cpp.
References Botan::LMOTS_Signature::algorithm_type(), Botan::LMS_Instance::lmots_params(), Botan::LMS_Signature::lmots_sig(), Botan::LMS_Instance::lms_params(), Botan::LMS_Signature::lms_type(), Botan::LMS_Signature::q(), and size().
Referenced by Botan::HSS_LMS_PublicKeyInternal::verify_signature().