Botan 3.6.1
Crypto and TLS for C&
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 49 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 79 of file xmss_wots.cpp.

83 :
84 XMSS_WOTS_Base(std::move(params), private_key.key_data()) {
85 for(size_t i = 0; i < m_params.len(); ++i) {
86 adrs.set_chain_address(static_cast<uint32_t>(i));
87 chain(m_params, m_key_data[i], 0, m_params.wots_parameter() - 1, adrs, public_seed, hash);
88 }
89}
XMSS_WOTS_Base(XMSS_WOTS_Parameters params)
Definition xmss_wots.h:33
wots_keysig_t m_key_data
Definition xmss_wots.h:42
XMSS_WOTS_Parameters m_params
Definition xmss_wots.h:41

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 91 of file xmss_wots.cpp.

96 :
97 XMSS_WOTS_Base(std::move(params), std::move(signature)) {
99
100 m_params.append_checksum(msg_digest);
101
102 for(size_t i = 0; i < m_params.len(); i++) {
103 adrs.set_chain_address(static_cast<uint32_t>(i));
104 chain(m_params,
105 m_key_data[i],
106 msg_digest[i],
107 m_params.wots_parameter() - 1 - msg_digest[i],
108 adrs,
109 public_seed,
110 hash);
111 }
112}
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
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61

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 38 of file xmss_wots.h.

38{ 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

◆ m_params


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