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

std::string hash_function () const override
 
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 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 18 of file xmss_verification_operation.cpp.

19 :
20 m_pub_key(public_key),
21 m_hash(public_key.xmss_parameters()),
22 m_msg_buf(0)
23 {
24 }

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 31 of file xmss_verification_operation.h.

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

References Botan::XMSS_Hash::hash_function().

◆ is_valid_signature()

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

Perform a verification operation

Implements Botan::PK_Ops::Verification.

Definition at line 120 of file xmss_verification_operation.cpp.

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

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

◆ update()

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

Add more data to the message currently being signed

Parameters
msgthe message
msg_lenthe length of msg in bytes

Implements Botan::PK_Ops::Verification.

Definition at line 115 of file xmss_verification_operation.cpp.

116 {
117 std::copy(msg, msg + msg_len, std::back_inserter(m_msg_buf));
118 }

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