|
Botan 3.14.1
Crypto and TLS for C&
|
#include <hpke.h>
Public Member Functions | |
| const std::vector< uint8_t > & | encapsulated_key () const |
| The KEM encapsulation ("enc") to be transmitted to the recipient. | |
| secure_vector< uint8_t > | export_secret (std::span< const uint8_t > exporter_context, size_t length) const |
| Mode | mode () const |
| uint64_t | next_sequence () const |
| The sequence number the next call to seal() will use. | |
| Sender_Context & | operator= (const Sender_Context &)=delete |
| Sender_Context & | operator= (Sender_Context &&) noexcept |
| std::vector< uint8_t > | seal (std::span< const uint8_t > aad, std::span< const uint8_t > ptext) |
| Sender_Context (const Sender_Context &)=delete | |
| Sender_Context (Sender_Context &&) noexcept | |
| Suite | suite () const |
| ~Sender_Context () | |
Static Public Member Functions | |
| static Sender_Context | setup_auth (const Suite &suite, const Public_Key &recipient_key, const Private_Key &sender_identity_key, RandomNumberGenerator &rng, std::span< const uint8_t > info={}) |
| static Sender_Context | setup_auth_psk (const Suite &suite, const Public_Key &recipient_key, const Private_Key &sender_identity_key, RandomNumberGenerator &rng, const PSK &psk, std::span< const uint8_t > info={}) |
| static Sender_Context | setup_base (const Suite &suite, const Public_Key &recipient_key, RandomNumberGenerator &rng, std::span< const uint8_t > info={}) |
| static Sender_Context | setup_psk (const Suite &suite, const Public_Key &recipient_key, RandomNumberGenerator &rng, const PSK &psk, std::span< const uint8_t > info={}) |
HPKE sender (encryption) context
Created by one of the setup_* factories, each corresponding to an RFC 9180 setup function (SetupBaseS, SetupPSKS, SetupAuthS, SetupAuthPSKS).
All factories throw Invalid_Argument if the recipient (or sender identity) key does not match the suite's KEM, if the recipient key is a low order X25519/X448 point, or for an auth mode if the KEM does not support sender authentication. They throw Not_Implemented or Lookup_Error if the suite is not available in this build.
|
delete |
References Sender_Context().
Referenced by operator=(), operator=(), Sender_Context(), Sender_Context(), setup_auth(), setup_auth_psk(), setup_base(), setup_psk(), and ~Sender_Context().
|
defaultnoexcept |
References Sender_Context().
|
default |
References encapsulated_key(), export_secret(), mode(), next_sequence(), seal(), Sender_Context(), and suite().
| const std::vector< uint8_t > & Botan::HPKE::Sender_Context::encapsulated_key | ( | ) | const |
The KEM encapsulation ("enc") to be transmitted to the recipient.
Definition at line 548 of file hpke.cpp.
References encapsulated_key().
Referenced by encapsulated_key(), and ~Sender_Context().
| secure_vector< uint8_t > Botan::HPKE::Sender_Context::export_secret | ( | std::span< const uint8_t > | exporter_context, |
| size_t | length ) const |
Secret export (RFC 9180 Section 5.3)
length must be at most 255 times the KDF output length
Definition at line 557 of file hpke.cpp.
References export_secret().
Referenced by export_secret(), and ~Sender_Context().
| Mode Botan::HPKE::Sender_Context::mode | ( | ) | const |
Definition at line 566 of file hpke.cpp.
References mode().
Referenced by mode(), and ~Sender_Context().
| uint64_t Botan::HPKE::Sender_Context::next_sequence | ( | ) | const |
The sequence number the next call to seal() will use.
Definition at line 562 of file hpke.cpp.
References next_sequence().
Referenced by next_sequence(), and ~Sender_Context().
|
delete |
References Sender_Context().
|
defaultnoexcept |
References Sender_Context().
| std::vector< uint8_t > Botan::HPKE::Sender_Context::seal | ( | std::span< const uint8_t > | aad, |
| std::span< const uint8_t > | ptext ) |
Encrypt a message to the recipient, using the next sequence number
Throws Invalid_State for an export-only suite, or if the message limit has been reached.
Definition at line 552 of file hpke.cpp.
References seal().
Referenced by seal(), and ~Sender_Context().
|
static |
Definition at line 529 of file hpke.cpp.
References Botan::HPKE::Auth, Sender_Context(), setup_auth(), and suite().
Referenced by setup_auth().
|
static |
Definition at line 538 of file hpke.cpp.
References Botan::HPKE::AuthPSK, Sender_Context(), setup_auth_psk(), and suite().
Referenced by setup_auth_psk().
|
static |
Definition at line 512 of file hpke.cpp.
References Botan::HPKE::Base, Sender_Context(), setup_base(), and suite().
Referenced by setup_base().
|
static |
Definition at line 520 of file hpke.cpp.
References Botan::HPKE::PSK, Sender_Context(), setup_psk(), and suite().
Referenced by setup_psk().
| Suite Botan::HPKE::Sender_Context::suite | ( | ) | const |
Definition at line 570 of file hpke.cpp.
References suite().
Referenced by setup_auth(), setup_auth_psk(), setup_base(), setup_psk(), suite(), and ~Sender_Context().