Botan 3.4.0
Crypto and TLS for C&
Public Member Functions | Protected Member Functions | List of all members
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
 
secure_vector< uint8_t > sign (RandomNumberGenerator &rng) override
 
virtual size_t signature_length () const =0
 
void update (const uint8_t msg[], size_t msg_len) 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 104 of file pk_ops.cpp.

104 :
105 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()

secure_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 121 of file pk_ops.cpp.

121 {
122 const secure_vector<uint8_t> msg = m_hash->final();
123 return raw_sign(msg.data(), msg.size(), rng);
124}

◆ 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 ( 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::Signature.

Definition at line 117 of file pk_ops.cpp.

117 {
118 m_hash->update(msg, msg_len);
119}

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