14#ifndef BOTAN_KYBER_COMMON_H_
15#define BOTAN_KYBER_COMMON_H_
17#include <botan/asn1_obj.h>
18#include <botan/der_enc.h>
19#include <botan/exceptn.h>
20#include <botan/pk_keys.h>
24#if !defined(BOTAN_HAS_KYBER_90S) && !defined(BOTAN_HAS_KYBER)
25static_assert(
false,
"botan module 'kyber_common' is useful only when enabling modules 'kyber', 'kyber_90s' or both");
53 OID object_identifier()
const;
54 std::string to_string()
const;
62 bool is_kyber_round3() const;
64 bool is_available() const;
66 bool operator==(const
KyberMode& other)
const {
return m_mode == other.m_mode; }
74class Kyber_PublicKeyInternal;
75class Kyber_PrivateKeyInternal;
89 std::string algo_name()
const override;
93 OID object_identifier()
const override;
95 size_t key_length()
const override;
97 size_t estimated_strength()
const override;
99 std::vector<uint8_t> raw_public_key_bits()
const override;
101 std::vector<uint8_t> public_key_bits()
const override;
108 return (op == PublicKeyOperation::KeyEncapsulation);
111 std::unique_ptr<PK_Ops::KEM_Encryption> create_kem_encryption_op(std::string_view params,
112 std::string_view provider)
const override;
119 static std::shared_ptr<Kyber_PublicKeyInternal> initialize_from_encoding(std::span<const uint8_t> pub_key,
141 std::unique_ptr<Public_Key> public_key()
const override;
148 std::string_view params,
149 std::string_view provider)
const override;
154 std::shared_ptr<Kyber_PrivateKeyInternal> m_private;
bool operator!=(const KyberMode &other) const
Kyber_PublicKey & operator=(const Kyber_PublicKey &other)=default
std::shared_ptr< Kyber_PublicKeyInternal > m_public
Kyber_PublicKey()=default
~Kyber_PublicKey() override=default
bool supports_operation(PublicKeyOperation op) const override
int(* final)(unsigned char *, CTX *)
#define BOTAN_DIAGNOSTIC_POP
#define BOTAN_DIAGNOSTIC_PUSH
#define BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
#define BOTAN_PUBLIC_API(maj, min)
#define BOTAN_DEPRECATED(msg)
std::vector< T, secure_allocator< T > > secure_vector