Botan 3.0.0-alpha0
Crypto and TLS for C&
Public Member Functions | Protected Member Functions | List of all members
Botan::PK_Ops::KEM_Decryption_with_KDF Class Referenceabstract

#include <pk_ops_impl.h>

Inheritance diagram for Botan::PK_Ops::KEM_Decryption_with_KDF:
Botan::PK_Ops::KEM_Decryption

Public Member Functions

secure_vector< uint8_t > kem_decrypt (const uint8_t encap_key[], size_t len, size_t desired_shared_key_len, const uint8_t salt[], size_t salt_len) override
 

Protected Member Functions

 KEM_Decryption_with_KDF (const std::string &kdf)
 
virtual secure_vector< uint8_t > raw_kem_decrypt (const uint8_t encap_key[], size_t len)=0
 
 ~KEM_Decryption_with_KDF ()=default
 

Detailed Description

Definition at line 203 of file pk_ops_impl.h.

Constructor & Destructor Documentation

◆ KEM_Decryption_with_KDF()

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

Definition at line 175 of file pk_ops.cpp.

176 {
177 if(kdf != "Raw")
178 m_kdf = KDF::create_or_throw(kdf);
179 }
static std::unique_ptr< KDF > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: kdf.cpp:212

References Botan::KDF::create_or_throw().

◆ ~KEM_Decryption_with_KDF()

Botan::PK_Ops::KEM_Decryption_with_KDF::~KEM_Decryption_with_KDF ( )
protecteddefault

Member Function Documentation

◆ kem_decrypt()

secure_vector< uint8_t > Botan::PK_Ops::KEM_Decryption_with_KDF::kem_decrypt ( const uint8_t  encap_key[],
size_t  len,
size_t  desired_shared_key_len,
const uint8_t  salt[],
size_t  salt_len 
)
overridevirtual

Implements Botan::PK_Ops::KEM_Decryption.

Definition at line 160 of file pk_ops.cpp.

165 {
166 secure_vector<uint8_t> raw_shared = this->raw_kem_decrypt(encap_key, len);
167
168 if(m_kdf)
169 return m_kdf->derive_key(desired_shared_key_len,
170 raw_shared.data(), raw_shared.size(),
171 salt, salt_len);
172 return raw_shared;
173 }
virtual secure_vector< uint8_t > raw_kem_decrypt(const uint8_t encap_key[], size_t len)=0
size_t salt_len
Definition: x509_obj.cpp:25

References salt_len.

◆ raw_kem_decrypt()

virtual secure_vector< uint8_t > Botan::PK_Ops::KEM_Decryption_with_KDF::raw_kem_decrypt ( const uint8_t  encap_key[],
size_t  len 
)
protectedpure virtual

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