12#ifndef BOTAN_MCELIECE_KEY_H_
13#define BOTAN_MCELIECE_KEY_H_
15#include <botan/pk_keys.h>
30 m_public_matrix(pub_matrix), m_t(t), m_code_length(the_code_length) {}
38 std::string
algo_name()
const override {
return "McEliece"; }
50 size_t get_t()
const {
return m_t; }
54 size_t get_message_word_bit_length()
const;
65 return (op == PublicKeyOperation::KeyEncapsulation);
69 std::string_view provider)
const override;
102 const std::vector<uint32_t>& parity_check_matrix_coeffs,
103 const std::vector<polyn_gf2m>& square_root_matrix,
104 const std::vector<gf2m>& inverse_support,
105 const std::vector<uint8_t>& public_matrix);
119 const std::vector<uint32_t>& get_H_coeffs()
const {
return m_coeffs; }
121 const std::vector<gf2m>&
get_Linv()
const {
return m_Linv; }
123 const std::vector<polyn_gf2m>&
get_sqrtmod()
const {
return m_sqrtmod; }
131 std::unique_ptr<Public_Key> public_key()
const override;
138 std::string_view params,
139 std::string_view provider)
const override;
142 std::vector<polyn_gf2m> m_g;
143 std::vector<polyn_gf2m> m_sqrtmod;
144 std::vector<gf2m> m_Linv;
145 std::vector<uint32_t> m_coeffs;
147 size_t m_codimension;
157BOTAN_PUBLIC_API(2, 0) size_t mceliece_work_factor(
size_t code_size,
size_t t);
virtual std::unique_ptr< Private_Key > generate_another(RandomNumberGenerator &rng) const =0
virtual size_t estimated_strength() const =0
const std::vector< polyn_gf2m > & get_sqrtmod() const
size_t get_codimension() const
size_t get_dimension() const
McEliece_PrivateKey(const McEliece_PrivateKey &)
McEliece_PrivateKey(McEliece_PrivateKey &&) noexcept
~McEliece_PrivateKey() override
const std::vector< gf2m > & get_Linv() const
McEliece_PrivateKey & operator=(const McEliece_PrivateKey &)
bool operator!=(const McEliece_PrivateKey &other) const
McEliece_PublicKey(const std::vector< uint8_t > &pub_matrix, size_t t, size_t the_code_length)
bool check_key(RandomNumberGenerator &, bool) const override
std::string algo_name() const override
bool supports_operation(PublicKeyOperation op) const override
McEliece_PublicKey(const McEliece_PublicKey &other)=default
std::vector< uint8_t > m_public_matrix
const std::vector< uint8_t > & get_public_matrix() const
bool operator!=(const McEliece_PublicKey &other) const
size_t get_code_length() const
~McEliece_PublicKey() override=default
McEliece_PublicKey & operator=(const McEliece_PublicKey &other)=default
virtual AlgorithmIdentifier algorithm_identifier() const =0
virtual std::vector< uint8_t > public_key_bits() const =0
virtual std::vector< uint8_t > raw_public_key_bits() const =0
virtual std::unique_ptr< PK_Ops::KEM_Encryption > create_kem_encryption_op(std::string_view params, std::string_view provider) const
virtual size_t key_length() const =0
int(* final)(unsigned char *, CTX *)
#define BOTAN_DEPRECATED_HEADER(hdr)
#define BOTAN_DIAGNOSTIC_POP
#define BOTAN_DIAGNOSTIC_PUSH
#define BOTAN_DIAGNOSTIC_IGNORE_INHERITED_VIA_DOMINANCE
#define BOTAN_PUBLIC_API(maj, min)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
std::vector< T, secure_allocator< T > > secure_vector