Botan 3.0.0
Crypto and TLS for C&
Public Member Functions | Protected Attributes | List of all members
Botan::XMSS_WOTS_PublicKey Class Reference

#include <xmss_wots.h>

Inheritance diagram for Botan::XMSS_WOTS_PublicKey:
Botan::XMSS_WOTS_Base

Public Member Functions

const wots_keysig_tkey_data () const
 
 XMSS_WOTS_PublicKey (XMSS_WOTS_Parameters params, std::span< const uint8_t > public_seed, const XMSS_WOTS_PrivateKey &private_key, XMSS_Address &adrs, XMSS_Hash &hash)
 
 XMSS_WOTS_PublicKey (XMSS_WOTS_Parameters params, std::span< const uint8_t > public_seed, wots_keysig_t signature, const secure_vector< uint8_t > &msg, XMSS_Address &adrs, XMSS_Hash &hash)
 

Protected Attributes

wots_keysig_t m_key_data
 
XMSS_WOTS_Parameters m_params
 

Detailed Description

A Winternitz One Time Signature public key for use with Extended Hash-Based Signatures.

Definition at line 51 of file xmss_wots.h.

Constructor & Destructor Documentation

◆ XMSS_WOTS_PublicKey() [1/2]

Botan::XMSS_WOTS_PublicKey::XMSS_WOTS_PublicKey ( XMSS_WOTS_Parameters  params,
std::span< const uint8_t >  public_seed,
const XMSS_WOTS_PrivateKey private_key,
XMSS_Address adrs,
XMSS_Hash hash 
)

Algorithm 4: "WOTS_genPK" Initializes a Winternitz One Time Signature+ (WOTS+) Public Key's key data, with passed-in private key data using the WOTS chaining function.

This overload is used in multithreaded scenarios, where it is required to provide seperate instances of XMSS_Hash to each thread.

Parameters
paramsThe WOTS parameters to use
public_seedThe public seed for the public key generation
private_keyThe private key to derive the public key from
adrsThe address of the key to retrieve.
hashInstance of XMSS_Hash, that may only be used by the thread executing at.

Definition at line 82 of file xmss_wots.cpp.

87 : XMSS_WOTS_Base(std::move(params), private_key.key_data())
88 {
89 for(size_t i = 0; i < m_params.len(); ++i)
90 {
91 adrs.set_chain_address(static_cast<uint32_t>(i));
92 chain(m_params, m_key_data[i], 0, m_params.wots_parameter() - 1, adrs, public_seed, hash);
93 }
94 }
XMSS_WOTS_Base(XMSS_WOTS_Parameters params)
Definition: xmss_wots.h:34
wots_keysig_t m_key_data
Definition: xmss_wots.h:44
XMSS_WOTS_Parameters m_params
Definition: xmss_wots.h:43

References Botan::XMSS_WOTS_Parameters::len(), Botan::XMSS_WOTS_Base::m_key_data, Botan::XMSS_WOTS_Base::m_params, Botan::XMSS_Address::set_chain_address(), and Botan::XMSS_WOTS_Parameters::wots_parameter().

◆ XMSS_WOTS_PublicKey() [2/2]

Botan::XMSS_WOTS_PublicKey::XMSS_WOTS_PublicKey ( XMSS_WOTS_Parameters  params,
std::span< const uint8_t >  public_seed,
wots_keysig_t  signature,
const secure_vector< uint8_t > &  msg,
XMSS_Address adrs,
XMSS_Hash hash 
)

Creates a XMSS_WOTS_PublicKey from a message and signature using Algorithm 6 WOTS_pkFromSig defined in the XMSS standard. This overload is used to verify a message using a public key.

Parameters
paramsThe WOTS parameters to use
public_seedThe public seed to derive the key with
signatureA WOTS signature for msg.
msgA message.
adrsThe address of the key to retrieve.
hashInstance of XMSS_Hash, that may only be used by the thread executing at.

Definition at line 96 of file xmss_wots.cpp.

102 : XMSS_WOTS_Base(std::move(params), std::move(signature))
103 {
104 secure_vector<uint8_t> msg_digest
105 {
107 };
108
109 m_params.append_checksum(msg_digest);
110
111 for(size_t i = 0; i < m_params.len(); i++)
112 {
113 adrs.set_chain_address(static_cast<uint32_t>(i));
114 chain(m_params,
115 m_key_data[i],
116 msg_digest[i],
117 m_params.wots_parameter() - 1 - msg_digest[i],
118 adrs,
119 public_seed,
120 hash);
121 }
122 }
secure_vector< uint8_t > base_w(const secure_vector< uint8_t > &msg, size_t out_size) const
void append_checksum(secure_vector< uint8_t > &data) const

References Botan::XMSS_WOTS_Parameters::append_checksum(), Botan::XMSS_WOTS_Parameters::base_w(), Botan::XMSS_WOTS_Parameters::len(), Botan::XMSS_WOTS_Parameters::len_1(), Botan::XMSS_WOTS_Base::m_key_data, Botan::XMSS_WOTS_Base::m_params, Botan::XMSS_Address::set_chain_address(), and Botan::XMSS_WOTS_Parameters::wots_parameter().

Member Function Documentation

◆ key_data()

const wots_keysig_t & Botan::XMSS_WOTS_Base::key_data ( ) const
inlineinherited

Definition at line 40 of file xmss_wots.h.

40{ return m_key_data; }

References Botan::XMSS_WOTS_Base::m_key_data.

Referenced by Botan::XMSS_WOTS_PrivateKey::sign().

Member Data Documentation

◆ m_key_data

wots_keysig_t Botan::XMSS_WOTS_Base::m_key_data
protectedinherited

◆ m_params

XMSS_WOTS_Parameters Botan::XMSS_WOTS_Base::m_params
protectedinherited

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