Botan 3.6.1
Crypto and TLS for C&
|
#include <ecies.h>
Public Member Functions | |
secure_vector< uint8_t > | decrypt (const uint8_t in[], size_t length) const |
secure_vector< uint8_t > | decrypt (std::span< const uint8_t > in) const |
secure_vector< uint8_t > | decrypt_or_random (const uint8_t in[], size_t length, size_t expected_pt_len, RandomNumberGenerator &rng) const |
secure_vector< uint8_t > | decrypt_or_random (const uint8_t in[], size_t length, size_t expected_pt_len, RandomNumberGenerator &rng, const uint8_t required_content_bytes[], const uint8_t required_content_offsets[], size_t required_contents) const |
ECIES_Decryptor (const PK_Key_Agreement_Key &private_key, const ECIES_System_Params &ecies_params, RandomNumberGenerator &rng) | |
void | set_initialization_vector (const InitializationVector &iv) |
Set the initialization vector for the data encryption method. | |
void | set_label (std::string_view label) |
Set the label which is appended to the input for the message authentication code. | |
Botan::ECIES_Decryptor::ECIES_Decryptor | ( | const PK_Key_Agreement_Key & | private_key, |
const ECIES_System_Params & | ecies_params, | ||
RandomNumberGenerator & | rng ) |
private_key | the private key which is used for the key agreement |
ecies_params | settings for ecies |
rng | the random generator to use |
Definition at line 288 of file ecies.cpp.
References Botan::ECIES_KA_Params::check_mode().
|
inherited |
Decrypt a ciphertext, throwing an exception if the input seems to be invalid (eg due to an accidental or malicious error in the ciphertext).
in | the ciphertext as a byte array |
length | the length of the above byte array |
Definition at line 23 of file pubkey.cpp.
Referenced by Botan::KeyPair::encryption_consistency_check().
|
inlineinherited |
Same as above, but taking a vector
in | the ciphertext |
Definition at line 96 of file pubkey.h.
References Botan::PK_Decryptor::decrypt().
Referenced by Botan::PK_Decryptor::decrypt().
|
inherited |
Decrypt a ciphertext. If the ciphertext is invalid (eg due to invalid padding) or is not the expected length, instead returns a random string of the expected length. Use to avoid oracle attacks, especially against PKCS #1 v1.5 decryption.
Definition at line 80 of file pubkey.cpp.
References Botan::PK_Decryptor::decrypt_or_random().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and Botan::PK_Decryptor::decrypt_or_random().
|
inherited |
Decrypt a ciphertext. If the ciphertext is invalid (eg due to invalid padding) or is not the expected length, instead returns a random string of the expected length. Use to avoid oracle attacks, especially against PKCS #1 v1.5 decryption.
Additionally checks (also in const time) that: contents[required_content_offsets[i]] == required_content_bytes[i] for 0 <= i < required_contents
Used for example in TLS, which encodes the client version in the content bytes: if there is any timing variation the version check can be used as an oracle to recover the key.
Definition at line 35 of file pubkey.cpp.
References BOTAN_ASSERT, Botan::CT::Mask< T >::is_equal(), and Botan::RandomNumberGenerator::random_vec().
|
inline |
|
inline |