Botan 3.6.1
Crypto and TLS for C&
Botan::PK_Ops::Signature_with_Hash Class Referenceabstract

#include <pk_ops_impl.h>

Inheritance diagram for Botan::PK_Ops::Signature_with_Hash:
Botan::PK_Ops::Signature

Public Member Functions

virtual AlgorithmIdentifier algorithm_identifier () const
 
std::vector< uint8_t > sign (RandomNumberGenerator &rng) override
 
virtual size_t signature_length () const =0
 
void update (std::span< const uint8_t > input) override
 
 ~Signature_with_Hash () override=default
 

Protected Member Functions

std::string hash_function () const final
 
 Signature_with_Hash (std::string_view hash)
 

Detailed Description

Definition at line 80 of file pk_ops_impl.h.

Constructor & Destructor Documentation

◆ ~Signature_with_Hash()

Botan::PK_Ops::Signature_with_Hash::~Signature_with_Hash ( )
overridedefault

◆ Signature_with_Hash()

Botan::PK_Ops::Signature_with_Hash::Signature_with_Hash ( std::string_view hash)
explicitprotected

Definition at line 119 of file pk_ops.cpp.

119 :
120 Signature(), m_hash(create_signature_hash(hash)) {}

Member Function Documentation

◆ algorithm_identifier()

AlgorithmIdentifier Botan::PK_Ops::Signature::algorithm_identifier ( ) const
virtualinherited

Return an algorithm identifier associated with this signature scheme.

Default implementation throws an exception

Reimplemented in Botan::XMSS_Signature_Operation.

Definition at line 24 of file pk_ops.cpp.

24 {
25 throw Not_Implemented("This signature scheme does not have an algorithm identifier available");
26}

◆ hash_function()

std::string Botan::PK_Ops::Signature_with_Hash::hash_function ( ) const
inlinefinalprotectedvirtual

Return the hash function being used by this signer

Implements Botan::PK_Ops::Signature.

Definition at line 91 of file pk_ops_impl.h.

91{ return m_hash->name(); }

◆ sign()

std::vector< uint8_t > Botan::PK_Ops::Signature_with_Hash::sign ( RandomNumberGenerator & rng)
overridevirtual

Perform a signature operation

Parameters
rnga random number generator

Implements Botan::PK_Ops::Signature.

Definition at line 136 of file pk_ops.cpp.

136 {
137 const std::vector<uint8_t> msg = m_hash->final_stdvec();
138 return raw_sign(msg, rng);
139}

◆ signature_length()

virtual size_t Botan::PK_Ops::Signature::signature_length ( ) const
pure virtualinherited

Return an upper bound on the length of the output signature

Implemented in Botan::XMSS_Signature_Operation.

◆ update()

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

Add more data to the message currently being signed

Parameters
inputthe input to be hashed/signed

Implements Botan::PK_Ops::Signature.

Definition at line 132 of file pk_ops.cpp.

132 {
133 m_hash->update(msg);
134}

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