12#ifndef BOTAN_KYBER_CONSTANTS_H_
13#define BOTAN_KYBER_CONSTANTS_H_
15#include <botan/kyber.h>
19class Kyber_Symmetric_Primitives;
20class Kyber_Keypair_Codec;
28 static constexpr T N = 256;
31 static constexpr T Q = 3329;
34 static constexpr T F = 3303;
78 uint8_t
k()
const {
return m_k; }
131 uint32_t m_polynomial_vector_bytes;
132 uint32_t m_polynomial_vector_compressed_bytes;
133 uint32_t m_polynomial_compressed_bytes;
134 uint32_t m_private_key_bytes;
136 std::unique_ptr<Kyber_Keypair_Codec> m_keypair_codec;
137 std::unique_ptr<Kyber_Symmetric_Primitives> m_symmetric_primitives;
size_t polynomial_vector_compressed_bytes() const
byte length of an encoded compressed polynomial vector
static constexpr T N
number of coefficients in a polynomial
constexpr KyberEta eta2() const
size_t polynomial_compressed_bytes() const
byte length of an encoded compressed polynomial
static constexpr T Q
modulus
KyberConstants & operator=(const KyberConstants &other)=delete
static constexpr size_t SEED_BYTES
static constexpr T ROOT_OF_UNITY
the primitive 256-th root of unity modulo Q (see FIPS 203 Section 4.3)
size_t public_key_bytes() const
byte length of an encoded public key
KyberConstants & operator=(KyberConstants &&other)=default
static constexpr T F
as specified in FIPS 203 (see Algorithm 10 (NTT^-1), f = 128^-1 mod Q)
static constexpr uint16_t SAMPLE_NTT_POLY_FROM_XOF_BOUND
sampling limit for SampleNTT (in bytes), see FIPS 204, Apx B
KyberConstants(KyberMode mode)
size_t polynomial_vector_bytes() const
byte length of an encoded polynomial vector
constexpr size_t shared_key_bytes() const
byte length of the shared key
size_t private_key_bytes() const
byte length of an encoded private key
size_t ciphertext_bytes() const
byte length of an encoded ciphertext
static constexpr size_t SHARED_KEY_BYTES
static constexpr size_t NTT_Degree
degree of the NTT polynomials
KyberStrength estimated_strength() const
Kyber_Keypair_Codec & keypair_codec() const
KyberConstants(KyberConstants &&other)=default
KyberConstants(const KyberConstants &other)
Kyber_Symmetric_Primitives & symmetric_primitives() const
int16_t T
base data type for most calculations
size_t canonical_parameter_set_identifier() const
static constexpr size_t PUBLIC_KEY_HASH_BYTES
int(* final)(unsigned char *, CTX *)