Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::OAEP Class Referencefinal

`#include <oaep.h>`

Inheritance diagram for Botan::OAEP:

## Public Member Functions
secure_vector< uint8_t > | encode (const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const
secure_vector< uint8_t > | encode (const secure_vector< uint8_t > &in, size_t key_length, RandomNumberGenerator &rng) const
size_t | maximum_input_size (size_t) const override
| OAEP (HashFunction *hash, const std::string &P="")

## Detailed Description

OAEP (called EME1 in IEEE 1363 and in earlier versions of the library)

Definition at line 19 of file oaep.h.

## Constructor & Destructor Documentation

Botan::OAEP::OAEP | ( | HashFunction * | hash,
|  | const std::string & | P = `""`
| ) |  |

Parameters

  hash | function to use for hashing (takes ownership)
  P | an optional label. Normally empty.

Definition at line 137 of file oaep.cpp.

137 : m_hash(hash)
138 {
139 m_Phash = m_hash->process(P);
140 }
hash
MechanismType hash
Definition: p11_mechanism.cpp:63

## Member Function Documentation

secure_vector< uint8_t > Botan::EME::encode | ( | const uint8_t | in[],
|  | size_t | in_length,
|  | size_t | key_length,
|  | RandomNumberGenerator & | rng
| ) |  | const
| inherited

Encode an input

Parameters

  in | the plaintext
  in_length | length of plaintext in bytes
  key_length | length of the key in bits
  rng | a random number generator

Returns
  encoded plaintext

Definition at line 59 of file eme.cpp.

References Botan::EME::pad().

62 {
63 return pad(msg, msg_len, key_bits, rng);
64 }
Botan::EME::pad
virtual secure_vector< uint8_t > pad(const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const =0

secure_vector< uint8_t > Botan::EME::encode | ( | const secure_vector< uint8_t > & | in,
|  | size_t | key_length,
|  | RandomNumberGenerator & | rng
| ) |  | const
| inherited

Encode an input

Parameters

  in | the plaintext
  key_length | length of the key in bits
  rng | a random number generator

Returns
  encoded plaintext

Definition at line 69 of file eme.cpp.

References Botan::EME::pad().

72 {
73 return pad(msg.data(), msg.size(), key_bits, rng);
74 }
Botan::EME::pad
virtual secure_vector< uint8_t > pad(const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const =0

size_t Botan::OAEP::maximum_input_size | ( | size_t | keybits | ) | const
| override virtual

Return the maximum input size in bytes we can support

Parameters

  keybits | the size of the key in bits

Returns
  upper bound of input in bytes

Implements Botan::EME.

Definition at line 126 of file oaep.cpp.

127 {
128 if(keybits / 8 > 2*m_Phash.size() + 1)
129 return ((keybits / 8) - 2*m_Phash.size() - 1);
130 else
131 return 0;
132 }

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

- src/lib/pk_pad/eme_oaep/oaep.h
- src/lib/pk_pad/eme_oaep/oaep.cpp