Botan 2.19.5 Crypto and TLS for C&

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:

## 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 28 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 21 of file xmss_signature_operation.cpp.

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

## Member Function Documentation

## ◆ sign()

secure_vector< uint8_t > Botan::XMSS_Signature_Operation::sign | ( | RandomNumberGenerator & |  | ) |
| override virtual

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

Returns
  serialized XMSS signature.

Implements Botan::PK_Ops::Signature.

Definition at line 88 of file xmss_signature_operation.cpp.

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

References Botan::XMSS_Hash::h_msg_final(), and sign().

Referenced by sign().

## ◆ signature_length()

size_t Botan::XMSS_Signature_Operation::signature_length | ( |  | ) | const
| override virtual

Implements Botan::PK_Ops::Signature.

Definition at line 56 of file xmss_signature_operation.cpp.

57 {
58 return sizeof(uint64_t) + // size of leaf index
59 m_xmss_params.element_size() +
60 m_xmss_params.len() * m_xmss_params.element_size() +
61 m_xmss_params.tree_height() * m_xmss_params.element_size();
62 }
Botan::XMSS_Parameters::len
size_t len() const
Definition: xmss_parameters.h:82
Botan::XMSS_Parameters::tree_height
size_t tree_height() const
Definition: xmss_parameters.h:72
Botan::XMSS_Parameters::element_size
size_t element_size() const
Definition: xmss_parameters.h:67

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

## ◆ update()

void Botan::XMSS_Signature_Operation::update | ( | const uint8_t | msg[],
|  | size_t | msg_len
| ) |  |
| override virtual

Implements Botan::PK_Ops::Signature.

Definition at line 81 of file xmss_signature_operation.cpp.

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

References Botan::XMSS_Hash::h_msg_update().

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

- src/lib/pubkey/xmss/xmss_signature_operation.h
- src/lib/pubkey/xmss/xmss_signature_operation.cpp