Botan 3.6.1
Crypto and TLS for C&
Botan::KEM_Encapsulation Class Referencefinal

#include <pubkey.h>

Public Member Functions

const std::vector< uint8_t > & encapsulated_shared_key () const
 
 KEM_Encapsulation (std::vector< uint8_t > encapsulated_shared_key, secure_vector< uint8_t > shared_key)
 
const secure_vector< uint8_t > & shared_key () const
 

Static Public Member Functions

static std::pair< std::vector< uint8_t >, secure_vector< uint8_t > > destructure (KEM_Encapsulation &&kem)
 

Friends

class PK_KEM_Encryptor
 

Detailed Description

Result of a key encapsulation operation.

Definition at line 548 of file pubkey.h.

Constructor & Destructor Documentation

◆ KEM_Encapsulation()

Botan::KEM_Encapsulation::KEM_Encapsulation ( std::vector< uint8_t > encapsulated_shared_key,
secure_vector< uint8_t > shared_key )
inline

Definition at line 550 of file pubkey.h.

550 :
551 m_encapsulated_shared_key(std::move(encapsulated_shared_key)), m_shared_key(std::move(shared_key)) {}
const secure_vector< uint8_t > & shared_key() const
Definition pubkey.h:561
const std::vector< uint8_t > & encapsulated_shared_key() const
Definition pubkey.h:556

Member Function Documentation

◆ destructure()

static std::pair< std::vector< uint8_t >, secure_vector< uint8_t > > Botan::KEM_Encapsulation::destructure ( KEM_Encapsulation && kem)
inlinestatic
Returns
the pair (encapsulated key, key) extracted from kem

Definition at line 566 of file pubkey.h.

566 {
567 return std::make_pair(std::exchange(kem.m_encapsulated_shared_key, {}), std::exchange(kem.m_shared_key, {}));
568 }

Referenced by Botan::Kyber_PrivateKey::check_key().

◆ encapsulated_shared_key()

const std::vector< uint8_t > & Botan::KEM_Encapsulation::encapsulated_shared_key ( ) const
inline
Returns
the encapsulated shared secret (encrypted with the public key)

Definition at line 556 of file pubkey.h.

556{ return m_encapsulated_shared_key; }

◆ shared_key()

const secure_vector< uint8_t > & Botan::KEM_Encapsulation::shared_key ( ) const
inline
Returns
the plaintext shared secret

Definition at line 561 of file pubkey.h.

561{ return m_shared_key; }

Friends And Related Symbol Documentation

◆ PK_KEM_Encryptor

friend class PK_KEM_Encryptor
friend

Definition at line 571 of file pubkey.h.


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