Botan: Botan::EME Class Reference

Botan 1.10.12

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

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

Public Member Functions | List of all members
Botan::EME Class Referenceabstract

`#include <eme.h>`

Inheritance diagram for Botan::EME:

## Public Member Functions
SecureVector< byte > | decode (const byte in[], size_t in_length, size_t key_length) const
SecureVector< byte > | decode (const MemoryRegion< byte > &in, size_t key_length) const
SecureVector< byte > | encode (const byte in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const
SecureVector< byte > | encode (const MemoryRegion< byte > &in, size_t key_length, RandomNumberGenerator &rng) const
virtual size_t | maximum_input_size (size_t keybits) const =0
virtual | ~EME ()

## Detailed Description

Encoding Method for Encryption

Definition at line 19 of file eme.h.

## Constructor & Destructor Documentation

virtual Botan::EME::~EME | ( |  | ) |
| inlinevirtual

Definition at line 73 of file eme.h.

73 {}

## Member Function Documentation

SecureVector< byte > Botan::EME::decode | ( | const byte | in[],
|  | size_t | in_length,
|  | size_t | key_length
| ) |  | const

Decode an input

Parameters

  in | the encoded plaintext
  in_length | length of encoded plaintext in bytes
  key_length | length of the key in bits

Returns
  plaintext

Definition at line 35 of file eme.cpp.

Referenced by Botan::PK_Decryptor_EME::PK_Decryptor_EME().

37 {
38 return unpad(msg, msg_len, key_bits);
39 }

SecureVector< byte > Botan::EME::decode | ( | const MemoryRegion< byte > & | in,
|  | size_t | key_length
| ) |  | const

Decode an input

Parameters

  in | the encoded plaintext
  key_length | length of the key in bits

Returns
  plaintext

Definition at line 44 of file eme.cpp.

References Botan::MemoryRegion< T >::size().

46 {
47 return unpad(&msg[0], msg.size(), key_bits);
48 }

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

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 15 of file eme.cpp.

Referenced by Botan::PK_Encryptor_EME::PK_Encryptor_EME().

18 {
19 return pad(msg, msg_len, key_bits, rng);
20 }

SecureVector< byte > Botan::EME::encode | ( | const MemoryRegion< byte > & | in,
|  | size_t | key_length,
|  | RandomNumberGenerator & | rng
| ) |  | const

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 25 of file eme.cpp.

References Botan::MemoryRegion< T >::size().

28 {
29 return pad(&msg[0], msg.size(), key_bits, rng);
30 }

virtual size_t Botan::EME::maximum_input_size | ( | size_t | keybits | ) | const
| pure 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

Implemented in Botan::EME1, and Botan::EME_PKCS1v15.

Referenced by Botan::PK_Encryptor_EME::maximum_input_size().

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

- src/pk_pad/eme.h
- src/pk_pad/eme.cpp