Botan 2.19.1
Crypto and TLS for C&
Public Member Functions | Protected Member Functions | List of all members
Botan::PK_Ops::Encryption_with_EME Class Referenceabstract

#include <pk_ops_impl.h>

Inheritance diagram for Botan::PK_Ops::Encryption_with_EME:
Botan::PK_Ops::Encryption

Public Member Functions

virtual size_t ciphertext_length (size_t ptext_len) const =0
 
secure_vector< uint8_t > encrypt (const uint8_t msg[], size_t msg_len, RandomNumberGenerator &rng) override
 
size_t max_input_bits () const override
 
 ~Encryption_with_EME ()=default
 

Protected Member Functions

 Encryption_with_EME (const std::string &eme)
 

Detailed Description

Definition at line 20 of file pk_ops_impl.h.

Constructor & Destructor Documentation

◆ ~Encryption_with_EME()

Botan::PK_Ops::Encryption_with_EME::~Encryption_with_EME ( )
default

◆ Encryption_with_EME()

Botan::PK_Ops::Encryption_with_EME::Encryption_with_EME ( const std::string &  eme)
explicitprotected

Definition at line 14 of file pk_ops.cpp.

15 {
16 m_eme.reset(get_eme(eme));
17 if(!m_eme.get())
18 throw Algorithm_Not_Found(eme);
19 }
EME * get_eme(const std::string &algo_spec)
Definition: eme.cpp:27

References Botan::get_eme().

Member Function Documentation

◆ ciphertext_length()

virtual size_t Botan::PK_Ops::Encryption::ciphertext_length ( size_t  ptext_len) const
pure virtualinherited

◆ encrypt()

secure_vector< uint8_t > Botan::PK_Ops::Encryption_with_EME::encrypt ( const uint8_t  msg[],
size_t  msg_len,
RandomNumberGenerator rng 
)
overridevirtual

Implements Botan::PK_Ops::Encryption.

Definition at line 26 of file pk_ops.cpp.

28 {
29 const size_t max_raw = max_raw_input_bits();
30 const std::vector<uint8_t> encoded = unlock(m_eme->encode(msg, msg_len, max_raw, rng));
31 return raw_encrypt(encoded.data(), encoded.size(), rng);
32 }
std::vector< T > unlock(const secure_vector< T > &in)
Definition: secmem.h:72

References Botan::unlock().

◆ max_input_bits()

size_t Botan::PK_Ops::Encryption_with_EME::max_input_bits ( ) const
overridevirtual

Implements Botan::PK_Ops::Encryption.

Definition at line 21 of file pk_ops.cpp.

22 {
23 return 8 * m_eme->maximum_input_size(max_raw_input_bits());
24 }

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