Botan  2.15.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::XMSS_Signature_Operation Class Referencefinal

#include <xmss_signature_operation.h>

Inheritance diagram for Botan::XMSS_Signature_Operation:
Botan::PK_Ops::Signature

Public Member Functions

secure_vector< uint8_t > sign (RandomNumberGenerator &) override
 
size_t signature_length () const override
 
void update (const uint8_t msg[], size_t msg_len) override
 
 XMSS_Signature_Operation (const XMSS_PrivateKey &private_key)
 

Detailed Description

Signature generation operation for Extended Hash-Based Signatures (XMSS) as defined in:

[1] XMSS: Extended Hash-Based Signatures, Request for Comments: 8391 Release: May 2018. https://datatracker.ietf.org/doc/rfc8391/

Definition at line 34 of file xmss_signature_operation.h.

Constructor & Destructor Documentation

◆ XMSS_Signature_Operation()

Botan::XMSS_Signature_Operation::XMSS_Signature_Operation ( const XMSS_PrivateKey private_key)

Definition at line 20 of file xmss_signature_operation.cpp.

21  :
22  m_priv_key(private_key),
23  m_xmss_params(private_key.xmss_oid()),
24  m_hash(private_key.xmss_hash_function()),
25  m_randomness(0),
26  m_leaf_idx(0),
27  m_is_initialized(false)
28  {}

Member Function Documentation

◆ sign()

secure_vector< uint8_t > Botan::XMSS_Signature_Operation::sign ( RandomNumberGenerator )
overridevirtual

Creates an XMSS signature for the message provided through call to update().

Returns
serialized XMSS signature.

Implements Botan::PK_Ops::Signature.

Definition at line 86 of file xmss_signature_operation.cpp.

References Botan::XMSS_Hash::h_msg_final().

87  {
88  initialize();
89  secure_vector<uint8_t> signature(sign(m_hash.h_msg_final(),
90  m_priv_key).bytes());
91  m_is_initialized = false;
92  return signature;
93  }
secure_vector< uint8_t > h_msg_final()
Definition: xmss_hash.cpp:64
secure_vector< uint8_t > sign(RandomNumberGenerator &) override

◆ signature_length()

size_t Botan::XMSS_Signature_Operation::signature_length ( ) const
overridevirtual

Implements Botan::PK_Ops::Signature.

Definition at line 55 of file xmss_signature_operation.cpp.

References Botan::XMSS_Parameters::element_size(), Botan::XMSS_Parameters::len(), and Botan::XMSS_Parameters::tree_height().

56  {
57  return sizeof(uint64_t) + // size of leaf index
58  m_xmss_params.element_size() +
59  m_xmss_params.len() * m_xmss_params.element_size() +
60  m_xmss_params.tree_height() * m_xmss_params.element_size();
61  }
size_t tree_height() const
size_t element_size() const

◆ update()

void Botan::XMSS_Signature_Operation::update ( const uint8_t  msg[],
size_t  msg_len 
)
overridevirtual

Implements Botan::PK_Ops::Signature.

Definition at line 79 of file xmss_signature_operation.cpp.

References Botan::XMSS_Hash::h_msg_update().

80  {
81  initialize();
82  m_hash.h_msg_update(msg, msg_len);
83  }
void h_msg_update(const uint8_t data[], size_t size)
Definition: xmss_hash.cpp:59

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