Skip to main content

Params

Trait Params 

Source
pub trait Params {
Show 14 associated constants and 0 method const K: usize; const L: usize; const ETA: usize; const TAU: usize; const BETA: i32; const GAMMA1: i32; const GAMMA2: i32; const OMEGA: usize; const LAMBDA: usize; const BITLEN_2ETA: usize; const BITLEN_GAMMA1_MINUS1: usize; const PK_LEN: usize = _; const SK_LEN: usize = _; const SIG_LEN: usize = _;
}
Expand description

Parameter trait for ML-DSA security levels.

Each implementor (e.g., MlDsa44, MlDsa65, MlDsa87) provides the constants from FIPS 204, Table 1. Derived sizes for public key, secret key, and signature are computed automatically from the base constants.

Required Associated Constants§

Source

const K: usize

Number of rows in the matrix A (dimension k).

Source

const L: usize

Number of columns in the matrix A (dimension l).

Source

const ETA: usize

Secret key coefficient bound: coefficients of s1, s2 lie in [-eta, eta].

Source

const TAU: usize

Number of +/-1 entries in the challenge polynomial c.

Source

const BETA: i32

Signing bound beta = tau * eta. Candidate signatures with infinity norm >= gamma1 - beta are rejected.

Source

const GAMMA1: i32

Masking range: coefficients of the masking vector y are sampled from [-(gamma1-1), gamma1].

Source

const GAMMA2: i32

Decomposition parameter: controls the rounding used in HighBits/LowBits.

Source

const OMEGA: usize

Maximum number of non-zero hint entries allowed across all k hint polynomials.

Source

const LAMBDA: usize

Collision strength in bits; determines the length of the commitment hash c_tilde (lambda/4 bytes).

Source

const BITLEN_2ETA: usize

Helper constant: bit-length of 2*eta, used for encoding secret polynomials.

Source

const BITLEN_GAMMA1_MINUS1: usize

Helper constant: bit-length of gamma1 - 1, used for encoding z in signatures.

Provided Associated Constants§

Source

const PK_LEN: usize = _

Public key length in bytes: 32 (rho) + k * 320 (encoded t1).

Source

const SK_LEN: usize = _

Secret key length in bytes.

Source

const SIG_LEN: usize = _

Signature length in bytes.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§