Botan 3.6.1
Crypto and TLS for C&
|
#include <pubkey.h>
Public Member Functions | |
secure_vector< uint8_t > | decrypt (const uint8_t encap_key[], size_t encap_key_len, size_t desired_shared_key_len, const uint8_t salt[]=nullptr, size_t salt_len=0) |
secure_vector< uint8_t > | decrypt (std::span< const uint8_t > encap_key, size_t desired_shared_key_len=32, std::span< const uint8_t > salt={}) |
void | decrypt (std::span< uint8_t > out_shared_key, std::span< const uint8_t > encap_key, size_t desired_shared_key_len=32, std::span< const uint8_t > salt={}) |
size_t | encapsulated_key_length () const |
PK_KEM_Decryptor & | operator= (const PK_KEM_Decryptor &)=delete |
PK_KEM_Decryptor & | operator= (PK_KEM_Decryptor &&) noexcept |
PK_KEM_Decryptor (const PK_KEM_Decryptor &)=delete | |
PK_KEM_Decryptor (const Private_Key &key, RandomNumberGenerator &rng, std::string_view kem_param="", std::string_view provider="") | |
PK_KEM_Decryptor (PK_KEM_Decryptor &&) noexcept | |
size_t | shared_key_length (size_t desired_shared_key_len) const |
~PK_KEM_Decryptor () | |
Botan::PK_KEM_Decryptor::PK_KEM_Decryptor | ( | const Private_Key & | key, |
RandomNumberGenerator & | rng, | ||
std::string_view | kem_param = "", | ||
std::string_view | provider = "" ) |
Construct an instance.
key | the key to use inside the decryptor |
rng | the RNG to use |
kem_param | additional KEM parameters |
provider | the provider to use |
Definition at line 176 of file pubkey.cpp.
References Botan::Asymmetric_Key::algo_name(), Botan::Private_Key::create_kem_decryption_op(), and Botan::fmt().
|
default |
|
delete |
|
defaultnoexcept |
|
inline |
Decrypts the shared key for data encryption.
encap_key | the encapsulated key |
encap_key_len | size of the encapsulated key in bytes |
desired_shared_key_len | desired size of the shared key in bytes (ignored if no KDF is used) |
salt | a salt value used in the KDF (ignored if no KDF is used) |
salt_len | size of the salt value in bytes (ignored if no KDF is used) |
Definition at line 795 of file pubkey.h.
|
inline |
Decrypts the shared key for data encryption.
encap_key | the encapsulated key |
desired_shared_key_len | desired size of the shared key in bytes (ignored if no KDF is used) |
salt | a salt value used in the KDF (ignored if no KDF is used) |
Definition at line 816 of file pubkey.h.
void Botan::PK_KEM_Decryptor::decrypt | ( | std::span< uint8_t > | out_shared_key, |
std::span< const uint8_t > | encap_key, | ||
size_t | desired_shared_key_len = 32, | ||
std::span< const uint8_t > | salt = {} ) |
Decrypts the shared key for data encryption.
out_shared_key | the generated shared key |
encap_key | the encapsulated key |
desired_shared_key_len | desired size of the shared key in bytes (ignored if no KDF is used) |
salt | a salt value used in the KDF (ignored if no KDF is used) |
Definition at line 191 of file pubkey.cpp.
References BOTAN_ARG_CHECK.
Referenced by Botan::Kyber_PrivateKey::check_key(), and Botan::TLS::Callbacks::tls_kem_decapsulate().
size_t Botan::PK_KEM_Decryptor::encapsulated_key_length | ( | ) | const |
Return the length of the encapsulated key expected by this KEM
Definition at line 172 of file pubkey.cpp.
Referenced by Botan::TLS::Callbacks::tls_kem_decapsulate().
|
delete |
|
defaultnoexcept |
size_t Botan::PK_KEM_Decryptor::shared_key_length | ( | size_t | desired_shared_key_len | ) | const |
Return the length of the shared key returned by this KEM
If this KEM was used with a KDF, then it will always return exactly the desired key length, because the output of the KEM will be hashed by the KDF.
However if the KEM was used with "Raw" kdf, to request the algorithmic output of the KEM directly, then the desired key length will be ignored and a bytestring that depends on the algorithm is returned
desired_shared_key_len | is the requested length. |
Definition at line 168 of file pubkey.cpp.