Chapter 6ML-DSA

Exercises

August 25, 20266 min readbeginner

With y uniform on (-, ], |s| , z = y + s, and acceptance when |z| < - , prove that the accepted z is uniform on (-+, -] independent of s.

01.1. Prove that rejection sampling removes the shift

With yy uniform on (−γ,γ](-\gamma, \gamma], ∣s∣≤β|s| \le \beta, z=y+sz = y + s, and acceptance when ∣z∣<γ−β|z| < \gamma - \beta, prove that the accepted zz is uniform on (−γ+β,  γ−β](-\gamma+\beta,\; \gamma-\beta] independent of ss.

Answer. Before conditioning, zz is uniform on the shifted interval (−γ+s,  γ+s](-\gamma + s,\; \gamma + s], which has width 2γ2\gamma and so has density 1/(2γ)1/(2\gamma) at every point inside it.

Call the acceptance region S=(−γ+β,  γ−β]S = (-\gamma+\beta,\; \gamma-\beta].

The key step is that S⊆(−γ+s,  γ+s]S \subseteq (-\gamma+s,\; \gamma+s] for every admissible ss. The left endpoint needs −γ+s≤−γ+β-\gamma + s \le -\gamma + \beta, which holds because s≤βs \le \beta. The right endpoint needs γ−β≤γ+s\gamma - \beta \le \gamma + s, which holds because s≥−βs \ge -\beta. So SS sits inside the shifted interval no matter what ss is.

Therefore the density of zz is the constant 1/(2γ)1/(2\gamma) at every point of SS, regardless of ss. Conditioning on z∈Sz \in S renormalises that constant over SS, giving the uniform distribution on SS with density 1/(2(γ−β))1/(2(\gamma - \beta)).

The result mentions γ\gamma and β\beta only, both public. So the accepted values carry no information about ss, which is the property the security proof needs.

Note what would break it. If ∣s∣|s| could exceed β\beta, then SS would poke outside the shifted interval on one side, that part would have density zero, and the shift would be visible again. The bound β\beta is therefore not a convenience but a correctness condition, which is why β=τη\beta = \tau\eta is derived rather than chosen.

02.2. Acceptance rate for ML-DSA-65

Estimate the per-attempt acceptance probability for γ1=219\gamma_1 = 2^{19}, β=196\beta = 196, ℓ=5\ell = 5, n=256n = 256, assuming coefficients are independent. What is the expected number of restarts?

Answer. Per coefficient,

1−βγ1  =  1−196524288  =  0.999626.1 - \frac{\beta}{\gamma_1} \;=\; 1 - \frac{196}{524288} \;=\; 0.999626 .

There are ℓ⋅n=5×256=1280\ell \cdot n = 5 \times 256 = 1280 coefficients in z\mathbf{z}, so the joint probability is

0.9996261280  ≈  0.62,0.999626^{1280} \;\approx\; 0.62 ,

giving about 1/0.62≈1.61/0.62 \approx 1.6 attempts expected.

That is the bound from the z\mathbf{z} check alone. The real rate is lower because Signing applies two further rejection tests, on the low bits and on the hint weight, and all must pass together. Those bring the true figure into the four-to-six range quoted in Rejection Sampling, or Fiat-Shamir With Aborts.

The exercise is worth doing precisely because the naive estimate is optimistic. The dominant cost comes from the checks that exist for verification reasons rather than for secrecy.

03.3. Attack the version without rejection

Answer. Collect many pairs (z(i),c(i))(\mathbf{z}^{(i)}, c^{(i)}) and exploit that z=y+cs1\mathbf{z} = \mathbf{y} + c\mathbf{s}_1 with y\mathbf{y} symmetric about zero.

Since E[y]=0\mathbb{E}[\mathbf{y}] = 0, taking expectations gives E[z∣c]=c s1\mathbb{E}[\mathbf{z} \mid c] = c\,\mathbf{s}_1. So averaging the released responses grouped by challenge estimates cs1c\mathbf{s}_1 directly, and dividing out the known cc recovers s1\mathbf{s}_1.

More practically, an attacker computes ∑ic(i)−1z(i)\sum_i c^{(i)-1}\mathbf{z}^{(i)} over many signatures. The y\mathbf{y} contributions are independent and mean-zero so they average towards nothing, while the s1\mathbf{s}_1 contribution is the same every time and accumulates linearly. The signal-to-noise ratio grows like N\sqrt{N}, so a few thousand signatures suffice.

Why the Naive Version Leaks runs the one-coordinate version: 400,000 samples recover a secret of 33 as 3.1513.151, and with rejection the same estimator returns 0.1200.120.

4. Toy key generation over F97\mathbb{F}_{97}

Answer. With d=4d = 4, decomposing t=24t1+t0\mathbf{t} = 2^4 \mathbf{t}_1 + \mathbf{t}_0 means splitting each coefficient into a multiple of 1616 plus a remainder centred on zero, so t0∈(−8,8]\mathbf{t}_0 \in (-8, 8] and therefore ∥t0∥∞≤8=2d−1\|\mathbf{t}_0\|_\infty \le 8 = 2^{d-1}, as required.

Concretely, a coefficient of 5353 decomposes as 53=3×16+553 = 3 \times 16 + 5, giving t1=3t_1 = 3 and t0=5t_0 = 5. A coefficient of 6161 gives 61=4×16−361 = 4 \times 16 - 3, so t1=4t_1 = 4 and t0=−3t_0 = -3, taking the nearest multiple rather than rounding down. That centring is what keeps ∣t0∣≤8|t_0| \le 8 rather than ≤15\le 15, and it halves the perturbation the hint has to cover.

05.5. Which assumption protects what

Answer. Module-LWE protects the key. The public key is t=As1+s2\mathbf{t} = A\mathbf{s}_1 + \mathbf{s}_2, exactly a Module-LWE sample, so recovering s1\mathbf{s}_1 from pkpk alone is Module-LWE.

Module-SIS prevents forgery. Two valid signatures on one message under one challenge, subtracted, cancel the message-dependent parts and leave a short non-zero element of the kernel of [A∥Ik][A \| I_k], which is a Module-SIS solution. So forging implies solving it.

The division matters because the two cover different attackers, as Security, and the Chapter Summary describes: Module-LWE covers someone with only the public key, Module-SIS covers someone who also holds unlimited signatures. Rejection sampling is the bridge, because it makes signatures simulatable and so reduces the second attacker to the first.

06.6. Bound the challenge product

Show ∥cs1∥∞≤τη\|c\mathbf{s}_1\|_\infty \le \tau\eta and identify the worst case.

Answer. Each coefficient of the product cs1c \mathbf{s}_1 in RqR_q is a sum of terms ci⋅sjc_i \cdot s_j where the indices combine to the output position, with a sign flip from Xn=−1X^n = -1 where they wrap.

Only τ\tau of the cic_i are non-zero, and each is ±1\pm 1. So the sum has at most τ\tau non-zero terms, each of absolute value at most ∣sj∣≤η|s_j| \le \eta. Hence

∥cs1∥∞  ≤  τ⋅1⋅η  =  τη  =  β.\|c\mathbf{s}_1\|_\infty \;\le\; \tau \cdot 1 \cdot \eta \;=\; \tau\eta \;=\; \beta .

Equality needs all τ\tau terms landing on the same output coefficient to have the same sign after the negacyclic flip, and every corresponding sjs_j to be at its extreme ±η\pm\eta. That is an alignment of τ\tau independent choices, so it essentially never occurs, and the real distribution of ∥cs1∥∞\|c\mathbf{s}_1\|_\infty sits far below β\beta.

Using the worst case anyway is deliberate. The rejection rule has to be safe for every possible secret, not for a typical one, or the argument in exercise 1 fails.

07.7. Why the loop reseeds deterministically

Answer. Each attempt needs a fresh y\mathbf{y}, and the obvious way is to draw new randomness every time. ML-DSA instead derives y\mathbf{y} deterministically from the key salt KK, the message digest, and a counter that increments per attempt.

The reason is fault and randomness robustness. If the platform's randomness source is weak or repeats, a fresh-randomness signer could produce two different signatures on the same message with the same y\mathbf{y}, and subtracting them recovers cs1c\mathbf{s}_1 for two different challenges, which gives s1\mathbf{s}_1. That is precisely the failure that broke the PlayStation 3's ECDSA implementation, mentioned in What a Signature Is.

Deriving y\mathbf{y} from a counter makes repetition impossible without repeating the counter, which the signer controls. It also makes signing deterministic and therefore testable against fixed vectors, which matters for a standard.

An attacker watching many restarts learns the number of attempts, which is public, and nothing else. The values that failed are discarded and never released, and the counter is not secret.

FeedbackBook mode
post-quantum-cryptographycryptographymathematics