Botan 3.4.0
Crypto and TLS for C&
|
#include <frodo_matrix.h>
Public Types | |
using | Dimensions = std::tuple<size_t, size_t> |
Public Member Functions | |
CT::Mask< uint8_t > | constant_time_compare (const FrodoMatrix &other) const |
FrodoPlaintext | decode (const FrodoKEMConstants &constants) const |
Dimensions | dimensions () const |
size_t | element_count () const |
uint16_t | elements_at (size_t i) const |
FrodoMatrix (Dimensions dims) | |
FrodoPackedMatrix | pack (const FrodoKEMConstants &constants) const |
void | pack (const FrodoKEMConstants &constants, StrongSpan< FrodoPackedMatrix > out) const |
size_t | packed_size (const FrodoKEMConstants &constants) const |
void | reduce (const FrodoKEMConstants &constants) |
FrodoSerializedMatrix | serialize () const |
Static Public Attributes | |
static std::function< FrodoMatrix(const Dimensions &dimensions) | make_sample_generator )(const FrodoKEMConstants &constants, Botan::XOF &shake) |
Definition at line 27 of file frodo_matrix.h.
using Botan::FrodoMatrix::Dimensions = std::tuple<size_t, size_t> |
Definition at line 29 of file frodo_matrix.h.
|
explicit |
Definition at line 107 of file frodo_matrix.cpp.
Referenced by add(), deserialize(), encode(), mul_add_as_plus_e(), mul_add_sa_plus_e(), mul_add_sb_plus_e(), mul_bs(), sample(), sub(), and unpack().
|
static |
Definition at line 279 of file frodo_matrix.cpp.
References BOTAN_ASSERT_NOMSG, dimensions(), elements_at(), FrodoMatrix(), and Botan::FrodoKEMConstants::n_bar().
CT::Mask< uint8_t > Botan::FrodoMatrix::constant_time_compare | ( | const FrodoMatrix & | other | ) | const |
Definition at line 309 of file frodo_matrix.cpp.
References BOTAN_ASSERT_NOMSG, dimensions(), and Botan::CT::is_equal().
FrodoPlaintext Botan::FrodoMatrix::decode | ( | const FrodoKEMConstants & | constants | ) | const |
Definition at line 396 of file frodo_matrix.cpp.
References Botan::FrodoKEMConstants::b(), Botan::FrodoKEMConstants::d(), and Botan::FrodoKEMConstants::n_bar().
|
static |
Definition at line 478 of file frodo_matrix.cpp.
References BOTAN_ASSERT_NOMSG, Botan::StrongSpan< T >::data(), dimensions(), FrodoMatrix(), and Botan::StrongSpan< T >::size().
Referenced by Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey().
|
inline |
Definition at line 122 of file frodo_matrix.h.
Referenced by add(), constant_time_compare(), deserialize(), encode(), mul_add_as_plus_e(), mul_add_sa_plus_e(), mul_add_sb_plus_e(), mul_bs(), sample(), sub(), and unpack().
|
inline |
Definition at line 126 of file frodo_matrix.h.
Referenced by pack(), and packed_size().
|
inline |
Definition at line 33 of file frodo_matrix.h.
Referenced by add(), mul_add_as_plus_e(), mul_add_sa_plus_e(), mul_add_sb_plus_e(), mul_bs(), and sub().
|
static |
Definition at line 256 of file frodo_matrix.cpp.
References Botan::FrodoKEMConstants::b(), BOTAN_ASSERT_NOMSG, Botan::FrodoKEMConstants::d(), dimensions(), FrodoMatrix(), Botan::FrodoKEMConstants::n_bar(), and Botan::StrongSpan< T >::size().
|
static |
Definition at line 110 of file frodo_matrix.cpp.
References BOTAN_ASSERT, dimensions(), elements_at(), FrodoMatrix(), Botan::FrodoKEMConstants::n(), and Botan::FrodoKEMConstants::n_bar().
Referenced by Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey().
|
static |
Definition at line 170 of file frodo_matrix.cpp.
References BOTAN_ASSERT, dimensions(), elements_at(), FrodoMatrix(), Botan::FrodoKEMConstants::n(), and Botan::FrodoKEMConstants::n_bar().
|
static |
Definition at line 228 of file frodo_matrix.cpp.
References BOTAN_ASSERT, dimensions(), elements_at(), FrodoMatrix(), Botan::FrodoKEMConstants::n(), and Botan::FrodoKEMConstants::n_bar().
|
static |
Definition at line 317 of file frodo_matrix.cpp.
References dimensions(), elements_at(), FrodoMatrix(), Botan::FrodoKEMConstants::n(), and Botan::FrodoKEMConstants::n_bar().
|
inline |
Definition at line 42 of file frodo_matrix.h.
References pack(), and packed_size().
Referenced by pack().
void Botan::FrodoMatrix::pack | ( | const FrodoKEMConstants & | constants, |
StrongSpan< FrodoPackedMatrix > | out ) const |
Definition at line 340 of file frodo_matrix.cpp.
References BOTAN_ASSERT_NOMSG, Botan::FrodoKEMConstants::d(), element_count(), packed_size(), and Botan::StrongSpan< T >::size().
|
inline |
Definition at line 35 of file frodo_matrix.h.
References BOTAN_ASSERT_NOMSG, Botan::FrodoKEMConstants::d(), and element_count().
void Botan::FrodoMatrix::reduce | ( | const FrodoKEMConstants & | constants | ) |
Definition at line 485 of file frodo_matrix.cpp.
References Botan::FrodoKEMConstants::d().
|
static |
Definition at line 70 of file frodo_matrix.cpp.
References BOTAN_ASSERT_NOMSG, Botan::FrodoKEMConstants::cdf_table_at(), Botan::FrodoKEMConstants::cdf_table_len(), Botan::StrongSpan< T >::data(), dimensions(), FrodoMatrix(), Botan::CT::Mask< T >::is_lt(), sample(), and Botan::StrongSpan< T >::size().
Referenced by sample().
FrodoSerializedMatrix Botan::FrodoMatrix::serialize | ( | ) | const |
Definition at line 386 of file frodo_matrix.cpp.
References Botan::detail::Strong_Adapter< T >::data(), and Botan::store_le().
|
static |
Definition at line 294 of file frodo_matrix.cpp.
References BOTAN_ASSERT_NOMSG, dimensions(), elements_at(), FrodoMatrix(), and Botan::FrodoKEMConstants::n_bar().
|
static |
Definition at line 421 of file frodo_matrix.cpp.
References BOTAN_ASSERT_NOMSG, Botan::ceil_tobytes(), Botan::FrodoKEMConstants::d(), dimensions(), FrodoMatrix(), and Botan::StrongSpan< T >::size().
Referenced by Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey(), and Botan::FrodoKEM_PublicKey::FrodoKEM_PublicKey().
|
static |
Referenced by Botan::FrodoKEM_PrivateKey::FrodoKEM_PrivateKey().