9#ifndef BOTAN_CMCE_KEYS_INTERNAL_H_
10#define BOTAN_CMCE_KEYS_INTERNAL_H_
12#include <botan/internal/cmce_field_ordering.h>
13#include <botan/internal/cmce_matrix.h>
14#include <botan/internal/cmce_parameters.h>
15#include <botan/internal/cmce_poly.h>
16#include <botan/internal/cmce_types.h>
20class Classic_McEliece_PrivateKeyInternal;
39 m_params(params), m_matrix(std::move(matrix)) {
52 static std::shared_ptr<Classic_McEliece_PublicKeyInternal> create_from_private_key(
58 std::vector<uint8_t>
serialize()
const {
return m_matrix.bytes(); }
108 m_delta(std::move(delta)),
111 m_field_ordering(std::move(alpha)),
124 std::span<const uint8_t> sk_bytes);
171 bool check_key()
const;
173 constexpr void _const_time_poison()
const { CT::poison_all(m_delta, m_c, m_g, m_field_ordering, m_s); }
191 std::shared_ptr<Classic_McEliece_PublicKeyInternal>
public_key;
203 std::pair<std::shared_ptr<Classic_McEliece_PrivateKeyInternal>,
204 std::shared_ptr<Classic_McEliece_PublicKeyInternal>>
206 return {std::move(private_key), std::move(public_key)};
#define BOTAN_ASSERT_NOMSG(expr)
Represents a field ordering for the Classic McEliece cryptosystem.
Representation of the binary Classic McEliece matrix H, with H = (I_mt | T).
Representation of a minimal polynomial in GF(q)[y].
Representation of a Classic McEliece private key.
const CmceRejectionSeed & s() const
The seed s for implicit rejection on decryption failure.
const Classic_McEliece_Field_Ordering & field_ordering() const
The field ordering alpha.
const CmceKeyGenSeed & delta() const
The seed delta that was used to create the private key.
constexpr void _const_time_unpoison() const
const Classic_McEliece_Parameters & params() const
The Classic McEliece parameters.
constexpr void _const_time_poison() const
Classic_McEliece_PrivateKeyInternal(const Classic_McEliece_Parameters ¶ms, CmceKeyGenSeed delta, CmceColumnSelection c, Classic_McEliece_Minimal_Polynomial g, Classic_McEliece_Field_Ordering alpha, CmceRejectionSeed s)
Construct a Classic McEliece private key.
const CmceColumnSelection & c() const
The column selection pivot vector c as defined in Classic McEliece ISO Section 9.2....
const Classic_McEliece_Minimal_Polynomial & g() const
The minimal polynomial g.
Representation of a Classic McEliece public key.
const Classic_McEliece_Parameters & params() const
The Classic McEliece parameters.
const Classic_McEliece_Matrix & matrix() const
The Classic McEliece matrix.
std::vector< uint8_t > serialize() const
Serializes the Classic McEliece public key as defined in Classic McEliece ISO Section 9....
constexpr void _const_time_unpoison() const
Classic_McEliece_PublicKeyInternal(const Classic_McEliece_Parameters ¶ms, Classic_McEliece_Matrix matrix)
Construct a Classic McEliece public key.
std::vector< T, secure_allocator< T > > secure_vector
Representation of a Classic McEliece key pair.
std::shared_ptr< Classic_McEliece_PublicKeyInternal > public_key
std::pair< std::shared_ptr< Classic_McEliece_PrivateKeyInternal >, std::shared_ptr< Classic_McEliece_PublicKeyInternal > > decompose_to_pair() &&
Decompose the key pair into a pair of shared pointers to the private and public key.
std::shared_ptr< Classic_McEliece_PrivateKeyInternal > private_key