pub struct MlDsaParams;Expand description
General ML-DSA parameter set used by the signature implementation
Trait Implementations§
Source§impl Clone for MlDsaParams
impl Clone for MlDsaParams
Source§fn clone(&self) -> MlDsaParams
fn clone(&self) -> MlDsaParams
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MlDsaParams
impl Debug for MlDsaParams
Source§impl Modulus for MlDsaParams
impl Modulus for MlDsaParams
Source§const BARRETT_MU: u128 = 4_299_165_187
const BARRETT_MU: u128 = 4_299_165_187
Barrett reduction constant mu = floor(2^k / Q)
Set to 0 for dynamic computation
Source§impl NttModulus for MlDsaParams
impl NttModulus for MlDsaParams
Source§const N_INV: u32 = 16_382
const N_INV: u32 = 16_382
N^-1 mod Q in Montgomery form: 256^-1 · R mod Q = 16_382
This is the value used by the reference invntt_tomont.
Calculation: (8_347_681 * 4_193_792) mod 8_380_417 = 16_382
where 8_347_681 = 256^-1 mod 8_380_417
Source§const NEG_QINV: u32 = 4_236_238_847
const NEG_QINV: u32 = 4_236_238_847
-Q⁻¹ mod 2³² = 4_236_238_847 Q = 8380417, Q⁻¹ mod 2³² = 58728449 (0x03802001) -Q⁻¹ mod 2³² = 2³² - 58728449 = 4236238847 (0xFC7FDFFF)
Source§const ZETAS: &'static [u32]
const ZETAS: &'static [u32]
Precomputed twiddle factors for forward NTT
CRITICAL: For ML-DSA, these are stored in MONTGOMERY domain (ζ·R mod q)
exactly as in the FIPS-204 reference implementation.
Do NOT convert them again - that would give ζ·R² mod q!
Source§const PSIS: &'static [u32]
const PSIS: &'static [u32]
Twist factors ψ_i = ω^(bitrev(i)) in STANDARD domain (length N)
These are the N-th roots of the primitive 2N-th root of unity
Required for twisted/negacyclic NTT (ML-DSA)
NOTE: FIPS-204 reference implementation does NOT use these!
Source§const INV_PSIS: &'static [u32]
const INV_PSIS: &'static [u32]
Inverse twist factors ψ_i^(-1) in STANDARD domain (length N)
Required for inverse twisted/negacyclic NTT (ML-DSA)
NOTE: FIPS-204 reference implementation does NOT use these!
Source§const POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Standard
const POST_INVNTT_MODE: PostInvNtt = PostInvNtt::Standard
How the coefficients should be post-processed after the inverse NTT. Read more
Auto Trait Implementations§
impl Freeze for MlDsaParams
impl RefUnwindSafe for MlDsaParams
impl Send for MlDsaParams
impl Sync for MlDsaParams
impl Unpin for MlDsaParams
impl UnsafeUnpin for MlDsaParams
impl UnwindSafe for MlDsaParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more