|
Botan 3.14.1
Crypto and TLS for C&
|
#include <hpke.h>
Public Member Functions | |
| 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 |
| secure_vector< uint8_t > | open (std::span< const uint8_t > aad, std::span< const uint8_t > ctext) |
| secure_vector< uint8_t > | open_at_sequence (uint64_t seq, std::span< const uint8_t > aad, std::span< const uint8_t > ctext) |
| Recipient_Context & | operator= (const Recipient_Context &)=delete |
| Recipient_Context & | operator= (Recipient_Context &&) noexcept |
| Recipient_Context (const Recipient_Context &)=delete | |
| Recipient_Context (Recipient_Context &&) noexcept | |
| Suite | suite () const |
| ~Recipient_Context () | |
Static Public Member Functions | |
| static Recipient_Context | setup_auth (const Suite &suite, const Private_Key &recipient_key, std::span< const uint8_t > enc, const Public_Key &sender_identity_key, RandomNumberGenerator &rng, std::span< const uint8_t > info={}) |
| static Recipient_Context | setup_auth_psk (const Suite &suite, const Private_Key &recipient_key, std::span< const uint8_t > enc, const Public_Key &sender_identity_key, RandomNumberGenerator &rng, const PSK &psk, std::span< const uint8_t > info={}) |
| static Recipient_Context | setup_base (const Suite &suite, const Private_Key &recipient_key, std::span< const uint8_t > enc, RandomNumberGenerator &rng, std::span< const uint8_t > info={}) |
| static Recipient_Context | setup_psk (const Suite &suite, const Private_Key &recipient_key, std::span< const uint8_t > enc, RandomNumberGenerator &rng, const PSK &psk, std::span< const uint8_t > info={}) |
HPKE recipient (decryption) context
Created by one of the setup_* factories, each corresponding to an RFC 9180 setup function (SetupBaseR, SetupPSKR, SetupAuthR, SetupAuthPSKR).
The factories throw as described for Sender_Context, and additionally throw Decoding_Error if the encapsulated key is malformed (wrong length or encoding, or not a point on the curve), or Invalid_Argument if it or the sender identity key is a low order X25519/X448 point.
|
delete |
References Recipient_Context().
Referenced by operator=(), operator=(), Recipient_Context(), Recipient_Context(), setup_auth(), setup_auth_psk(), setup_base(), setup_psk(), and ~Recipient_Context().
|
defaultnoexcept |
References Recipient_Context().
|
default |
References export_secret(), mode(), next_sequence(), open(), open_at_sequence(), Recipient_Context(), and suite().
| secure_vector< uint8_t > Botan::HPKE::Recipient_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 664 of file hpke.cpp.
Referenced by ~Recipient_Context().
| Mode Botan::HPKE::Recipient_Context::mode | ( | ) | const |
Definition at line 674 of file hpke.cpp.
Referenced by ~Recipient_Context().
| uint64_t Botan::HPKE::Recipient_Context::next_sequence | ( | ) | const |
The sequence number the next call to open() will use
Definition at line 670 of file hpke.cpp.
Referenced by ~Recipient_Context().
| secure_vector< uint8_t > Botan::HPKE::Recipient_Context::open | ( | std::span< const uint8_t > | aad, |
| std::span< const uint8_t > | ctext ) |
Decrypt a message, using the next sequence number
Throws Invalid_Authentication_Tag for truncated or unauthentic ciphertexts, or Invalid_State for export-only suites or an exhausted sequence counter. The sequence number is consumed only if decryption succeeds.
Definition at line 653 of file hpke.cpp.
Referenced by ~Recipient_Context().
| secure_vector< uint8_t > Botan::HPKE::Recipient_Context::open_at_sequence | ( | uint64_t | seq, |
| std::span< const uint8_t > | aad, | ||
| std::span< const uint8_t > | ctext ) |
Decrypt the message with the given sequence number
This does not read or modify the sequence counter used by open(), in order to support out-of-order transports.
Definition at line 658 of file hpke.cpp.
Referenced by ~Recipient_Context().
|
delete |
References Recipient_Context().
|
defaultnoexcept |
References Recipient_Context().
|
static |
Definition at line 632 of file hpke.cpp.
References Botan::HPKE::Auth, Recipient_Context(), and suite().
|
static |
Definition at line 642 of file hpke.cpp.
References Botan::HPKE::AuthPSK, Recipient_Context(), and suite().
|
static |
Definition at line 613 of file hpke.cpp.
References Botan::HPKE::Base, Recipient_Context(), and suite().
|
static |
Definition at line 622 of file hpke.cpp.
References Botan::HPKE::PSK, Recipient_Context(), and suite().
| Suite Botan::HPKE::Recipient_Context::suite | ( | ) | const |
Definition at line 678 of file hpke.cpp.
Referenced by setup_auth(), setup_auth_psk(), setup_base(), setup_psk(), and ~Recipient_Context().