12#ifndef BOTAN_MCELIECE_KEY_H_
13#define BOTAN_MCELIECE_KEY_H_
15#include <botan/pk_keys.h>
29 m_public_matrix(pub_matrix),
31 m_code_length(the_code_length){}
39 std::string
algo_name()
const override {
return "McEliece"; }
43 size_t key_length()
const override;
44 size_t estimated_strength()
const override;
46 std::vector<uint8_t> public_key_bits()
const override;
51 size_t get_t()
const {
return m_t; }
53 size_t get_message_word_bit_length()
const;
61 return (op == PublicKeyOperation::KeyEncapsulation);
64 std::unique_ptr<PK_Ops::KEM_Encryption>
65 create_kem_encryption_op(std::string_view params,
66 std::string_view provider)
const override;
101 std::vector<uint32_t>
const& parity_check_matrix_coeffs,
102 std::vector<polyn_gf2m>
const& square_root_matrix,
103 std::vector<gf2m>
const& inverse_support,
104 std::vector<uint8_t>
const& public_matrix );
117 std::vector<uint32_t> const& get_H_coeffs()
const {
return m_coeffs; }
118 std::vector<gf2m>
const&
get_Linv()
const {
return m_Linv; }
119 std::vector<polyn_gf2m>
const&
get_sqrtmod()
const {
return m_sqrtmod; }
127 std::unique_ptr<Public_Key> public_key()
const override;
133 std::unique_ptr<PK_Ops::KEM_Decryption>
135 std::string_view params,
136 std::string_view provider)
const override;
138 std::vector<polyn_gf2m> m_g;
139 std::vector<polyn_gf2m> m_sqrtmod;
140 std::vector<gf2m> m_Linv;
141 std::vector<uint32_t> m_coeffs;
143 size_t m_codimension;
std::vector< gf2m > const & get_Linv() const
size_t get_codimension() const
size_t get_dimension() const
McEliece_PrivateKey(const McEliece_PrivateKey &)
McEliece_PrivateKey(McEliece_PrivateKey &&) noexcept
std::vector< polyn_gf2m > const & get_sqrtmod() 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
virtual ~McEliece_PublicKey()=default
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 & 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