Botan 3.4.0
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 () override=default
 

Protected Member Functions

 Encryption_with_EME (std::string_view eme)
 

Detailed Description

Definition at line 18 of file pk_ops_impl.h.

Constructor & Destructor Documentation

◆ ~Encryption_with_EME()

Botan::PK_Ops::Encryption_with_EME::~Encryption_with_EME ( )
overridedefault

◆ Encryption_with_EME()

Botan::PK_Ops::Encryption_with_EME::Encryption_with_EME ( std::string_view eme)
explicitprotected

Definition at line 28 of file pk_ops.cpp.

28: m_eme(EME::create(eme)) {}
static std::unique_ptr< EME > create(std::string_view algo_spec)
Definition eme.cpp:28

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 34 of file pk_ops.cpp.

36 {
37 const size_t max_raw = max_ptext_input_bits();
38 const auto encoded = m_eme->encode(msg, msg_len, max_raw, rng);
39 return raw_encrypt(encoded.data(), encoded.size(), rng);
40}

◆ max_input_bits()

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

Implements Botan::PK_Ops::Encryption.

Definition at line 30 of file pk_ops.cpp.

30 {
31 return 8 * m_eme->maximum_input_size(max_ptext_input_bits());
32}

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