Botan 3.5.0
Crypto and TLS for C&
Botan::LMOTS_Public_Key Class Reference

Representation of an OTS public key. More...

#include <lm_ots.h>

Inheritance diagram for Botan::LMOTS_Public_Key:
Botan::OTS_Instance

Public Member Functions

const LMS_Identifieridentifier () const
 The LMS identifier of the LMS tree containing this OTS instance ('I' in RFC 8554)
 
const LMOTS_KK () const
 The public key final hash value (K in RFC 8554 4.3 )
 
 LMOTS_Public_Key (const LMOTS_Params &params, const LMS_Identifier &identifier, LMS_Tree_Node_Idx q, LMOTS_K K)
 Construct a new LMOTS public key object using the bytes.
 
 LMOTS_Public_Key (const LMOTS_Private_Key &lmots_sk)
 Derivivation of an LMOTS public key using an LMOTS_Private_Key as defined in RFC 8554 4.3.
 
const LMOTS_Paramsparams () const
 The LMOTS parameters.
 
LMS_Tree_Node_Idx q () const
 The index of the LMS tree leaf associated with this OTS instance.
 

Detailed Description

Representation of an OTS public key.

Contains the public key bytes as defined in RFC 8554 4.3:

u32str(type) || I || u32str(q) || K

Definition at line 306 of file lm_ots.h.

Constructor & Destructor Documentation

◆ LMOTS_Public_Key() [1/2]

Botan::LMOTS_Public_Key::LMOTS_Public_Key ( const LMOTS_Private_Key & lmots_sk)

Derivivation of an LMOTS public key using an LMOTS_Private_Key as defined in RFC 8554 4.3.

Definition at line 308 of file lm_ots.cpp.

308 : OTS_Instance(lmots_sk) {
309 const auto pk_hash = lmots_sk.params().hash();
310 pk_hash->update(lmots_sk.identifier());
311 pk_hash->update(store_be(lmots_sk.q()));
312 pk_hash->update(store_be(D_PBLC));
313
314 Chain_Generator chain_gen(lmots_sk.identifier(), lmots_sk.q());
315 const auto hash = lmots_sk.params().hash();
316 LMOTS_Node tmp(lmots_sk.params().n());
317 for(uint16_t i = 0; i < lmots_sk.params().p(); ++i) {
318 chain_gen.process(*hash, i, 0, lmots_sk.params().coef_max(), lmots_sk.chain_input(i), tmp);
319 pk_hash->update(tmp);
320 }
321
322 m_K = pk_hash->final<LMOTS_K>();
323}
OTS_Instance(const LMOTS_Params &params, const LMS_Identifier &identifier, LMS_Tree_Node_Idx q)
Constructor storing the specific OTS parameters.
Definition lm_ots.h:227
Strong< std::vector< uint8_t >, struct LMOTS_K_ > LMOTS_K
The K value from the LM-OTS public key.
Definition lm_ots.h:35
Strong< secure_vector< uint8_t >, struct LMOTS_Node_ > LMOTS_Node
One node within one LM-OTS hash chain.
Definition lm_ots.h:30
constexpr auto store_be(ParamTs &&... params)
Definition loadstor.h:707

References Botan::LMOTS_Private_Key::chain_input(), Botan::LMOTS_Params::coef_max(), Botan::LMOTS_Params::hash(), Botan::OTS_Instance::identifier(), Botan::LMOTS_Params::n(), Botan::OTS_Instance::params(), Botan::OTS_Instance::q(), and Botan::store_be().

◆ LMOTS_Public_Key() [2/2]

Botan::LMOTS_Public_Key::LMOTS_Public_Key ( const LMOTS_Params & params,
const LMS_Identifier & identifier,
LMS_Tree_Node_Idx q,
LMOTS_K K )
inline

Construct a new LMOTS public key object using the bytes.

Note that the passed params, identifier and q value should match with the prefix in pub_key_bytes.

Definition at line 320 of file lm_ots.h.

320 :
321 OTS_Instance(params, identifier, q), m_K(std::move(K)) {}
const LMOTS_K & K() const
The public key final hash value (K in RFC 8554 4.3 )
Definition lm_ots.h:328
const LMS_Identifier & identifier() const
The LMS identifier of the LMS tree containing this OTS instance ('I' in RFC 8554)
Definition lm_ots.h:238
LMS_Tree_Node_Idx q() const
The index of the LMS tree leaf associated with this OTS instance.
Definition lm_ots.h:243
const LMOTS_Params & params() const
The LMOTS parameters.
Definition lm_ots.h:233

Member Function Documentation

◆ identifier()

const LMS_Identifier & Botan::OTS_Instance::identifier ( ) const
inlineinherited

The LMS identifier of the LMS tree containing this OTS instance ('I' in RFC 8554)

Definition at line 238 of file lm_ots.h.

238{ return m_identifier; }

Referenced by Botan::LMOTS_Private_Key::LMOTS_Private_Key(), LMOTS_Public_Key(), and Botan::LMOTS_Private_Key::sign().

◆ K()

const LMOTS_K & Botan::LMOTS_Public_Key::K ( ) const
inline

The public key final hash value (K in RFC 8554 4.3 )

Returns
const LMOTS_K&

Definition at line 328 of file lm_ots.h.

328{ return m_K; }

◆ params()

const LMOTS_Params & Botan::OTS_Instance::params ( ) const
inlineinherited

The LMOTS parameters.

Definition at line 233 of file lm_ots.h.

233{ return m_params; }

Referenced by Botan::LMOTS_Private_Key::LMOTS_Private_Key(), LMOTS_Public_Key(), and Botan::LMOTS_Private_Key::sign().

◆ q()

LMS_Tree_Node_Idx Botan::OTS_Instance::q ( ) const
inlineinherited

The index of the LMS tree leaf associated with this OTS instance.

Definition at line 243 of file lm_ots.h.

243{ return m_q; }

Referenced by Botan::LMOTS_Private_Key::LMOTS_Private_Key(), LMOTS_Public_Key(), and Botan::LMOTS_Private_Key::sign().


The documentation for this class was generated from the following files: