|
Botan 3.14.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, const PK_KEM_Options &options) | |
| 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, | ||
| const PK_KEM_Options & | options ) |
Construct an instance.
| key | the key to use inside the decryptor |
| Random Number Generators | a RNG object which must outlive this operation object |
| options | controls the behavior of the KEM, eg which KDF to use |
Definition at line 239 of file pubkey.cpp.
References Botan::Private_Key::_create_kem_decryption_op(), Botan::Asymmetric_Key::algo_name(), and Botan::fmt().
Referenced by decrypt(), operator=(), operator=(), PK_KEM_Decryptor(), PK_KEM_Decryptor(), and 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 |
| Random Number Generators | a RNG object which must outlive this operation object |
| kem_param | additional KEM parameters |
| provider | the provider to use |
Definition at line 233 of file pubkey.cpp.
References Botan::parse_legacy_kem_options(), and PK_KEM_Decryptor().
|
default |
|
delete |
References PK_KEM_Decryptor().
|
defaultnoexcept |
References PK_KEM_Decryptor().
|
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 898 of file pubkey.h.
References decrypt(), and shared_key_length().
|
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 919 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 255 of file pubkey.cpp.
References BOTAN_ARG_CHECK, decrypt(), PK_KEM_Decryptor(), and shared_key_length().
Referenced by Botan::FrodoKEM_PrivateKey::check_key(), Botan::Kyber_PrivateKey::check_key(), decrypt(), decrypt(), operator=(), 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 229 of file pubkey.cpp.
Referenced by operator=(), and Botan::TLS::Callbacks::tls_kem_decapsulate().
|
delete |
References PK_KEM_Decryptor().
|
defaultnoexcept |
References decrypt(), encapsulated_key_length(), PK_KEM_Decryptor(), and shared_key_length().
| 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 without a KDF (with_raw_shared_key, or the legacy "Raw" kdf string), 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 225 of file pubkey.cpp.
Referenced by decrypt(), decrypt(), and operator=().