Botan 3.7.1
Crypto and TLS for C&
|
Representation of the binary Classic McEliece matrix H, with H = (I_mt | T). More...
#include <cmce_matrix.h>
Public Member Functions | |
constexpr void | _const_time_unpoison () const |
const std::vector< uint8_t > & | bytes () const |
The bytes of the submatrix T, with H=(I_mt, T) as defined in Classic McEliece ISO Section 9.2.7. | |
Classic_McEliece_Matrix (const Classic_McEliece_Parameters ¶ms, std::vector< uint8_t > mat_bytes) | |
Create a Classic_McEliece_Matrix from bytes. | |
CmceCodeWord | mul (const Classic_McEliece_Parameters ¶ms, const CmceErrorVector &e) const |
Multiply the Classic McEliece matrix H with a bitvector e. | |
Static Public Member Functions | |
static std::optional< std::pair< Classic_McEliece_Matrix, CmceColumnSelection > > | create_matrix (const Classic_McEliece_Parameters ¶ms, const Classic_McEliece_Field_Ordering &field_ordering, const Classic_McEliece_Minimal_Polynomial &g) |
Create the matrix H for a Classic McEliece instance given its parameters, field ordering and minimal polynomial. | |
static std::optional< std::pair< Classic_McEliece_Matrix, CmceColumnSelection > > | create_matrix_and_apply_pivots (const Classic_McEliece_Parameters ¶ms, Classic_McEliece_Field_Ordering &field_ordering, const Classic_McEliece_Minimal_Polynomial &g) |
Create the matrix H for a Classic McEliece instance given its parameters, field ordering and minimal polynomial. | |
Representation of the binary Classic McEliece matrix H, with H = (I_mt | T).
Only the bytes of the submatrix T are stored.
Definition at line 26 of file cmce_matrix.h.
|
inline |
Create a Classic_McEliece_Matrix from bytes.
mat_bytes | The bytes of the submatrix T as defined in Classic McEliece ISO Section 9.2.7. |
Definition at line 84 of file cmce_matrix.h.
References BOTAN_ARG_CHECK, BOTAN_ASSERT_NOMSG, Botan::Classic_McEliece_Parameters::pk_no_cols(), Botan::Classic_McEliece_Parameters::pk_no_rows(), Botan::Classic_McEliece_Parameters::pk_row_size_bytes(), and Botan::Classic_McEliece_Parameters::pk_size_bytes().
Referenced by create_matrix().
|
inlineconstexpr |
Definition at line 108 of file cmce_matrix.h.
|
inline |
The bytes of the submatrix T, with H=(I_mt, T) as defined in Classic McEliece ISO Section 9.2.7.
Definition at line 77 of file cmce_matrix.h.
|
static |
Create the matrix H for a Classic McEliece instance given its parameters, field ordering and minimal polynomial.
Output is a pair of the matrix and the pivot vector c that was used to create it in the semi-systematic form as described in Classic McEliece ISO Section 9.2.11.
The update of alpha values as per Classic McEliece ISO Section 7.2.3 Step 5 is not performed by this method because it is only used for public key loading where the values are already permuted and field_ordering cannot be altered.
params | Classic McEliece parameters |
field_ordering | Field ordering |
g | Minimal polynomial |
Definition at line 243 of file cmce_matrix.cpp.
References Classic_McEliece_Matrix(), and Botan::CT::unpoison().
Referenced by Botan::Classic_McEliece_PublicKeyInternal::create_from_private_key(), and create_matrix_and_apply_pivots().
|
static |
Create the matrix H for a Classic McEliece instance given its parameters, field ordering and minimal polynomial.
Output is a pair of the matrix and the pivot vector c that was used to create it in the semi-systematic form as described in Classic McEliece ISO Section 9.2.11.
This method directly updates the field ordering values as described in Classic McEliece ISO Section 7.2.3 Step 5 (for f parameter sets).
params | Classic McEliece parameters |
field_ordering | Field ordering (will be updated) |
g | Minimal polynomial |
Definition at line 261 of file cmce_matrix.cpp.
References create_matrix(), Botan::Classic_McEliece_Parameters::is_f(), Botan::Classic_McEliece_Field_Ordering::permute_with_pivots(), and Botan::CT::unpoison().
CmceCodeWord Botan::Classic_McEliece_Matrix::mul | ( | const Classic_McEliece_Parameters & | params, |
const CmceErrorVector & | e ) const |
Multiply the Classic McEliece matrix H with a bitvector e.
params | Classic McEliece parameters |
e | The bitvector e |
Definition at line 281 of file cmce_matrix.cpp.
References BOTAN_ASSERT_NOMSG, Botan::Classic_McEliece_Parameters::n(), Botan::Classic_McEliece_Parameters::pk_no_rows(), Botan::Classic_McEliece_Parameters::pk_row_size_bytes(), and Botan::detail::Strong_Adapter< T >::subvector().