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 uniform on , , , and acceptance when , prove that the accepted is uniform on independent of .
Answer. Before conditioning, is uniform on the shifted interval , which has width and so has density at every point inside it.
Call the acceptance region .
The key step is that for every admissible . The left endpoint needs , which holds because . The right endpoint needs , which holds because . So sits inside the shifted interval no matter what is.
Therefore the density of is the constant at every point of , regardless of . Conditioning on renormalises that constant over , giving the uniform distribution on with density .
The result mentions and only, both public. So the accepted values carry no information about , which is the property the security proof needs.
Note what would break it. If could exceed , then would poke outside the shifted interval on one side, that part would have density zero, and the shift would be visible again. The bound is therefore not a convenience but a correctness condition, which is why is derived rather than chosen.
02.2. Acceptance rate for ML-DSA-65
Estimate the per-attempt acceptance probability for , , , , assuming coefficients are independent. What is the expected number of restarts?
Answer. Per coefficient,
There are coefficients in , so the joint probability is
giving about attempts expected.
That is the bound from the 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 and exploit that with symmetric about zero.
Since , taking expectations gives . So averaging the released responses grouped by challenge estimates directly, and dividing out the known recovers .
More practically, an attacker computes over many signatures. The contributions are independent and mean-zero so they average towards nothing, while the contribution is the same every time and accumulates linearly. The signal-to-noise ratio grows like , so a few thousand signatures suffice.
Why the Naive Version Leaks runs the one-coordinate version: 400,000 samples recover a secret of as , and with rejection the same estimator returns .
4. Toy key generation over
Answer. With , decomposing means splitting each coefficient into a multiple of plus a remainder centred on zero, so and therefore , as required.
Concretely, a coefficient of decomposes as , giving and . A coefficient of gives , so and , taking the nearest multiple rather than rounding down. That centring is what keeps rather than , 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 , exactly a Module-LWE sample, so recovering from 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 , 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 and identify the worst case.
Answer. Each coefficient of the product in is a sum of terms where the indices combine to the output position, with a sign flip from where they wrap.
Only of the are non-zero, and each is . So the sum has at most non-zero terms, each of absolute value at most . Hence
Equality needs all terms landing on the same output coefficient to have the same sign after the negacyclic flip, and every corresponding to be at its extreme . That is an alignment of independent choices, so it essentially never occurs, and the real distribution of sits far below .
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 , and the obvious way is to draw new randomness every time. ML-DSA instead derives deterministically from the key salt , 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 , and subtracting them recovers for two different challenges, which gives . That is precisely the failure that broke the PlayStation 3's ECDSA implementation, mentioned in What a Signature Is.
Deriving 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.