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

#include <pk_ops_impl.h>

Inheritance diagram for Botan::PK_Ops::KEM_Encryption_with_KDF:
Botan::PK_Ops::KEM_Encryption

Public Member Functions

void kem_encrypt (secure_vector< uint8_t > &out_encapsulated_key, secure_vector< uint8_t > &out_shared_key, size_t desired_shared_key_len, Botan::RandomNumberGenerator &rng, const uint8_t salt[], size_t salt_len) override
 

Protected Member Functions

 KEM_Encryption_with_KDF (const std::string &kdf)
 
virtual void raw_kem_encrypt (secure_vector< uint8_t > &out_encapsulated_key, secure_vector< uint8_t > &raw_shared_key, Botan::RandomNumberGenerator &rng)=0
 
 ~KEM_Encryption_with_KDF ()=default
 

Detailed Description

Definition at line 187 of file pk_ops_impl.h.

Constructor & Destructor Documentation

◆ KEM_Encryption_with_KDF()

Botan::PK_Ops::KEM_Encryption_with_KDF::KEM_Encryption_with_KDF ( const std::string &  kdf)
explicitprotected

Definition at line 149 of file pk_ops.cpp.

150 {
151 m_kdf.reset(get_kdf(kdf));
152 }
KDF * get_kdf(const std::string &algo_spec)
Definition kdf.cpp:241

References Botan::get_kdf().

◆ ~KEM_Encryption_with_KDF()

Botan::PK_Ops::KEM_Encryption_with_KDF::~KEM_Encryption_with_KDF ( )
protecteddefault

Member Function Documentation

◆ kem_encrypt()

void Botan::PK_Ops::KEM_Encryption_with_KDF::kem_encrypt ( secure_vector< uint8_t > &  out_encapsulated_key,
secure_vector< uint8_t > &  out_shared_key,
size_t  desired_shared_key_len,
Botan::RandomNumberGenerator rng,
const uint8_t  salt[],
size_t  salt_len 
)
overridevirtual

Implements Botan::PK_Ops::KEM_Encryption.

Definition at line 134 of file pk_ops.cpp.

140 {
141 secure_vector<uint8_t> raw_shared;
142 this->raw_kem_encrypt(out_encapsulated_key, raw_shared, rng);
143
144 out_shared_key = m_kdf->derive_key(desired_shared_key_len,
145 raw_shared.data(), raw_shared.size(),
146 salt, salt_len);
147 }
virtual void raw_kem_encrypt(secure_vector< uint8_t > &out_encapsulated_key, secure_vector< uint8_t > &raw_shared_key, Botan::RandomNumberGenerator &rng)=0
size_t salt_len
Definition x509_obj.cpp:25

References salt_len.

◆ raw_kem_encrypt()

virtual void Botan::PK_Ops::KEM_Encryption_with_KDF::raw_kem_encrypt ( secure_vector< uint8_t > &  out_encapsulated_key,
secure_vector< uint8_t > &  raw_shared_key,
Botan::RandomNumberGenerator rng 
)
protectedpure virtual

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