Botan 3.7.1
Crypto and TLS for C&
|
Representation of a Classic McEliece private key. More...
#include <cmce_keys_internal.h>
Public Member Functions | |
constexpr void | _const_time_poison () const |
constexpr void | _const_time_unpoison () const |
const CmceColumnSelection & | c () const |
The column selection pivot vector c as defined in Classic McEliece ISO Section 9.2.11. | |
bool | check_key () const |
Checks the private key for consistency with the first component delta, i.e., recomputes s as a hash of delta and checks equivalence with sk.s, checks the weight of c, and checks the control bits. It also recomputes beta based on delta and recomputes g based on beta, checking that g is equal to the value sk.s. | |
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 CmceKeyGenSeed & | delta () const |
The seed delta that was used to create the private key. | |
const Classic_McEliece_Field_Ordering & | field_ordering () const |
The field ordering alpha. | |
const Classic_McEliece_Minimal_Polynomial & | g () const |
The minimal polynomial g. | |
const Classic_McEliece_Parameters & | params () const |
The Classic McEliece parameters. | |
const CmceRejectionSeed & | s () const |
The seed s for implicit rejection on decryption failure. | |
secure_vector< uint8_t > | serialize () const |
Serializes the Classic McEliece private key as defined in Classic McEliece ISO Section 9.2.12. | |
Static Public Member Functions | |
static Classic_McEliece_PrivateKeyInternal | from_bytes (const Classic_McEliece_Parameters ¶ms, std::span< const uint8_t > sk_bytes) |
Parses a Classic McEliece private key from a byte sequence. | |
Representation of a Classic McEliece private key.
This class represents a Classic McEliece private key. It is used internally by the Classic McEliece private key class and contains the following data (see Classic McEliece ISO Section 9.2.12):
Definition at line 89 of file cmce_keys_internal.h.
|
inline |
Construct a Classic McEliece private key.
params | The Classic McEliece parameters |
delta | The seed delta |
c | The column selection pivot vector c |
g | The minimal polynomial g |
alpha | The field ordering alpha |
s | The seed s for implicit rejection |
Definition at line 101 of file cmce_keys_internal.h.
Referenced by from_bytes().
|
inlineconstexpr |
Definition at line 173 of file cmce_keys_internal.h.
|
inlineconstexpr |
Definition at line 175 of file cmce_keys_internal.h.
|
inline |
The column selection pivot vector c as defined in Classic McEliece ISO Section 9.2.11.
Definition at line 141 of file cmce_keys_internal.h.
Referenced by check_key(), and from_bytes().
bool Botan::Classic_McEliece_PrivateKeyInternal::check_key | ( | ) | const |
Checks the private key for consistency with the first component delta, i.e., recomputes s as a hash of delta and checks equivalence with sk.s, checks the weight of c, and checks the control bits. It also recomputes beta based on delta and recomputes g based on beta, checking that g is equal to the value sk.s.
See NIST Impl. guide 6.3 Double-Checks on Private Keys.
Definition at line 100 of file cmce_keys_internal.cpp.
References c(), Botan::CT::Mask< T >::cleared(), Botan::Classic_McEliece_Polynomial::coef_at(), Botan::Classic_McEliece_Polynomial_Ring::compute_minimal_polynomial(), Botan::Classic_McEliece_Field_Ordering::create_field_ordering(), Botan::Classic_McEliece_Polynomial::degree(), Botan::GF_Mask::elem_mask(), Botan::CT::Mask< T >::expand(), field_ordering(), g(), Botan::CT::is_equal(), Botan::CT::Mask< T >::is_equal(), Botan::GF_Mask::is_equal(), Botan::Classic_McEliece_Parameters::n(), Botan::Classic_McEliece_Parameters::poly_ring(), Botan::Classic_McEliece_Parameters::prg(), Botan::Classic_McEliece_Parameters::q(), s(), Botan::Classic_McEliece_Parameters::sigma1(), Botan::Classic_McEliece_Parameters::sigma2(), and Botan::Classic_McEliece_Parameters::t().
|
inline |
The seed delta that was used to create the private key.
Definition at line 136 of file cmce_keys_internal.h.
Referenced by from_bytes().
|
inline |
The field ordering alpha.
Definition at line 151 of file cmce_keys_internal.h.
Referenced by check_key(), Botan::Classic_McEliece_PublicKeyInternal::create_from_private_key(), and from_bytes().
|
static |
Parses a Classic McEliece private key from a byte sequence.
It also creates the field ordering from the control bits in sk_bytes
.
params | The Classic McEliece parameters |
sk_bytes | The secret key byte sequence |
Definition at line 65 of file cmce_keys_internal.cpp.
References BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, c(), Classic_McEliece_PrivateKeyInternal(), Botan::BufferSlicer::copy(), Botan::Classic_McEliece_Field_Ordering::create_from_control_bits(), delta(), Botan::BufferSlicer::empty(), field_ordering(), Botan::Classic_McEliece_Minimal_Polynomial::from_bytes(), g(), params(), Botan::Classic_McEliece_Parameters::poly_f(), s(), Botan::Classic_McEliece_Parameters::seed_len(), Botan::Classic_McEliece_Parameters::sk_alpha_control_bytes(), Botan::Classic_McEliece_Parameters::sk_c_bytes(), Botan::Classic_McEliece_Parameters::sk_poly_g_bytes(), Botan::Classic_McEliece_Parameters::sk_s_bytes(), Botan::Classic_McEliece_Parameters::sk_size_bytes(), and Botan::BufferSlicer::take().
Referenced by Botan::Classic_McEliece_PrivateKey::Classic_McEliece_PrivateKey().
|
inline |
The minimal polynomial g.
Definition at line 146 of file cmce_keys_internal.h.
Referenced by check_key(), Botan::Classic_McEliece_PublicKeyInternal::create_from_private_key(), and from_bytes().
|
inline |
The Classic McEliece parameters.
Definition at line 161 of file cmce_keys_internal.h.
Referenced by Botan::Classic_McEliece_PublicKeyInternal::create_from_private_key(), and from_bytes().
|
inline |
The seed s for implicit rejection on decryption failure.
Definition at line 156 of file cmce_keys_internal.h.
Referenced by check_key(), and from_bytes().
secure_vector< uint8_t > Botan::Classic_McEliece_PrivateKeyInternal::serialize | ( | ) | const |
Serializes the Classic McEliece private key as defined in Classic McEliece ISO Section 9.2.12.
Definition at line 82 of file cmce_keys_internal.cpp.
References Botan::Classic_McEliece_Field_Ordering::alphas_control_bits(), BOTAN_ASSERT, Botan::concat(), Botan::Classic_McEliece_Field_Ordering::create_from_control_bits(), Botan::detail::Strong_Base< T >::get(), Botan::Classic_McEliece_Minimal_Polynomial::serialize(), and Botan::bitvector_base< AllocatorT >::to_bytes().