Botan 3.7.1
Crypto and TLS for C&
|
#include <cmce_parameters.h>
Public Member Functions | |
size_t | ciphertext_size () const |
The byte size of the ciphertext. | |
size_t | encode_out_size () const |
The output byte size of the encoding algorithm. See ISO 7.3. | |
size_t | estimated_strength () const |
The estimated bit security strength of the Classic McEliece instance. | |
Classic_McEliece_GF | gf (CmceGfElem elem) const |
Create a GF(q) element using the modulus for the current instance. | |
std::unique_ptr< HashFunction > | hash_func () const |
Create an instance of the hash function Hash(x) used in Classic McEliece's Decaps and Encaps algorithms. | |
bool | is_f () const |
bool | is_pc () const |
size_t | m () const |
The degree of the Classic McEliece instance's underlying Galois Field, i.e. GF(q) = GF(2^m). | |
size_t | n () const |
The code length of the Classic McEliece instance. | |
OID | object_identifier () const |
The OID for the Classic McEliece instance. | |
Classic_McEliece_Parameter_Set | parameter_set () const |
The parameter set for this Classic McEliece instance. | |
size_t | pk_no_cols () const |
The number of columns in the public key's matrix. | |
size_t | pk_no_rows () const |
The number of rows in the public key's matrix. | |
size_t | pk_row_size_bytes () const |
The number of bytes for each row in the public key's matrix. | |
size_t | pk_size_bytes () const |
The number of bytes for the public key. | |
CmceGfMod | poly_f () const |
The monic irreducible polynomial f(z) of degree m over GF(2). Used for modular reduction in GF(2^m). | |
const Classic_McEliece_Polynomial_Ring & | poly_ring () const |
The underlying polynomial ring. | |
std::unique_ptr< XOF > | prg (std::span< const uint8_t > seed) const |
Create a seeded XOF object representing Classic McEliece's PRG. See Classic McEliece ISO 9.1. | |
size_t | q () const |
The field size of the Classic McEliece instance's underlying Galois Field, i.e. GF(q) is the underlying field. | |
size_t | sk_alpha_control_bytes () const |
The length of the byte representation of the field ordering's control bits. See ISO 9.2.12. | |
size_t | sk_poly_g_bytes () const |
The length of the byte representation of the minimal polynomial g. See ISO 9.2.12. | |
size_t | sk_s_bytes () const |
The byte length of the seed s. s is used for implicit rejection. See ISO 9.2.12. | |
size_t | sk_size_bytes () const |
The byte length of the secret key sk. See ISO 9.2.12. | |
size_t | t () const |
The weight of the error vector e. | |
size_t | tau () const |
Constant tau for fixed-weight vector generation. (see Classic McEliece ISO 8.4) | |
Static Public Member Functions | |
static Classic_McEliece_Parameters | create (Classic_McEliece_Parameter_Set set) |
Create Classic McEliece parameters from a parameter set. | |
static Classic_McEliece_Parameters | create (const OID &oid) |
Create Classic McEliece parameters from an OID. | |
static Classic_McEliece_Parameters | create (std::string_view name) |
Create Classic McEliece parameters from a parameter set name. | |
static constexpr size_t | ell () |
Bit output length of the hash function H. | |
static constexpr size_t | hash_out_bytes () |
The byte size of the hash output. | |
static constexpr size_t | mu () |
Constant mu for semi-systematic matrix creation. (see Classic McEliece ISO 7.2.3) | |
static constexpr size_t | nu () |
Constant nu for semi-systematic matrix creation. (see Classic McEliece ISO 7.2.3) | |
static constexpr size_t | seed_len () |
The byte length of the seed delta. See ISO 9.2.12. | |
static constexpr size_t | sigma1 () |
The number of bits each GF element is encoded with. | |
static constexpr size_t | sigma2 () |
Constant for field-ordering generation. (see Classic McEliece ISO 8.2) | |
static constexpr size_t | sk_c_bytes () |
The byte length of the column selection c. See ISO 9.2.12. | |
Container for all Classic McEliece parameters.
Definition at line 29 of file cmce_parameters.h.
|
inline |
The byte size of the ciphertext.
Definition at line 229 of file cmce_parameters.h.
|
static |
Create Classic McEliece parameters from a parameter set.
Definition at line 95 of file cmce_parameters.cpp.
References BOTAN_ASSERT_UNREACHABLE, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf, Botan::Classic_McEliece_Parameter_Set::code(), and poly_ring().
Referenced by Botan::Classic_McEliece_PrivateKey::Classic_McEliece_PrivateKey(), Botan::Classic_McEliece_PrivateKey::Classic_McEliece_PrivateKey(), Botan::Classic_McEliece_PublicKey::Classic_McEliece_PublicKey(), create(), and create().
|
static |
Create Classic McEliece parameters from an OID.
Definition at line 132 of file cmce_parameters.cpp.
References create(), and Botan::Classic_McEliece_Parameter_Set::from_oid().
|
static |
Create Classic McEliece parameters from a parameter set name.
Definition at line 128 of file cmce_parameters.cpp.
References create(), Botan::Classic_McEliece_Parameter_Set::from_string(), and name.
|
inlinestaticconstexpr |
Bit output length of the hash function H.
Definition at line 110 of file cmce_parameters.h.
|
inline |
The output byte size of the encoding algorithm. See ISO 7.3.
Definition at line 217 of file cmce_parameters.h.
size_t Botan::Classic_McEliece_Parameters::estimated_strength | ( | ) | const |
The estimated bit security strength of the Classic McEliece instance.
Reference: Classic McEliece NIST Round 4 submission, Guide for security reviewers
Definition at line 148 of file cmce_parameters.cpp.
References BOTAN_ASSERT_UNREACHABLE, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_348864f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_460896f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pc, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6688128pcf, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pc, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_6960119pcf, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128f, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pc, Botan::Classic_McEliece_Parameter_Set::ClassicMcEliece_8192128pcf, and Botan::Classic_McEliece_Parameter_Set::code().
|
inline |
Create a GF(q) element using the modulus for the current instance.
elem | The GF(q) element value. |
Definition at line 265 of file cmce_parameters.h.
|
inline |
Create an instance of the hash function Hash(x) used in Classic McEliece's Decaps and Encaps algorithms.
Definition at line 257 of file cmce_parameters.h.
|
inlinestaticconstexpr |
The byte size of the hash output.
This is also the size of the shared key K that is a hash output.
Definition at line 224 of file cmce_parameters.h.
|
inline |
@returns true iff the instance is a fast (F) instance, i.e. if the semi-systematic matrix creation is used.
`
Definition at line 72 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Matrix::create_matrix_and_apply_pivots().
|
inline |
Definition at line 59 of file cmce_parameters.h.
|
inline |
The degree of the Classic McEliece instance's underlying Galois Field, i.e. GF(q) = GF(2^m).
Definition at line 86 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Field_Ordering::create_from_control_bits().
|
inlinestaticconstexpr |
Constant mu for semi-systematic matrix creation. (see Classic McEliece ISO 7.2.3)
Definition at line 125 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Field_Ordering::permute_with_pivots().
|
inline |
The code length of the Classic McEliece instance.
E.g. the Classic McEliece matrix H is of size m*t x n, the encoded error vector is, therefore, of size n.
Definition at line 100 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key(), and Botan::Classic_McEliece_Matrix::mul().
|
inlinestaticconstexpr |
Constant nu for semi-systematic matrix creation. (see Classic McEliece ISO 7.2.3)
Definition at line 130 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Field_Ordering::permute_with_pivots().
OID Botan::Classic_McEliece_Parameters::object_identifier | ( | ) | const |
The OID for the Classic McEliece instance.
Definition at line 136 of file cmce_parameters.cpp.
References Botan::OID::from_string(), and Botan::Classic_McEliece_Parameter_Set::to_string().
|
inline |
The parameter set for this Classic McEliece instance.
Definition at line 49 of file cmce_parameters.h.
|
inline |
The number of columns in the public key's matrix.
Note that this is only the column number of the submatrix T (with H = (I_mt | T)), which is stored in the public key. The column number of the whole matrix H is n. This constant is also denoted as k in the spec.
Definition at line 200 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Matrix::Classic_McEliece_Matrix().
|
inline |
The number of rows in the public key's matrix.
Definition at line 191 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Matrix::Classic_McEliece_Matrix(), Botan::Classic_McEliece_Matrix::mul(), and Botan::Classic_McEliece_Field_Ordering::permute_with_pivots().
|
inline |
The number of bytes for each row in the public key's matrix.
Definition at line 205 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Matrix::Classic_McEliece_Matrix(), and Botan::Classic_McEliece_Matrix::mul().
|
inline |
The number of bytes for the public key.
Equal to the byte size of the CMCE matrix.
Definition at line 212 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Matrix::Classic_McEliece_Matrix().
|
inline |
The monic irreducible polynomial f(z) of degree m over GF(2). Used for modular reduction in GF(2^m).
Definition at line 146 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_Field_Ordering::create_field_ordering(), Botan::Classic_McEliece_Field_Ordering::create_from_control_bits(), and Botan::Classic_McEliece_PrivateKeyInternal::from_bytes().
|
inline |
The underlying polynomial ring.
Definition at line 241 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key(), and create().
std::unique_ptr< XOF > Botan::Classic_McEliece_Parameters::prg | ( | std::span< const uint8_t > | seed | ) | const |
Create a seeded XOF object representing Classic McEliece's PRG. See Classic McEliece ISO 9.1.
seed | The seed used for the XOF. |
Definition at line 179 of file cmce_parameters.cpp.
References BOTAN_ASSERT_EQUAL, and Botan::XOF::create_or_throw().
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key().
|
inline |
The field size of the Classic McEliece instance's underlying Galois Field, i.e. GF(q) is the underlying field.
Definition at line 92 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key(), and Botan::Classic_McEliece_Field_Ordering::create_field_ordering().
|
inlinestaticconstexpr |
The byte length of the seed delta. See ISO 9.2.12.
Definition at line 158 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::from_bytes(), and Botan::Classic_McEliece_KeyPair_Internal::generate().
|
inlinestaticconstexpr |
The number of bits each GF element is encoded with.
Definition at line 115 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key().
|
inlinestaticconstexpr |
Constant for field-ordering generation. (see Classic McEliece ISO 8.2)
Definition at line 120 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key(), and Botan::Classic_McEliece_Field_Ordering::create_field_ordering().
|
inline |
The length of the byte representation of the field ordering's control bits. See ISO 9.2.12.
Definition at line 173 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::from_bytes().
|
inlinestaticconstexpr |
The byte length of the column selection c. See ISO 9.2.12.
Definition at line 163 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::from_bytes().
|
inline |
The length of the byte representation of the minimal polynomial g. See ISO 9.2.12.
Definition at line 168 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::from_bytes().
|
inline |
The byte length of the seed s. s is used for implicit rejection. See ISO 9.2.12.
Definition at line 178 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::from_bytes().
|
inline |
The byte length of the secret key sk. See ISO 9.2.12.
Definition at line 183 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::from_bytes().
|
inline |
The weight of the error vector e.
Definition at line 105 of file cmce_parameters.h.
Referenced by Botan::Classic_McEliece_PrivateKeyInternal::check_key().
|
inline |
Constant tau for fixed-weight vector generation. (see Classic McEliece ISO 8.4)
Definition at line 135 of file cmce_parameters.h.
References Botan::floor_log2().