12#ifndef BOTAN_DILITHIUM_CONSTANTS_H_
13#define BOTAN_DILITHIUM_CONSTANTS_H_
15#include <botan/dilithium.h>
19class Dilithium_Symmetric_Primitives_Base;
20class Dilithium_Keypair_Codec;
31 static constexpr T N = 256;
34 static constexpr T Q = 8380417;
37 static constexpr T D = 13;
40 static constexpr T F = 8347681;
119 uint8_t
k()
const {
return m_k; }
122 uint8_t
l()
const {
return m_l; }
179 uint32_t m_public_key_hash_bytes;
180 uint32_t m_commitment_hash_full_bytes;
182 uint32_t m_private_key_bytes;
183 uint32_t m_public_key_bytes;
184 uint32_t m_signature_bytes;
185 uint32_t m_serialized_commitment_bytes;
188 std::unique_ptr<Dilithium_Symmetric_Primitives_Base> m_symmetric_primitives;
189 std::unique_ptr<Dilithium_Keypair_Codec> m_keypair_codec;
size_t public_key_bytes() const
byte length of the encoded public key
static constexpr T F
as specified in FIPS 204 (see Algorithm 36 (NTT^-1), f = 256^-1 mod Q)
size_t commitment_hash_full_bytes() const
length of the entire commitment hash 'c~' in bytes (differs between R3 and ML-DSA)
static constexpr T Q
modulus
size_t signature_bytes() const
byte length of the encoded signature
static constexpr uint16_t SAMPLE_NTT_POLY_FROM_XOF_BOUND
DilithiumConstants & operator=(DilithiumConstants &&other)=default
DilithiumGamma1 gamma1() const
coefficient range of the randomly sampled mask 'y'
DilithiumEta eta() const
coefficient range of the private key's polynomial vectors 's1' and 's2'
DilithiumConstants(DilithiumConstants &&other)=default
static constexpr size_t COMMITMENT_HASH_C1_BYTES
static constexpr size_t MESSAGE_HASH_BYTES
uint8_t l() const
dimensions of the expanded matrix A
Dilithium_Symmetric_Primitives_Base & symmetric_primitives() const
static constexpr T D
number of dropped bits from t (see FIPS 204 Section 5)
DilithiumConstants(const DilithiumConstants &other)
static constexpr size_t SEED_RANDOMNESS_BYTES
DilithiumTau tau() const
hamming weight of the polynomial 'c' sampled from the commitment's hash
DilithiumConstants(DilithiumMode dimension)
DilithiumConstants & operator=(const DilithiumConstants &other)=delete
DilithiumMode mode() const
static constexpr uint16_t SAMPLE_IN_BALL_XOF_BOUND
static constexpr size_t SEED_SIGNING_KEY_BYTES
static constexpr size_t OPTIONAL_RANDOMNESS_BYTES
int32_t T
base data type for most calculations
Dilithium_Keypair_Codec & keypair_codec() const
static constexpr T N
number of coefficients in a polynomial
DilithiumBeta beta() const
tau * eta
static constexpr size_t SEED_RHOPRIME_BYTES
DilithiumLambda lambda() const
collision strength of the commitment hash function
size_t canonical_parameter_set_identifier() const
size_t public_key_hash_bytes() const
length of the public key hash 'tr' in bytes (differs between R3 and ML-DSA)
size_t private_key_bytes() const
byte length of the encoded private key
size_t serialized_commitment_bytes() const
byte length of the packed commitment polynomial vector 'w1'
DilithiumOmega omega() const
maximal hamming weight of the hint polynomial vector 'h'
static constexpr size_t NTT_Degree
degree of the NTT polynomials
static constexpr T ROOT_OF_UNITY
the 512-th root of unity modulo Q (see FIPS 204 Section 8.5)
static constexpr uint16_t SIGNING_LOOP_BOUND
uint8_t k() const
dimensions of the expanded matrix A
static constexpr uint16_t SAMPLE_POLY_FROM_XOF_BOUND
DilithiumGamma2 gamma2() const
low-order rounding range for decomposing the commitment from polynomial vector 'w'
static constexpr size_t SEED_RHO_BYTES
int(* final)(unsigned char *, CTX *)