#include <dlies.h>
|
| DLIES_Encryptor (const DH_PrivateKey &own_priv_key, RandomNumberGenerator &rng, std::unique_ptr< KDF > kdf, std::unique_ptr< Cipher_Mode > cipher, size_t cipher_key_len, std::unique_ptr< MessageAuthenticationCode > mac, size_t mac_key_len=20) |
|
| DLIES_Encryptor (const DH_PrivateKey &own_priv_key, RandomNumberGenerator &rng, std::unique_ptr< KDF > kdf, std::unique_ptr< MessageAuthenticationCode > mac, size_t mac_key_len=20) |
|
std::vector< uint8_t > | encrypt (const uint8_t in[], size_t length, RandomNumberGenerator &rng) const |
|
std::vector< uint8_t > | encrypt (std::span< const uint8_t > in, RandomNumberGenerator &rng) const |
|
void | set_initialization_vector (const InitializationVector &iv) |
| Set the initialization vector for the data encryption method.
|
|
void | set_other_key (const std::vector< uint8_t > &other_pub_key) |
|
DLIES Encryption
Definition at line 25 of file dlies.h.
◆ DLIES_Encryptor() [1/2]
Stream mode: use KDF to provide a stream of bytes to xor with the message
- Parameters
-
own_priv_key | own (ephemeral) DH private key |
rng | the RNG to use |
kdf | the KDF that should be used |
mac | the MAC function that should be used |
mac_key_len | key length of the MAC function. Default = 20 bytes |
output = (ephemeral) public key + ciphertext + tag
Definition at line 16 of file dlies.cpp.
20 :
21 DLIES_Encryptor(own_priv_key, rng, std::move(kdf),
nullptr, 0, std::move(mac), mac_key_length) {}
DLIES_Encryptor(const DH_PrivateKey &own_priv_key, RandomNumberGenerator &rng, std::unique_ptr< KDF > kdf, std::unique_ptr< MessageAuthenticationCode > mac, size_t mac_key_len=20)
◆ DLIES_Encryptor() [2/2]
Block cipher mode
- Parameters
-
own_priv_key | own (ephemeral) DH private key |
rng | the RNG to use |
kdf | the KDF that should be used |
cipher | the block cipher that should be used |
cipher_key_len | the key length of the block cipher |
mac | the MAC function that should be used |
mac_key_len | key length of the MAC function. Default = 20 bytes |
output = (ephemeral) public key + ciphertext + tag
Definition at line 23 of file dlies.cpp.
29 :
30 m_other_pub_key(),
31 m_own_pub_key(own_priv_key.public_value()),
32 m_ka(own_priv_key, rng, "Raw"),
33 m_kdf(std::move(kdf)),
34 m_cipher(std::move(cipher)),
35 m_cipher_key_len(cipher_key_len),
36 m_mac(std::move(mac)),
37 m_mac_keylen(mac_key_length),
38 m_iv() {
41}
#define BOTAN_ASSERT_NONNULL(ptr)
References BOTAN_ASSERT_NONNULL.
◆ encrypt() [1/2]
std::vector< uint8_t > Botan::PK_Encryptor::encrypt |
( |
const uint8_t | in[], |
|
|
size_t | length, |
|
|
RandomNumberGenerator & | rng ) const |
|
inlineinherited |
◆ encrypt() [2/2]
std::vector< uint8_t > Botan::PK_Encryptor::encrypt |
( |
std::span< const uint8_t > | in, |
|
|
RandomNumberGenerator & | rng ) const |
|
inlineinherited |
Encrypt a message.
- Parameters
-
in | the message |
rng | the random number source to use |
- Returns
- encrypted message
Definition at line 47 of file pubkey.h.
47 {
48 return enc(in.data(), in.size(), rng);
49 }
◆ set_initialization_vector()
Set the initialization vector for the data encryption method.
Definition at line 69 of file dlies.h.
◆ set_other_key()
void Botan::DLIES_Encryptor::set_other_key |
( |
const std::vector< uint8_t > & | other_pub_key | ) |
|
|
inline |
Definition at line 66 of file dlies.h.
66{ m_other_pub_key = other_pub_key; }
The documentation for this class was generated from the following files: