Botan  1.10.9
Public Member Functions | List of all members
Botan::EMSA3_Raw Class Reference

#include <emsa3.h>

Inheritance diagram for Botan::EMSA3_Raw:
Botan::EMSA

Public Member Functions

SecureVector< byteencoding_of (const MemoryRegion< byte > &, size_t, RandomNumberGenerator &rng)
 
SecureVector< byteraw_data ()
 
void update (const byte[], size_t)
 
bool verify (const MemoryRegion< byte > &, const MemoryRegion< byte > &, size_t)
 

Detailed Description

EMSA3_Raw which is EMSA3 without a hash or digest id (which according to QCA docs is "identical to PKCS#11's CKM_RSA_PKCS mechanism", something I have not confirmed)

Definition at line 49 of file emsa3.h.

Member Function Documentation

SecureVector< byte > Botan::EMSA3_Raw::encoding_of ( const MemoryRegion< byte > &  msg,
size_t  output_bits,
RandomNumberGenerator rng 
)
virtual

Return the encoding of a message

Parameters
msgthe result of raw_data()
output_bitsthe desired output bit size
rnga random number generator
Returns
encoded signature

Implements Botan::EMSA.

Definition at line 128 of file emsa3.cpp.

131  {
132  return emsa3_encoding(msg, output_bits, 0, 0);
133  }
SecureVector< byte > Botan::EMSA3_Raw::raw_data ( )
virtual
Returns
raw hash

Implements Botan::EMSA.

Definition at line 118 of file emsa3.cpp.

References std::swap().

119  {
120  SecureVector<byte> ret;
121  std::swap(ret, message);
122  return ret;
123  }
void swap(Botan::MemoryRegion< T > &x, Botan::MemoryRegion< T > &y)
Definition: secmem.h:425
void Botan::EMSA3_Raw::update ( const byte  input[],
size_t  length 
)
virtual

Add more data to the signature computation

Parameters
inputsome data
lengthlength of input in bytes

Implements Botan::EMSA.

Definition at line 110 of file emsa3.cpp.

111  {
112  message += std::make_pair(input, length);
113  }
bool Botan::EMSA3_Raw::verify ( const MemoryRegion< byte > &  coded,
const MemoryRegion< byte > &  raw,
size_t  key_bits 
)
virtual

Verify the encoding

Parameters
codedthe received (coded) message representative
rawthe computed (local, uncoded) message representative
key_bitsthe size of the key in bits
Returns
true if coded is a valid encoding of raw, otherwise false

Implements Botan::EMSA.

Definition at line 138 of file emsa3.cpp.

141  {
142  try
143  {
144  return (coded == emsa3_encoding(raw, key_bits, 0, 0));
145  }
146  catch(...)
147  {
148  return false;
149  }
150  }

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