Botan 3.6.1
Crypto and TLS for C&
|
#include <dilithium_constants.h>
Public Types | |
enum | DilithiumBeta : uint32_t { _78 = 78 , _196 = 196 , _120 = 120 } |
enum | DilithiumEta : uint32_t { _2 = 2 , _4 = 4 } |
enum | DilithiumGamma1 : uint32_t { ToThe17th = (1 << 17) , ToThe19th = (1 << 19) } |
enum | DilithiumGamma2 : uint32_t { Qminus1DevidedBy88 = (Q - 1) / 88 , Qminus1DevidedBy32 = (Q - 1) / 32 } |
enum | DilithiumLambda : uint32_t { _128 = 128 , _192 = 192 , _256 = 256 } |
enum | DilithiumOmega : uint32_t { _80 = 80 , _55 = 55 , _75 = 75 } |
enum | DilithiumTau : uint32_t { _39 = 39 , _49 = 49 , _60 = 60 } |
using | T = int32_t |
base data type for most calculations | |
Public Member Functions | |
size_t | canonical_parameter_set_identifier () const |
DilithiumConstants (const DilithiumConstants &other) | |
DilithiumConstants (DilithiumConstants &&other)=default | |
DilithiumConstants (DilithiumMode dimension) | |
bool | is_aes () const |
bool | is_ml_dsa () const |
bool | is_modern () const |
Dilithium_Keypair_Codec & | keypair_codec () const |
DilithiumMode | mode () const |
DilithiumConstants & | operator= (const DilithiumConstants &other)=delete |
DilithiumConstants & | operator= (DilithiumConstants &&other)=default |
Dilithium_Symmetric_Primitives_Base & | symmetric_primitives () const |
~DilithiumConstants () | |
Foundational constants | |
DilithiumTau | tau () const |
hamming weight of the polynomial 'c' sampled from the commitment's hash | |
DilithiumLambda | lambda () const |
collision strength of the commitment hash function | |
DilithiumGamma1 | gamma1 () const |
coefficient range of the randomly sampled mask 'y' | |
DilithiumGamma2 | gamma2 () const |
low-order rounding range for decomposing the commitment from polynomial vector 'w' | |
uint8_t | k () const |
dimensions of the expanded matrix A | |
uint8_t | l () const |
dimensions of the expanded matrix A | |
DilithiumEta | eta () const |
coefficient range of the private key's polynomial vectors 's1' and 's2' | |
DilithiumBeta | beta () const |
tau * eta | |
DilithiumOmega | omega () const |
maximal hamming weight of the hint polynomial vector 'h' | |
size_t | public_key_hash_bytes () const |
length of the public key hash 'tr' in bytes (differs between R3 and ML-DSA) | |
size_t | commitment_hash_full_bytes () const |
length of the entire commitment hash 'c~' in bytes (differs between R3 and ML-DSA) | |
Sizes of encoded data structures | |
size_t | signature_bytes () const |
byte length of the encoded signature | |
size_t | public_key_bytes () const |
byte length of the encoded public key | |
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' | |
Static Public Attributes | |
static constexpr T | D = 13 |
number of dropped bits from t (see FIPS 204 Section 5) | |
static constexpr T | F = 8347681 |
as specified in FIPS 204 (see Algorithm 36 (NTT^-1), f = 256^-1 mod Q) | |
static constexpr T | N = 256 |
number of coefficients in a polynomial | |
static constexpr size_t | NTT_Degree = 256 |
degree of the NTT polynomials | |
static constexpr T | Q = 8380417 |
modulus | |
static constexpr T | ROOT_OF_UNITY = 1753 |
the 512-th root of unity modulo Q (see FIPS 204 Section 8.5) | |
Byte length's of various hash outputs and seeds | |
static constexpr size_t | SEED_RANDOMNESS_BYTES = 32 |
static constexpr size_t | SEED_RHO_BYTES = 32 |
static constexpr size_t | SEED_RHOPRIME_BYTES = 64 |
static constexpr size_t | OPTIONAL_RANDOMNESS_BYTES = 32 |
static constexpr size_t | SEED_SIGNING_KEY_BYTES = 32 |
static constexpr size_t | MESSAGE_HASH_BYTES = 64 |
static constexpr size_t | COMMITMENT_HASH_C1_BYTES = 32 |
Loop bounds for various rejection sampling loops (FIPS 204, Apx C) | |
static constexpr uint16_t | SIGNING_LOOP_BOUND = 814 |
static constexpr uint16_t | SAMPLE_POLY_FROM_XOF_BOUND = 481 |
static constexpr uint16_t | SAMPLE_NTT_POLY_FROM_XOF_BOUND = 894 |
static constexpr uint16_t | SAMPLE_IN_BALL_XOF_BOUND = 221 |
Algorithm constants and parameter-set dependent values
Definition at line 25 of file dilithium_constants.h.
using Botan::DilithiumConstants::T = int32_t |
base data type for most calculations
Definition at line 28 of file dilithium_constants.h.
enum Botan::DilithiumConstants::DilithiumBeta : uint32_t |
enum Botan::DilithiumConstants::DilithiumEta : uint32_t |
enum Botan::DilithiumConstants::DilithiumGamma1 : uint32_t |
enum Botan::DilithiumConstants::DilithiumGamma2 : uint32_t |
Enumerator | |
---|---|
Qminus1DevidedBy88 | |
Qminus1DevidedBy32 |
Definition at line 79 of file dilithium_constants.h.
enum Botan::DilithiumConstants::DilithiumLambda : uint32_t |
enum Botan::DilithiumConstants::DilithiumOmega : uint32_t |
enum Botan::DilithiumConstants::DilithiumTau : uint32_t |
Botan::DilithiumConstants::DilithiumConstants | ( | DilithiumMode | dimension | ) |
Definition at line 59 of file dilithium_constants.cpp.
References Botan::bitlen(), Botan::Dilithium_Keypair_Codec::create(), Botan::Dilithium_Symmetric_Primitives_Base::create(), D, mode(), Botan::DilithiumMode::mode(), Q, SEED_RHO_BYTES, and SEED_SIGNING_KEY_BYTES.
|
default |
|
inline |
Definition at line 90 of file dilithium_constants.h.
|
default |
|
inline |
|
inline |
Definition at line 161 of file dilithium_constants.h.
|
inline |
length of the entire commitment hash 'c~' in bytes (differs between R3 and ML-DSA)
Definition at line 137 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::decode_signature().
|
inline |
coefficient range of the private key's polynomial vectors 's1' and 's2'
Definition at line 125 of file dilithium_constants.h.
|
inline |
coefficient range of the randomly sampled mask 'y'
Definition at line 113 of file dilithium_constants.h.
|
inline |
low-order rounding range for decomposing the commitment from polynomial vector 'w'
Definition at line 116 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::decompose(), Botan::Dilithium_Algos::make_hint(), and Botan::Dilithium_Algos::use_hint().
|
inline |
Definition at line 98 of file dilithium_constants.h.
References Botan::DilithiumMode::is_aes().
Referenced by Botan::Dilithium_Symmetric_Primitives_Base::create().
|
inline |
Definition at line 100 of file dilithium_constants.h.
References Botan::DilithiumMode::is_ml_dsa().
Referenced by Botan::Dilithium_Symmetric_Primitives_Base::create().
|
inline |
Definition at line 96 of file dilithium_constants.h.
References Botan::DilithiumMode::is_modern().
Referenced by Botan::Dilithium_Symmetric_Primitives_Base::create().
|
inline |
dimensions of the expanded matrix A
Definition at line 119 of file dilithium_constants.h.
Referenced by canonical_parameter_set_identifier(), Botan::Dilithium_Algos::decode_public_key(), Botan::Dilithium_Algos::decode_signature(), Botan::Dilithium_Algos::expand_A(), Botan::Dilithium_Algos::expand_s(), and Botan::ML_DSA_Symmetric_Primitives::ML_DSA_Symmetric_Primitives().
|
inline |
Definition at line 165 of file dilithium_constants.h.
Referenced by Botan::Dilithium_PrivateKey::Dilithium_PrivateKey().
|
inline |
dimensions of the expanded matrix A
Definition at line 122 of file dilithium_constants.h.
Referenced by canonical_parameter_set_identifier(), Botan::Dilithium_Algos::decode_signature(), Botan::Dilithium_Algos::expand_A(), Botan::Dilithium_Algos::expand_mask(), Botan::Dilithium_Algos::expand_s(), and Botan::ML_DSA_Symmetric_Primitives::ML_DSA_Symmetric_Primitives().
|
inline |
collision strength of the commitment hash function
Definition at line 110 of file dilithium_constants.h.
|
inline |
Definition at line 158 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Expanded_Keypair_Codec::decode_keypair(), Botan::Dilithium_PrivateKey::Dilithium_PrivateKey(), Botan::Dilithium_PublicKey::Dilithium_PublicKey(), and DilithiumConstants().
|
inline |
maximal hamming weight of the hint polynomial vector 'h'
Definition at line 131 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::decode_signature().
|
delete |
|
default |
|
inline |
byte length of the encoded private key
Definition at line 151 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Expanded_Keypair_Codec::decode_keypair().
|
inline |
byte length of the encoded public key
Definition at line 148 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::decode_public_key(), Botan::Dilithium_PublicKey::Dilithium_PublicKey(), and Botan::Dilithium_Algos::encode_public_key().
|
inline |
length of the public key hash 'tr' in bytes (differs between R3 and ML-DSA)
Definition at line 134 of file dilithium_constants.h.
|
inline |
byte length of the packed commitment polynomial vector 'w1'
Definition at line 154 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::encode_commitment().
|
inline |
byte length of the encoded signature
Definition at line 145 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::decode_signature(), and Botan::Dilithium_Algos::encode_signature().
|
inline |
Definition at line 163 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::expand_keypair(), Botan::Dilithium_Algos::expand_mask(), and Botan::Dilithium_Algos::sample_in_ball().
|
inline |
hamming weight of the polynomial 'c' sampled from the commitment's hash
Definition at line 107 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::sample_in_ball().
|
staticconstexpr |
Definition at line 58 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Round3_Symmetric_Primitives::truncate_commitment_hash().
|
staticconstexpr |
number of dropped bits from t (see FIPS 204 Section 5)
Definition at line 37 of file dilithium_constants.h.
Referenced by DilithiumConstants(), and Botan::Dilithium_Algos::power2round().
|
staticconstexpr |
as specified in FIPS 204 (see Algorithm 36 (NTT^-1), f = 256^-1 mod Q)
Definition at line 40 of file dilithium_constants.h.
|
staticconstexpr |
Definition at line 57 of file dilithium_constants.h.
Referenced by Botan::DilithiumMessageHash::final(), and Botan::DilithiumMessageHash::name().
|
staticconstexpr |
number of coefficients in a polynomial
Definition at line 31 of file dilithium_constants.h.
|
staticconstexpr |
degree of the NTT polynomials
Definition at line 46 of file dilithium_constants.h.
|
staticconstexpr |
Definition at line 55 of file dilithium_constants.h.
Referenced by Botan::ML_DSA_Symmetric_Primitives::H_maybe_randomized().
|
staticconstexpr |
modulus
Definition at line 34 of file dilithium_constants.h.
Referenced by DilithiumConstants(), Botan::Dilithium_Algos::infinity_norm_within_bound(), Botan::Dilithium_Algos::make_hint(), and Botan::Dilithium_Algos::use_hint().
|
staticconstexpr |
the 512-th root of unity modulo Q (see FIPS 204 Section 8.5)
Definition at line 43 of file dilithium_constants.h.
|
staticconstexpr |
Definition at line 68 of file dilithium_constants.h.
|
staticconstexpr |
Definition at line 67 of file dilithium_constants.h.
|
staticconstexpr |
Definition at line 66 of file dilithium_constants.h.
|
staticconstexpr |
Definition at line 52 of file dilithium_constants.h.
Referenced by Botan::Dilithium_PrivateKey::Dilithium_PrivateKey().
|
staticconstexpr |
Definition at line 53 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Algos::decode_public_key(), DilithiumConstants(), and Botan::Dilithium_Symmetric_Primitives_Base::H().
|
staticconstexpr |
Definition at line 54 of file dilithium_constants.h.
Referenced by Botan::Dilithium_Symmetric_Primitives_Base::H(), and Botan::Dilithium_Round3_Symmetric_Primitives::H_maybe_randomized().
|
staticconstexpr |
Definition at line 56 of file dilithium_constants.h.
Referenced by DilithiumConstants(), and Botan::Dilithium_Symmetric_Primitives_Base::H().
|
staticconstexpr |
Definition at line 65 of file dilithium_constants.h.