Botan  2.6.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::EME Class Referenceabstract

#include <eme.h>

Inheritance diagram for Botan::EME:
Botan::EME_PKCS1v15 Botan::EME_Raw 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
 
virtual size_t maximum_input_size (size_t keybits) const =0
 
virtual secure_vector< uint8_t > pad (const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const =0
 
virtual secure_vector< uint8_t > unpad (uint8_t &valid_mask, const uint8_t in[], size_t in_len) const =0
 
virtual ~EME ()=default
 

Detailed Description

Encoding Method for Encryption

Definition at line 20 of file eme.h.

Constructor & Destructor Documentation

◆ ~EME()

virtual Botan::EME::~EME ( )
virtualdefault

Member Function Documentation

◆ encode() [1/2]

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

Encode an input

Parameters
inthe plaintext
in_lengthlength of plaintext in bytes
key_lengthlength of the key in bits
rnga random number generator
Returns
encoded plaintext

Definition at line 76 of file eme.cpp.

References pad().

79  {
80  return pad(msg, msg_len, key_bits, rng);
81  }
virtual secure_vector< uint8_t > pad(const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const =0

◆ encode() [2/2]

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

Encode an input

Parameters
inthe plaintext
key_lengthlength of the key in bits
rnga random number generator
Returns
encoded plaintext

Definition at line 86 of file eme.cpp.

References pad().

89  {
90  return pad(msg.data(), msg.size(), key_bits, rng);
91  }
virtual secure_vector< uint8_t > pad(const uint8_t in[], size_t in_length, size_t key_length, RandomNumberGenerator &rng) const =0

◆ maximum_input_size()

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
keybitsthe size of the key in bits
Returns
upper bound of input in bytes

Implemented in Botan::OAEP, Botan::EME_PKCS1v15, and Botan::EME_Raw.

◆ pad()

virtual secure_vector<uint8_t> Botan::EME::pad ( const uint8_t  in[],
size_t  in_length,
size_t  key_length,
RandomNumberGenerator rng 
) const
pure virtual

Encode an input

Parameters
inthe plaintext
in_lengthlength of plaintext in bytes
key_lengthlength of the key in bits
rnga random number generator
Returns
encoded plaintext

Referenced by encode().

◆ unpad()

virtual secure_vector<uint8_t> Botan::EME::unpad ( uint8_t &  valid_mask,
const uint8_t  in[],
size_t  in_len 
) const
pure virtual

Decode an input

Parameters
valid_maskwritten to specifies if output is valid
inthe encoded plaintext
in_lenlength of encoded plaintext in bytes
Returns
bytes of out[] written to along with validity mask (0xFF if valid, else 0x00)

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