Expand description
QSSM-LE: (R_q = \mathbb{Z}_q[X]/(X^{256}+1)) with NTT-backed multiply, MLWE commitment (C = A r + \mu), and Lyubashevsky-style Fiat–Shamir proofs (witness-hiding on the wire).
use qssm_le::{
commit_mlwe, prove_arithmetic, verify_lattice, PublicInstance, VerifyingKey, Witness,
PUBLIC_DIGEST_COEFFS,
};
let vk = VerifyingKey::from_seed([9u8; 32]);
let public = PublicInstance::digest_coeffs([0u32; PUBLIC_DIGEST_COEFFS]).unwrap();
let witness = Witness::new([0i32; qssm_le::N]);
let ctx = [7u8; 32];
let rng_seed = [42u8; 32]; // deterministic masking seed (from entropy pipeline)
let (commitment, proof) = prove_arithmetic(&vk, &public, &witness, &ctx, rng_seed).unwrap();
assert!(verify_lattice(&vk, &public, &commitment, &proof, &ctx).unwrap());Structs§
- Commitment
- Commitment as a full ring element (canonical coeffs mod (q)).
- Commitment
Randomness - Prover masking randomness sampled per-attempt.
- Lattice
Proof - Witness-hiding proof: masking commitment (t = Ay) and response (z = y + c r) with FS challenge (c).
- Public
Instance - RqPoly
- Scrubbed
Poly - Secret-bearing polynomial wrapper that guarantees drop-time zeroization.
- Verifying
Key - Verifying / proving key material (nothing-up-my-sleeve seed).
- Witness
- Secret witness (prover-only).
Enums§
- LeError
- Public
Binding - Public inputs visible to all verifiers (no secret witness).
Constants§
- BETA
- (\ell_\infty) bound on witness coefficients (rejection sampling threshold).
- C_
POLY_ SIZE - Polynomial challenge coefficient count.
- C_
POLY_ SPAN - Polynomial challenge coefficient span per lane ([-C_POLY_SPAN, C_POLY_SPAN]).
- ETA
- Masking vector (\ell_\infty) bound (Lyubashevsky-style; rejection if exceeded).
- GAMMA
- Verifier accepts responses with (|z|_\infty \le \gamma) (centered mod (q)).
- LE_
FS_ PUBLIC_ BINDING_ LAYOUT_ VERSION - Bump when
qssm-lefs_challenge_bytesinput order orpublic_binding_fs_bytesserialization changes anything that gadgetTranscriptMap/ Engine A package JSON must mirror. Shared byqssm-leandqssm-gadgetvia this crate. - N
- Polynomial degree (n = 256) for (R_q = \mathbb{Z}_q[X]/(X^n+1)).
- PUBLIC_
DIGEST_ COEFFS - Number of digest coefficients bound into Engine A public input.
- PUBLIC_
DIGEST_ COEFF_ MAX - Maximum per-coefficient value for digest-to-coefficient embedding (4-bit lanes).
- Q
- Prime modulus with (512 \mid (q-1)) for length-512 NTT.
Functions§
- commit_
mlwe - (C = A r + \mu(public)).
- encode_
rq_ coeffs_ le - Concatenate coefficients (LE u32) for Fiat–Shamir binding.
- prove_
arithmetic - Prove: commit + deterministic Fiat–Shamir proof using a BLAKE3-seeded CSPRNG.
- short_
vec_ to_ rq - Map signed short coefficients into (\mathbb{Z}_q) (witness bound (\beta)).
- short_
vec_ to_ rq_ bound - Map signed coefficients with (\ell_\infty \le \texttt{bound}) into (R_q).
- verify_
lattice - Witness-free verifier (includes
binding_contextin FS challenge). - verify_
lattice_ algebraic - Algebraic verification: (|z|_\infty \le \gamma), recompute (c), check (Az = t + c(C-\mu)). No
Witness.