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

#include <xmss_verification_operation.h>

Inheritance diagram for Botan::XMSS_Verification_Operation:
Botan::PK_Ops::Verification

Public Member Functions

bool is_valid_signature (const uint8_t sig[], size_t sig_len) override
 
void update (const uint8_t msg[], size_t msg_len) override
 
 XMSS_Verification_Operation (const XMSS_PublicKey &public_key)
 

Detailed Description

Provides signature verification capabilities for Extended Hash-Based Signatures (XMSS).

Definition at line 26 of file xmss_verification_operation.h.

Constructor & Destructor Documentation

◆ XMSS_Verification_Operation()

Botan::XMSS_Verification_Operation::XMSS_Verification_Operation ( const XMSS_PublicKey public_key)

Definition at line 16 of file xmss_verification_operation.cpp.

17  :
18  m_pub_key(public_key),
19  m_hash(public_key.xmss_hash_function()),
20  m_msg_buf(0)
21  {
22  }

Member Function Documentation

◆ is_valid_signature()

bool Botan::XMSS_Verification_Operation::is_valid_signature ( const uint8_t  sig[],
size_t  sig_len 
)
overridevirtual

Implements Botan::PK_Ops::Verification.

Definition at line 117 of file xmss_verification_operation.cpp.

References Botan::XMSS_Parameters::oid(), and Botan::XMSS_PublicKey::xmss_parameters().

119  {
120  try
121  {
122  XMSS_Signature signature(m_pub_key.xmss_parameters().oid(),
123  secure_vector<uint8_t>(sig, sig + sig_len));
124  bool result = verify(signature, m_msg_buf, m_pub_key);
125  m_msg_buf.clear();
126  return result;
127  }
128  catch(...)
129  {
130  m_msg_buf.clear();
131  return false;
132  }
133  }
const XMSS_Parameters & xmss_parameters() const
xmss_algorithm_t oid() const

◆ update()

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

Implements Botan::PK_Ops::Verification.

Definition at line 112 of file xmss_verification_operation.cpp.

113  {
114  std::copy(msg, msg + msg_len, std::back_inserter(m_msg_buf));
115  }

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