14#ifndef BOTAN_KYBER_COMMON_H_ 
   15#define BOTAN_KYBER_COMMON_H_ 
   17#include <botan/exceptn.h> 
   18#include <botan/pk_keys.h> 
   22#if !defined(BOTAN_HAS_KYBER_90S) && !defined(BOTAN_HAS_KYBER) && !defined(BOTAN_HAS_ML_KEM) 
   25   "botan module 'kyber_common' is useful only when enabling at least one of those modules: 'kyber', 'kyber_90s', 'ml_kem'");
 
   59      OID object_identifier() 
const;
 
   68      bool is_ml_kem() const;
 
   70      bool is_kyber_round3() const;
 
   72      bool is_available() const;
 
   74      bool operator==(const 
KyberMode& other)
 const { 
return m_mode == other.m_mode; }
 
 
   93class Kyber_PublicKeyInternal;
 
   94class Kyber_PrivateKeyInternal;
 
  131      std::unique_ptr<PK_Ops::KEM_Encryption> create_kem_encryption_op(std::string_view params,
 
  132                                                                       std::string_view provider) 
const override;
 
 
  179      std::unique_ptr<Public_Key> 
public_key() 
const override;
 
  188                                                                       std::string_view params,
 
  189                                                                       std::string_view provider) 
const override;
 
  214      std::shared_ptr<Kyber_PrivateKeyInternal> m_private;
 
 
#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)
 
bool operator!=(const KyberMode &other) const
 
MlPrivateKeyFormat private_key_format() const
 
secure_vector< uint8_t > private_key_bits_with_format(MlPrivateKeyFormat format) const
 
std::unique_ptr< PK_Ops::KEM_Decryption > create_kem_decryption_op(RandomNumberGenerator &rng, std::string_view params, std::string_view provider) const override
 
std::unique_ptr< Public_Key > public_key() const override
 
bool check_key(RandomNumberGenerator &rng, bool strong) const override
 
Kyber_PrivateKey(RandomNumberGenerator &rng, KyberMode mode)
 
secure_vector< uint8_t > raw_private_key_bits() const override
 
friend class Kyber_KEM_Decryptor
 
secure_vector< uint8_t > private_key_bits() const override
 
Kyber_PublicKey & operator=(const Kyber_PublicKey &other)=default
 
std::vector< uint8_t > public_key_bits() const override
 
Kyber_PublicKey(Kyber_PublicKey &&other)=default
 
std::vector< uint8_t > raw_public_key_bits() const override
 
bool check_key(RandomNumberGenerator &rng, bool strong) const override
 
std::string algo_name() const override
 
std::shared_ptr< Kyber_PublicKeyInternal > m_public
 
friend class Kyber_KEM_Encryptor
 
size_t key_length() const override
 
AlgorithmIdentifier algorithm_identifier() const override
 
Kyber_PublicKey()=default
 
~Kyber_PublicKey() override=default
 
static std::shared_ptr< Kyber_PublicKeyInternal > initialize_from_encoding(std::span< const uint8_t > pub_key, KyberMode m)
 
bool supports_operation(PublicKeyOperation op) const override
 
OID object_identifier() const override
 
friend class Kyber_KEM_Decryptor
 
std::unique_ptr< Private_Key > generate_another(RandomNumberGenerator &rng) const final
 
Kyber_PublicKey(std::span< const uint8_t > pub_key, KyberMode mode)
 
Kyber_PublicKey & operator=(Kyber_PublicKey &&other)=default
 
size_t estimated_strength() const override
 
MlPrivateKeyFormat
Byte encoding format of ML-KEM and ML-DSA the private key.
 
@ Expanded
The expanded format, i.e., the format specified in FIPS-203/204.
 
std::vector< T, secure_allocator< T > > secure_vector
 
std::string to_string(ErrorType type)
Convert an ErrorType to string.