|
Botan 3.14.1
Crypto and TLS for C&
|
#include <hpke_kem.h>
Classes | |
| struct | Encapsulation |
Public Member Functions | |
| virtual std::unique_ptr< Botan::Private_Key > | adopt_private (std::unique_ptr< Botan::Private_Key > key) const =0 |
| virtual std::unique_ptr< Botan::Public_Key > | adopt_public (std::unique_ptr< Botan::Public_Key > key) const =0 |
| virtual secure_vector< uint8_t > | auth_decap (std::span< const uint8_t > enc, const Botan::Private_Key &skR, const Botan::Public_Key &pkS, RandomNumberGenerator &rng) const |
| virtual Encapsulation | auth_encap (const Botan::Public_Key &pkR, const Botan::Private_Key &skS, RandomNumberGenerator &rng) const |
| Only supported if supports_auth(); the default implementations throw. | |
| virtual Encapsulation | auth_encap_with_ephemeral (const Botan::Public_Key &pkR, const Botan::Private_Key &skS, const Botan::Private_Key &skE, RandomNumberGenerator &rng) const |
| virtual secure_vector< uint8_t > | decap (std::span< const uint8_t > enc, const Botan::Private_Key &skR, RandomNumberGenerator &rng) const =0 |
| virtual std::unique_ptr< Botan::Private_Key > | derive_key_pair (std::span< const uint8_t > ikm) const =0 |
| virtual std::unique_ptr< Botan::Private_Key > | deserialize_private (std::span< const uint8_t > bytes) const =0 |
| virtual std::unique_ptr< Botan::Public_Key > | deserialize_public (std::span< const uint8_t > bytes) const =0 |
| virtual Encapsulation | encap (const Botan::Public_Key &pkR, RandomNumberGenerator &rng) const =0 |
| virtual Encapsulation | encap_with_ephemeral (const Botan::Public_Key &pkR, const Botan::Private_Key &skE, RandomNumberGenerator &rng) const |
| virtual std::unique_ptr< Botan::Private_Key > | generate_key (RandomNumberGenerator &rng) const =0 |
| KEM_Id | kem_id () const |
| KEM_Ops (const KEM_Ops &)=delete | |
| KEM_Ops (KEM_Ops &&)=delete | |
| KEM_Ops & | operator= (const KEM_Ops &)=delete |
| KEM_Ops & | operator= (KEM_Ops &&)=delete |
| virtual secure_vector< uint8_t > | serialize_private (const Botan::Private_Key &key) const =0 |
| virtual std::vector< uint8_t > | serialize_public (const Botan::Public_Key &key) const =0 |
| virtual bool | supports_auth () const |
| virtual | ~KEM_Ops ()=default |
Static Public Member Functions | |
| static std::unique_ptr< const KEM_Ops > | create (KEM_Id kem) |
Protected Member Functions | |
| KEM_Ops (KEM_Id kem) | |
Internal interface for the KEM operations HPKE requires
Implemented by DHKEM (RFC 9180 Section 4.1) over the key agreement algorithms.
Definition at line 44 of file hpke_kem.h.
|
virtualdefault |
|
delete |
References KEM_Ops().
Referenced by KEM_Ops(), KEM_Ops(), operator=(), and operator=().
|
delete |
References KEM_Ops().
|
inlineexplicitprotected |
Definition at line 129 of file hpke_kem.h.
|
pure virtual |
|
pure virtual |
Adopt an existing key for use with this KEM
Returns the key itself if it is of the type the KEM operates on, or an equivalent key of that type (for the NIST curves, an ECDSA key is converted to ECDH). Throws Invalid_Argument for any other key, or if the key's group does not match the KEM.
|
virtual |
Definition at line 96 of file hpke_kem.cpp.
References Botan::fmt(), and kem_id().
Referenced by decap().
|
virtual |
Only supported if supports_auth(); the default implementations throw.
Definition at line 89 of file hpke_kem.cpp.
References Botan::fmt(), and kem_id().
Referenced by decap().
|
virtual |
Deterministic authenticated encapsulation with a caller-provided ephemeral key, for known-answer testing of DHKEMs. The default implementation throws.
Definition at line 110 of file hpke_kem.cpp.
References Botan::fmt(), and kem_id().
Referenced by decap().
Create the operations for a KEM
Throws Not_Implemented if the codepoint is unknown or the required algorithms are not available in this build.
Definition at line 545 of file hpke_kem.cpp.
References Botan::HPKE::KEM_Id::code(), Botan::HPKE::DHKEM_P256, Botan::HPKE::DHKEM_P384, Botan::HPKE::DHKEM_P521, Botan::HPKE::DHKEM_X25519, Botan::HPKE::DHKEM_X448, Botan::fmt(), and Botan::EC_Group::supports_named_group().
Referenced by Botan::HPKE::Private_Key::derive(), Botan::HPKE::Private_Key::deserialize(), Botan::HPKE::Public_Key::deserialize(), Botan::HPKE::Private_Key::from_key(), Botan::HPKE::Public_Key::from_key(), Botan::HPKE::Private_Key::generate(), and Botan::HPKE::KEM_Id::is_available().
|
pure virtual |
References auth_decap(), auth_encap(), auth_encap_with_ephemeral(), and encap_with_ephemeral().
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
virtual |
Deterministic encapsulation with a caller-provided ephemeral key, for known-answer testing of DHKEMs. The default implementation throws.
Definition at line 104 of file hpke_kem.cpp.
References Botan::fmt(), and kem_id().
Referenced by decap().
|
pure virtual |
|
inline |
Definition at line 65 of file hpke_kem.h.
Referenced by auth_decap(), auth_encap(), auth_encap_with_ephemeral(), and encap_with_ephemeral().
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
Definition at line 68 of file hpke_kem.h.