Botan 3.11.0
Crypto and TLS for C&
Botan::LMOTS_Public_Key Class Referencefinal

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 309 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)
explicit

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

Definition at line 316 of file lm_ots.cpp.

316 : /* NOLINT(*-slicing) */ OTS_Instance(lmots_sk) {
317 const auto pk_hash = lmots_sk.params().hash();
318 pk_hash->update(lmots_sk.identifier());
319 pk_hash->update(store_be(lmots_sk.q()));
320 pk_hash->update(store_be(D_PBLC));
321
322 Chain_Generator chain_gen(lmots_sk.identifier(), lmots_sk.q());
323 const auto hash = lmots_sk.params().hash();
324 LMOTS_Node tmp(lmots_sk.params().n());
325 for(uint16_t i = 0; i < lmots_sk.params().p(); ++i) {
326 chain_gen.process(*hash, i, 0, lmots_sk.params().coef_max(), lmots_sk.chain_input(i), tmp);
327 pk_hash->update(tmp);
328 }
329
330 m_K = pk_hash->final<LMOTS_K>();
331}
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:230
Strong< std::vector< uint8_t >, struct LMOTS_K_ > LMOTS_K
The K value from the LM-OTS public key.
Definition lm_ots.h:38
Strong< secure_vector< uint8_t >, struct LMOTS_Node_ > LMOTS_Node
One node within one LM-OTS hash chain.
Definition lm_ots.h:33
constexpr auto store_be(ParamTs &&... params)
Definition loadstor.h:745

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::OTS_Instance(), Botan::OTS_Instance::params(), Botan::OTS_Instance::q(), Botan::store_be(), and Botan::Buffered_Computation::update().

◆ 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 323 of file lm_ots.h.

323 :
324 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:331
const LMS_Identifier & identifier() const
The LMS identifier of the LMS tree containing this OTS instance ('I' in RFC 8554).
Definition lm_ots.h:241
LMS_Tree_Node_Idx q() const
The index of the LMS tree leaf associated with this OTS instance.
Definition lm_ots.h:246
const LMOTS_Params & params() const
The LMOTS parameters.
Definition lm_ots.h:236

References Botan::OTS_Instance::identifier(), K(), Botan::OTS_Instance::OTS_Instance(), Botan::OTS_Instance::params(), and Botan::OTS_Instance::q().

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 241 of file lm_ots.h.

241{ return m_identifier; }

Referenced by Botan::LMOTS_Private_Key::LMOTS_Private_Key(), Botan::LMOTS_Public_Key::LMOTS_Public_Key(), Botan::LMOTS_Public_Key::LMOTS_Public_Key(), OTS_Instance(), 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 331 of file lm_ots.h.

331{ return m_K; }

Referenced by LMOTS_Public_Key().

◆ params()

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

◆ 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 246 of file lm_ots.h.

246{ return m_q; }

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


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