12#ifndef BOTAN_MCELIECE_KEY_H_
13#define BOTAN_MCELIECE_KEY_H_
15#include <botan/pk_keys.h>
28 m_public_matrix(pub_matrix), m_t(t), m_code_length(the_code_length) {}
36 std::string
algo_name()
const override {
return "McEliece"; }
40 size_t key_length()
const override;
41 size_t estimated_strength()
const override;
43 std::vector<uint8_t> public_key_bits()
const override;
47 size_t get_t()
const {
return m_t; }
51 size_t get_message_word_bit_length()
const;
62 return (op == PublicKeyOperation::KeyEncapsulation);
65 std::unique_ptr<PK_Ops::KEM_Encryption> create_kem_encryption_op(std::string_view params,
66 std::string_view provider)
const override;
99 const std::vector<uint32_t>& parity_check_matrix_coeffs,
100 const std::vector<polyn_gf2m>& square_root_matrix,
101 const std::vector<gf2m>& inverse_support,
102 const std::vector<uint8_t>& public_matrix);
116 const std::vector<uint32_t>& get_H_coeffs()
const {
return m_coeffs; }
118 const std::vector<gf2m>&
get_Linv()
const {
return m_Linv; }
120 const std::vector<polyn_gf2m>&
get_sqrtmod()
const {
return m_sqrtmod; }
128 std::unique_ptr<Public_Key> public_key()
const override;
135 std::string_view params,
136 std::string_view provider)
const override;
139 std::vector<polyn_gf2m> m_g;
140 std::vector<polyn_gf2m> m_sqrtmod;
141 std::vector<gf2m> m_Linv;
142 std::vector<uint32_t> m_coeffs;
144 size_t m_codimension;
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
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)
size_t mceliece_work_factor(size_t n, size_t t)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
std::vector< T, secure_allocator< T > > secure_vector