← Back to section · Post-Quantum Cryptography

Rejection Sampling: Why ML-DSA Sometimes Signs Halfway and Starts Over

The core mechanism of Fiat–Shamir with Aborts: why the response distribution would otherwise leak the private key, how the rejection checks plug the leak, and how the hint mechanism preserves verification correctness without restarting.

Published 22 November 2026 · 5 min read · PQ Frontier

Rejection Sampling: Why ML-DSA Sometimes Signs Halfway and Starts Over
AI-generated site artwork
Video explainer · ML-DSA: signing and verification

First-time readers of ML-DSA signing code often ask why a signature function contains a loop — sometimes one pass, sometimes three or four. That loop is rejection sampling. It is not an implementation blemish but the core mechanism that makes this family of lattice signatures (the Fiat–Shamir with Aborts paradigm) work at all. This article explains where it comes from and how it works.

The problem: the response would betray the private key

Consider what happens without rejection sampling. The signer picks a random mask y and computes the response z = y + c·s1, where c is the publicly computable hash-derived challenge and s1 is the private key. The verifier seeing z is fine — but so is an attacker, who can also compute c. The problem is z’s distribution: it drifts, centered on c·s1. The coefficients of s1 are small, but give an attacker enough signatures and the shape of c·s1 emerges from per-position statistics on z, and with it s1. This “signatures as an oracle” leak is the classic trap in lattice signature design.

There are two ways out. One is to make y enormous so c·s1 drowns in noise — but signature sizes explode. The other is Lyubashevsky’s rejection sampling: after generating z, decide by a carefully designed probability (or, in ML-DSA’s simplified version, by norm bounds) whether to accept or discard it, so that the distribution of accepted z is statistically independent of s1. With independence, no amount of collected signatures teaches anything about the key; the only cost is an occasional restart.

The lineage: from identification protocols to signatures

The mechanism was not invented ad hoc by the Dilithium team. In his lattice-based identification protocols around 2009, Lyubashevsky introduced the “abort” technique: if, midway through a protocol run, the response threatens to leak the secret, abort proactively and start again, statistically severing the leak channel; the technique then moved into Fiat–Shamir signatures and became the signature structural feature of lattice signatures. In a real sense, ML-DSA’s signing loop is written into the algorithm’s genes: without rejection sampling there is no lattice signature of today’s sizes — either signatures swell several-fold, or the private key slowly bleeds out through the signature stream. This also explains why FIPS 204 leaves no elasticity in the check bounds: they are not performance parameters but part of the security proof.

ML-DSA’s three checks

ML-DSA uses deterministic bound checks. Each iteration’s candidate response must clear three gates:

  1. The infinity norm of z: ‖z‖∞ must be below γ1 − β. A z that is too large means this round’s y combined with c·s1 exceeded the “safe cover” range — discard.
  2. The low-part check: compute r0 = LowBits(w − c·s2). The commitment w, minus c·s2, has a low part; if it sits near a carry boundary, the verifier’s rebuilt w1 may be off by one, causing verification failures or information leakage — discard.
  3. The size of c·t0: t0 is the low-order part left in the private key when the public key was split; if c·t0 is too large it disturbs the high-part reconstruction — discard.

Only after all three gates pass does packaging begin. The parameters γ1, γ2, and β are fixed by the parameter set (β = τ·η, coming directly from the challenge weight and the secret width), leaving implementers no discretion in the check bounds — get one inequality’s direction wrong and either signatures always fail, or the key quietly leaks. This is one of the code segments most worth staring at when auditing an ML-DSA implementation.

Hints: don’t restart if you don’t have to

Rejection sampling alone would make verification correctness fragile: the verifier rebuilds the commitment’s high part approximately from t1, and slightly-too-large low-order noise breaks the alignment. The Dilithium-line design therefore adds the hint mechanism: after computing w − c·s2 + c·t0, the signer checks, coefficient by coefficient, “will the verifier’s reconstruction be off by one here?”, and records the positions needing correction as a sparse 0/1 vector h (each parameter set caps the number of ones in h at ω; exceeding it also voids the round). The verifier uses UseHint to nudge the rebuilt values into place, bit by bit.

A hint is, in essence, a trade of size for retries: the signature carries a few dozen extra bytes of h in exchange for a relaxed second check and a lower average iteration count. It also explains why an ML-DSA signature has three components (c̃, z, h) — each one pays for a specific correctness or security problem.

A walkthrough: the life and death of one iteration

Put the mechanism inside one concrete signing. The signer has computed μ and the mask seed; the counter κ points at the current round: ExpandMask emits this round’s y, A·y gives the commitment w, and the hash yields the challenge c. The response z = y + c·s1 takes shape — suppose this round’s y has a small coefficient exactly where c·s1 adds a large value, and z’s infinity norm punches through γ1 − β: the round is voided on the spot, κ advances, ExpandMask produces fresh output, and the dead z never leaves the chip (even “it existed” remains only in registers). Next round z lands in bounds, but the low-part check on w − c·s2 finds a coefficient perched on the carry cliff edge: release it, and the verifier has a fair chance of computing w1 wrong by one — void again. A third round passes all three gates, but MakeHint finds more correction positions than the ω cap allows: void again. Only when some round’s every indicator behaves is the signature packaged and released. From outside, an observer sees only “this signature took about three times the usual duration,” never which gate each round died at — and that is the intent: rejected samples carry secret information, while the accepted distribution has been trimmed by the three gates into independence from the secret. The statistical relationship between signing time and iteration count is precisely the leakage channel the side-channel article in this column defends against.

Two consequences for implementations

First, signing time is inherently variable. The iteration count follows a geometric distribution, and occasional long tails are normal; any system design that demands “signatures must complete within a fixed number of milliseconds” must budget for the tail. Second, the iteration count itself correlates with the secret, making it a natural entry point for timing side channels — constant-time implementation cannot eliminate the “how many retries” signal, only the layers above can avoid exposing it as an observable; the side-channel article in this column picks this thread up.

With rejection sampling understood, ML-DSA’s parameter table reads much more sensibly: γ1 sets z’s encoding bit width (i.e., signature size), γ2 sets the strictness of the low-part check (i.e., the retry rate), and τ with η set β (i.e., how tight the security bounds are) — every row of the table is a knob on this one mechanism.

Tags: ML-DSArejection samplingFiat-Shamirlattice cryptography