Why is EC Schnorr zero-knowledge?
Because y is uniform over the finite groupFpm, shifting it by cs(modp) produces a distribution that is still uniform over Fpm—completely independent of s!
Why is EC Schnorr special sound?
Given two accepting transcripts (c1,z1) and (c2,z2) with c1=c2:
A(z1−z2)=(c1−c2)t⟹s∗=(c1−c2)−1(z1−z2)(modp)
satisfies As∗=t.
Now try doing exact Schnorr over a lattice! Let t=Asmodq where s∈Rm is short (∥s∥∞≤β).
If you sample y uniformly mod q, then z=y+csmodq is NOT short, so the verifier rejects—or if the verifier doesn't check ∥z∥, anyone can solve Az=w+ctmodq with Gaussian elimination!
So y MUST be short! And once y is short, EVERYTHING changes:
z=y+csleaks s!
(c1−c2) might not be invertible in Rq, and even if it is, (c1−c2)−1 is not short!
Let's solve both problems cleanly. This is Lyubashevsky's celebrated "Fiat-Shamir with Aborts" paradigm (2009 / 2012).
2. Why Naive Short Schnorr Leaks the Secret
Suppose our secret is a single scalar s∈{−1,0,1}, the challenge is c∈{−1,1}, and we sample mask y uniformly from {−10,−9,…,10} (without reducing mod q, since 10≪q).
Then z=y+cs lies in [−11,11].
Watch what happens when a verifier sees z=11 and c=1:
Since y≤10, y+s=11forces y=10 and s=+1!
Even for interior values, the average of z given c=1 is E[z∣c=1]=s, and the support of z shifts by c⋅s! Over ∼100 signatures or transcripts, an attacker simply averages cizi or intersects the bounding boxes to recover s completely!
(Run cargo run --bin lab03_rejection_sampling inside labs/ to watch this leakage attack recover a secret in seconds!)
3. Rejection Sampling (Lyubashevsky 2009 / 2012)
How do you make the distribution of z=y+cscompletely independent of the secret shift v=cs?
Answer: Sample y from a distribution g, compute z=y+v, and ONLY output z with a carefully chosen probability; otherwise ABORT and restart!
Think of it geometrically: you have a shifted distribution (centered at v) and a target distribution f (centered at 0). As long as f(z)≤M⋅g(z−v) everywhere (for some constant M≥1), if you accept z with probability
paccept(z)=M⋅g(z−v)f(z)∈[0,1],
then the output distribution conditioned on accepting is exactf(z)—with zero dependence on v=cs! And the overall acceptance rate is 1/M!
There are two classic choices for (g,f) in proof systems:
3.1 Choice 1: Uniform Box Rejection Sampling (Used in Dilithium)
Let ∥v∥∞≤βshift (e.g., βshift=maxc∈C∥cs∥∞).
Sample y uniformly from the hypercube [−γ1+1,γ1]N (where N=m⋅d is the total number of integer coefficients).
Compute z=y+v.
Rule: If ∥z∥∞≤γ1−βshift, accept and output z; otherwise abort and restart from Step 1 (fresh y!).
Let's check why this is perfectly zero-knowledge!
For ANY z inside the inner box [−(γ1−βshift),γ1−βshift]N:
Notice that z−v∈[−γ1,γ1]N for every valid shift ∥v∥∞≤βshift!
So every valid z inside the inner box has exactly one preimage y=z−v in the outer box, with uniform probability! Thus, conditioned on not aborting, z is uniformly distributed on the inner box, completely independent of s!
Wait—what is the acceptance probability?
Each of the N coordinates survives with probability ≈1−γ1βshift. Across N coordinates:
Pr[accept]≈(1−γ1βshift)N≈e−Nβshift/γ1.
To keep Pr[accept]≥1/e≈37% (only ~2.7 retries on average!), we need:
γ1≈N⋅βshift!
Look at that factor of N (dimension)! Because γ1 scales linearly with N, uniform box rejection gives ℓ2-norm ∥z∥2≈N1.5βshift—which is okay for signatures like Dilithium, but too big for compact lattice ZKPs!
Can we replace the linear N factor with N (or even independent of N)?
Yes—using Discrete Gaussians!
Let DσN be the discrete Gaussian distribution over ZN with standard deviation σ (each coordinate x sampled with probability proportional to exp(−x2/(2σ2))).
Set y←DσN and z=y+v (where ∥v∥2≤T).
Accept z with probability:paccept=min(1,M⋅DσN(z−v)DσN(z))=M1exp(2σ2−2⟨z,v⟩+∥v∥22),
where we choose M=exp(σ12T+2σ2T2) (or tighter: M≈e1.5 if σ≈11⋅T!).
Look at what the exponent depends on:
By Cauchy-Schwarz / subgaussian tail bounds, with overwhelming probability ∣⟨z,v⟩∣≤12σ∥v∥2≤12σT—completely independent of the dimension N!
Therefore, setting σ=α⋅T (e.g., α=11 gives M≈3, i.e. ~33% acceptance!) works for ANY dimension N (whether N=100 or N=106)!
And a vector z←DσN has ℓ2 norm ∥z∥2≈σN=O(N⋅∥cs∥2), saving a huge factor of N over uniform rejection!
(Bonus trick: Bimodal Gaussian / Lyubashevsky–Ducas (BLISS) flips a random sign b∈{−1,+1} on v and uses Mcosh(⟨z,v⟩/σ2)1, eliminating the cross-term 12T/σ so σ only needs to be ≈0.67⋅T!)
4. Zero-Knowledge Simulator & Why "Aborts" Are Safe
Wait: in an interactive protocol, if the prover aborts and restarts, doesn't that break completeness or ZK?
In interactive mode: Abort just means the prover sends a special symbol ⊥ (or restarts before sending w? Wait: in Fiat-Shamir non-interactive proofs, the prover simply runs the loop locally with fresh y and hashes H(w) until an iteration does not abort, then outputs the single winning (w,z)!).
What about an interactive simulator? To simulate a transcript without knowing s: with probability 1−1/M, the simulator outputs ⊥ (abort); with probability 1/M, it samples z←f directly (e.g., DσN), samples c←C, and sets w=Az−ctmodq!
Because the real prover's accepted z is distributed identically (or within 2−λ statistical distance) to f, and w is uniquely determined by Az−ct, the simulated transcript distribution matches the real one!
(Subtlety for interactive 3-round Sigma protocols: If the adversary's challenge c is fixed before seeing w, wait—in standard ZK, the verifier can pick cdepending on w! If the abort decision depended on c, could aborting depend on w? Notice that M is chosen so that the abort probability 1/M is constant for ALL v=cs, meaning whether the prover aborts is statistically independent of w and c! That's why M must be universal for the worst-case bound ∥v∥2≤T!)*
5. Relaxed Soundness ("Soundness with Slack")
Now let's examine extraction (special soundness) in the lattice Sigma protocol!
Suppose the verifier checks:
Az≡w+ct(modq), AND
∥z∥2≤Bz (where Bz≈σN for an honest prover).
Assume a cheating prover answers two distinct challenges c1=c2∈C for the same commitment w:
Az1≡w+c1t(modq),Az2≡w+c2t(modq).
Subtracting the two equations:
A(z1−z2)≡(c1−c2)t(modq).
Here is the huge fork in the road compared to EC Schnorr:
Let cˉ=c1−c2=0, and zˉ=z1−z2 (so ∥zˉ∥2≤2Bz).
Can we divide by cˉ to recover s?
Problem 1:cˉ might not even be invertible in Rq (if Rq splits via CRT into small fields and cˉ hits zero in one slot)!
Problem 2: Even if cˉIS invertible mod q, its inverse cˉ−1modq is huge (essentially uniformly random in [−q/2,q/2)d)! So cˉ−1zˉmodq is NOT short—it is NOT a valid short opening for t!
So what does the extractor get?
It extracts a relaxed opening(cˉ,zˉ):
Azˉ≡cˉ⋅t(modq),∥zˉ∥2≤2Bz,cˉ=c1−c2∈C−C∖{0}.
Wait: is a relaxed opening enough for soundness?!
Look! Suppose the prover is actually honest? No, suppose we have a commitment t and want to prove binding (two extractions give (cˉ,zˉ) and (cˉ′,zˉ′) for different underlying messages, or we want a short witness for Ax=t):
If t=0 (e.g., proving knowledge of a short nonzero SIS preimage), then Azˉ≡0(modq) directly gives a short vector of norm 2Bz!
If t is a BDLOP commitment (t1,t2) and cˉ is invertible in Rq:
Look at the unique messagemˉ=t2−cˉ−1A2rˉ(modq)!
Notice mˉ does not need to be short—only rˉ needs to be short! And we can prove that rˉ (with norm 2Bz) and cˉ still guarantee binding as long as 2∥cˉ∥op⋅(2Bz)<βSIS!
The ratio between:
the honest witness norm ∥s∥2, and
the extracted witness norm ∥zˉ∥2 (plus multiplication by cˉ)
is called the soundness slack (often γslack=O~(N⋅∥c∥op))!
This is why lattice parameters must satisfy a slack gap:
Honest norm β≪Extracted slack norm βext≪M-SIS hardness bound βSIS≪q.
(In Module 06, we'll learn how modern schemes like LNP22 eliminate slack on the message s1 itself when exact shortness ∥s1∥∞≤B is required!)
6. Designing the Challenge Space C
What properties do we need from the challenge set C⊂R?
Large enough:∣C∣≥2128 (so 1 challenge gives 128-bit soundness, or e.g. ∣C∣≥264 repeated twice).
Short & sparse: Small operator norm ∥c∥op (and small ∥c∥1,∥c∥2) so rejection sampling σ≈11∥cs∥2 stays tight and slack stays small!
Invertible differences: For ALL distinct c1,c2∈C, c1−c2 is invertible in Rq!
How do we guarantee property (3)?
Theorem (Lyubashevsky–Seiler, 2018)
Suppose q is a prime such that Xd+1 splits modulo q into k irreducible factors of degree d/k (where k is a power of 2, e.g., k=2 or k=4, i.e. q≡2k+1(mod4k)).
Then any nonzero polynomial u∈R satisfying
0<∥u∥∞<k1q1/k(or ∥u∥2<q1/k roughly)
is invertible in Rq!
Why? (Intuition using Module 01's norms!):
Think of the ideal (fj(X),q)⊂R corresponding to one irreducible factor fj(X) of degree d/k.
As a Z-lattice of rank d, this ideal has determinant qd/k!
By the geometry of numbers (specifically properties of cyclotomic ideals), every nonzero polynomial in that ideal has norm at least ≈q1/k!
So if u=c1−c2 is nonzero and has coefficients strictly smaller than k1q1/k, ucannot be divisible by any factor fj(X)modq—meaning every CRT slot of u is nonzero, so u is invertible in Rq!
Concrete Example (LNP22 / Dilithium style):
Set d=64, k=2 (so q≡5(mod8), e.g. q≈232).
Threshold: 21q1/2≈215.5≈46,000.
Choose C={c∈R:∥c∥∞≤2,∥c∥1≤ω} (say ω=20 nonzero coefficients in {−2,−1,0,1,2} or ternary {−1,0,1} with weight 30).
Wait: how many ternary polynomials of degree 64 have Hamming weight 24?
(2464)⋅224≈259⋅224=283 (or weight 32 gives (3264)232≈292; with coefficients in {−2,−1,0,1,2} easily >2128!).
Every difference c1−c2 has ∥c1−c2∥∞≤4≪46,000, so every nonzero difference is 100% guaranteed invertible in Rq!
7. Summary: The Complete Lattice Sigma Protocol for Linear Relations
To prove knowledge of a short s satisfying As≡t(modq) with ∥s∥2≤β:
Prover: Samples y←DσN, computes w=Aymodq, sends w.
Verifier: Sends challenge c←C (with invertible differences and small ∥c∥op).
Prover: Computes z=y+cs. Runs rejection sampling with parameter M (abort & restart if rejected). Sends z.
Verifier: Checks:
Az≡w+ct(modq), AND
∥z∥2≤Bz (typically Bz=σ2N or 1.2σN).
This gives:
Zero-Knowledge via Discrete Gaussian rejection sampling.
Relaxed Soundness: Extracts short zˉ and invertible cˉ=c1−c2 with Azˉ≡cˉt(modq).
Next up in Module 06: What if we need exact shortness (no slack!) AND non-linear (quadratic / R1CS / Plonk) constraints?
Exercises
Leakage Math: Suppose s∈{0,1}, c∈{0,1}, and y←{−5,…,5} uniformly. Compute E[z∣c=1] where z=y+cs. How many transcripts with c=1 do you expect until an adversary sees z=6 (if s=1) or z=−5 (if s=0)?
Uniform Box Acceptance Probability: You want to run uniform box rejection sampling on N=1000 coefficients where ∥cs∥∞≤20. How big must γ1 be to achieve an acceptance probability of at least 1/e≈36.8%? What is the resulting ℓ∞ bound on z?
Invertibility Bound: Suppose d=128 and q=232−3? Wait: check q≡5(mod8) (e.g., q=4294967293≡5(mod8) if prime, or any prime q≈232 with q≡5(mod8), so k=2). Using Lyubashevsky–Seiler's bound ∥u∥∞<q1/2/2, if challenges have coefficients in {−1,0,1}, could c1−c2 ever fail to be invertible? What if q had been a fully-splitting prime (k=128, q≡1(mod256))?
Hands-on Lab (Rust + Arkworks): Run cargo run --bin lab03_rejection_sampling inside labs/ (lab03_rejection_sampling.rs) to observe:
Naive Schnorr leakage recovering a secret vector s from averages/outliers, and
Rejection sampling completely erasing the correlation between z and s!