Botan 3.9.0
Crypto and TLS for C&
|
Abstract interface for a KEM decryption operation for KEM combiners. More...
#include <hybrid_kem_ops.h>
Public Member Functions | |
size_t | encapsulated_key_length () const override |
The default implementation returns the sum of the encapsulated key lengths of the underlying KEMs. | |
void | kem_decrypt (std::span< uint8_t > out_shared_key, std::span< const uint8_t > encapsulated_key, size_t desired_shared_key_len, std::span< const uint8_t > salt) final |
KEM_Decryption_with_Combiner (const std::vector< std::unique_ptr< Private_Key > > &private_keys, RandomNumberGenerator &rng, std::string_view provider) | |
virtual size_t | shared_key_length (size_t desired_shared_key_len) const =0 |
Protected Member Functions | |
virtual void | combine_shared_secrets (std::span< uint8_t > out_shared_secret, const std::vector< secure_vector< uint8_t > > &shared_secrets, const std::vector< std::vector< uint8_t > > &ciphertexts, size_t desired_shared_key_len, std::span< const uint8_t > salt)=0 |
Describes how the shared secrets are combined to derive the final shared secret. | |
std::vector< PK_KEM_Decryptor > & | decryptors () |
const std::vector< PK_KEM_Decryptor > & | decryptors () const |
virtual std::vector< std::vector< uint8_t > > | split_ciphertexts (std::span< const uint8_t > concat_ciphertext) |
Defines how the individual ciphertexts are extracted from the combined ciphertext. |
Abstract interface for a KEM decryption operation for KEM combiners.
Multiple private keys are used to decapsulate shared secrets from a combined ciphertext (concatenated in most cases). These shared secrets (and maybe the ciphertexts and public keys) are combined using the KEM combiner to derive the final shared secret.
Definition at line 91 of file hybrid_kem_ops.h.
Botan::KEM_Decryption_with_Combiner::KEM_Decryption_with_Combiner | ( | const std::vector< std::unique_ptr< Private_Key > > & | private_keys, |
RandomNumberGenerator & | rng, | ||
std::string_view | provider ) |
Definition at line 65 of file hybrid_kem_ops.cpp.
|
protectedpure virtual |
Describes how the shared secrets are combined to derive the final shared secret.
out_shared_secret | the output buffer for the shared secret |
shared_secrets | a list of shared secrets coreesponding to the public keys |
ciphertexts | the list of encapsulated shared secrets |
desired_shared_key_len | the desired shared key length |
salt | the salt (input of kem_decrypt) |
Referenced by kem_decrypt().
|
inlineprotected |
Definition at line 130 of file hybrid_kem_ops.h.
|
inlineprotected |
Definition at line 132 of file hybrid_kem_ops.h.
|
inlineoverridevirtual |
The default implementation returns the sum of the encapsulated key lengths of the underlying KEMs.
Implements Botan::PK_Ops::KEM_Decryption.
Definition at line 103 of file hybrid_kem_ops.h.
Referenced by kem_decrypt(), and split_ciphertexts().
|
finalvirtual |
Implements Botan::PK_Ops::KEM_Decryption.
Definition at line 77 of file hybrid_kem_ops.cpp.
References BOTAN_ARG_CHECK, BOTAN_ASSERT, combine_shared_secrets(), encapsulated_key_length(), Botan::PK_Ops::KEM_Decryption::shared_key_length(), and split_ciphertexts().
|
pure virtualinherited |
Implemented in Botan::PK_Ops::KEM_Decryption_with_KDF.
Referenced by Botan::KEM_Decryption_with_Combiner::kem_decrypt().
|
protectedvirtual |
Defines how the individual ciphertexts are extracted from the combined ciphertext.
The default implementation splits concatenated ciphertexts.
concat_ciphertext | The combined ciphertext |
Definition at line 96 of file hybrid_kem_ops.cpp.
References BOTAN_ARG_CHECK, BOTAN_ASSERT_NOMSG, Botan::BufferSlicer::copy_as_vector(), Botan::BufferSlicer::empty(), and encapsulated_key_length().
Referenced by kem_decrypt().