Botan 3.6.1
Crypto and TLS for C&
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

std::string hash_function () const override
 
bool is_valid_signature (std::span< const uint8_t > sign) override
 
void update (std::span< const uint8_t > input) override
 
 XMSS_Verification_Operation (const XMSS_PublicKey &public_key)
 

Detailed Description

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

Definition at line 21 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 19 of file xmss_verification_operation.cpp.

19 :
20 m_pub_key(public_key), m_hash(public_key.xmss_parameters()), m_msg_buf(0) {}

Member Function Documentation

◆ hash_function()

std::string Botan::XMSS_Verification_Operation::hash_function ( ) const
inlineoverridevirtual

Return the hash function being used by this signer

Implements Botan::PK_Ops::Verification.

Definition at line 29 of file xmss_verification_operation.h.

29{ return m_hash.hash_function(); }
std::string hash_function() const
Definition xmss_hash.h:34

References Botan::XMSS_Hash::hash_function().

◆ is_valid_signature()

bool Botan::XMSS_Verification_Operation::is_valid_signature ( std::span< const uint8_t > sig)
overridevirtual

Perform a verification operation

Parameters
sigthe signature to be checked with respect to the input

Implements Botan::PK_Ops::Verification.

Definition at line 83 of file xmss_verification_operation.cpp.

83 {
84 try {
85 XMSS_Signature signature(m_pub_key.xmss_parameters().oid(), sig);
86 bool result = verify(signature, m_msg_buf, m_pub_key);
87 m_msg_buf.clear();
88 return result;
89 } catch(...) {
90 m_msg_buf.clear();
91 return false;
92 }
93}
xmss_algorithm_t oid() const
const XMSS_Parameters & xmss_parameters() const
Definition xmss.h:120

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

◆ update()

void Botan::XMSS_Verification_Operation::update ( std::span< const uint8_t > input)
overridevirtual

Add more data to the message currently being signed

Parameters
inputthe input to be hashed/verified

Implements Botan::PK_Ops::Verification.

Definition at line 79 of file xmss_verification_operation.cpp.

79 {
80 m_msg_buf.insert(m_msg_buf.end(), input.begin(), input.end());
81}

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