Botan 1.10.17

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

`#include <emsa3.h>`

Inheritance diagram for Botan::EMSA3_Raw:

## Public Member Functions
SecureVector< byte > | encoding_of (const MemoryRegion< byte > &, size_t, RandomNumberGenerator &rng)
SecureVector< byte > | raw_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

## ◆ encoding_of()

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

  msg | the result of raw_data()
  output_bits | the desired output bit size
  rng | a 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 }

## ◆ raw_data()

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 }
std::swap
void swap(Botan::MemoryRegion< T > &x, Botan::MemoryRegion< T > &y)
Definition: secmem.h:438

## ◆ update()

void Botan::EMSA3_Raw::update | ( | const byte | input[],
|  | size_t | length
| ) |  |
| virtual

Add more data to the signature computation

Parameters

  input | some data
  length | length of input in bytes

Implements Botan::EMSA.

Definition at line 110 of file emsa3.cpp.

111 {
112 message += std::make_pair(input, length);
113 }

## ◆ verify()

bool Botan::EMSA3_Raw::verify | ( | const MemoryRegion< byte > & | coded,
|  | const MemoryRegion< byte > & | raw,
|  | size_t | key_bits
| ) |  |
| virtual

Verify the encoding

Parameters

  coded | the received (coded) message representative
  raw | the computed (local, uncoded) message representative
  key_bits | the 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:

- src/pk_pad/emsa3/emsa3.h
- src/pk_pad/emsa3/emsa3.cpp