Botan 3.5.0
Crypto and TLS for C&
|
#include <kyber_structures.h>
Public Member Functions | |
void | csubq () |
void | invntt_tomont () |
void | ntt () |
PolynomialVector & | operator+= (const PolynomialVector &other) |
Polynomial & | operator[] (size_t idx) |
PolynomialVector ()=delete | |
PolynomialVector (const size_t k) | |
void | reduce () |
template<concepts::resizable_byte_buffer T = secure_vector<uint8_t>> | |
T | to_bytes () |
Static Public Member Functions | |
static PolynomialVector | from_bytes (std::span< const uint8_t > a, const KyberConstants &mode) |
static PolynomialVector | getnoise_eta1 (KyberSigmaOrEncryptionRandomness seed, uint8_t nonce, const KyberConstants &mode) |
static PolynomialVector | getnoise_eta2 (StrongSpan< const KyberEncryptionRandomness > seed, uint8_t nonce, const KyberConstants &mode) |
static Polynomial | pointwise_acc_montgomery (const PolynomialVector &a, const PolynomialVector &b) |
Definition at line 391 of file kyber_structures.h.
|
delete |
|
inlineexplicit |
Definition at line 395 of file kyber_structures.h.
|
inline |
Applies conditional subtraction of q to each coefficient of each element of the vector of polynomials.
Definition at line 465 of file kyber_structures.h.
|
inlinestatic |
Definition at line 398 of file kyber_structures.h.
References BOTAN_ASSERT, BOTAN_ASSERT_NOMSG, Botan::BufferSlicer::empty(), Botan::Polynomial::from_bytes(), Botan::KyberConstants::k(), Botan::KyberConstants::kSerializedPolynomialByteLength, Botan::KyberConstants::polynomial_vector_byte_length(), and Botan::BufferSlicer::take().
Referenced by Botan::Kyber_PrivateKey::Kyber_PrivateKey().
|
inlinestatic |
Definition at line 438 of file kyber_structures.h.
References Botan::Polynomial::getnoise_eta1(), and Botan::KyberConstants::k().
Referenced by Botan::Kyber_PublicKeyInternal::indcpa_encrypt(), and Botan::Kyber_PrivateKey::Kyber_PrivateKey().
|
inlinestatic |
Definition at line 428 of file kyber_structures.h.
References Botan::Polynomial::getnoise_eta2(), and Botan::KyberConstants::k().
Referenced by Botan::Kyber_PublicKeyInternal::indcpa_encrypt().
|
inline |
Apply inverse NTT to all elements of a vector of polynomials and multiply by Montgomery factor 2^16.
Definition at line 494 of file kyber_structures.h.
|
inline |
Apply forward NTT to all elements of a vector of polynomials.
Definition at line 503 of file kyber_structures.h.
|
inline |
Definition at line 471 of file kyber_structures.h.
References BOTAN_ASSERT.
|
inline |
Definition at line 480 of file kyber_structures.h.
|
inlinestatic |
Pointwise multiply elements of a and b, accumulate into r, and multiply by 2^-16.
Definition at line 415 of file kyber_structures.h.
References Botan::Polynomial::basemul_montgomery(), BOTAN_ASSERT, and Botan::Polynomial::reduce().
Referenced by Botan::Kyber_PrivateKeyInternal::indcpa_decrypt(), Botan::Kyber_PublicKeyInternal::indcpa_encrypt(), and Botan::PolynomialMatrix::pointwise_acc_montgomery().
|
inline |
Applies Barrett reduction to each coefficient of each element of a vector of polynomials.
Definition at line 485 of file kyber_structures.h.
|
inline |
Definition at line 449 of file kyber_structures.h.
References BOTAN_ASSERT_NOMSG, Botan::BufferStuffer::full(), Botan::KyberConstants::kSerializedPolynomialByteLength, Botan::BufferStuffer::next(), and T.