Exercises
August 25, 20266 min readbeginner
Argue why the implicit-rejection value z has to live inside sk and be uniformly random, rather than being, say, a hash of pk. What attack opens up if z is predictable?
01.1. Why the rejection seed must be secret and random
Argue why the implicit-rejection value has to live inside and be uniformly random, rather than being, say, a hash of . What attack opens up if is predictable?
Answer. The whole point of implicit rejection in The Fujisaki-Okamoto Wrapper is that an attacker cannot tell an accepted ciphertext from a rejected one, because both return 32 pseudorandom bytes.
If were derived from , the attacker would know it, since is public. They could then compute the rejection key themselves for any they send, compare it against the key the session actually uses, and learn whether their ciphertext was accepted.
That restores the decryption oracle the transform exists to remove. With it, the attacker submits perturbed ciphertexts, learns which ones decrypt correctly, and each answer constrains the secret, exactly the attack sketched in The KEM Contract.
So must be unpredictable to anybody without , which means uniformly random and stored privately. It must also be fixed per key, not per call, so that the same bad ciphertext always yields the same wrong key. A fresh random value each time would let an attacker detect rejection by sending the same ciphertext twice and seeing different answers.
02.2. The worst-case error bound
For ML-KEM-768, compute an upper bound on assuming every centred binomial coefficient takes its extreme value and every compression error is maximal. Is it below ?
Answer. Take the terms of from Why Decryption Works one at a time, with , , .
: three ring products, each output coefficient a sum of terms bounded by . Bound .
: a single coefficient, bound .
: same shape as the first, bound .
: the compression error on is bounded by , and it is multiplied by , giving .
: alone, bounded by .
Total: about .
No, it is not below . It exceeds by more than a factor of ten.
That is the answer, and it is the point of the exercise. The worst case fails, so correctness cannot be an absolute guarantee. It is probabilistic, and the published bound of at this level is a statement about the far tail of a distribution rather than about a maximum.
Reaching would require all coefficients of two independent secrets to simultaneously sit at their extremes with matching signs. Each such coefficient hits with probability , so the event is astronomically unlikely, and the concentration bounds that produce are the formalisation of that.
3. Why
Answer. From the error equation, compression noise on enters as , multiplied by the secret. That multiplication is a full ring product summing terms, so the noise is amplified by roughly before it reaches the budget.
Compression noise on enters as , alone. Nothing multiplies it.
The arithmetic in exercise 2 makes the ratio concrete: is bounded by and contributes to the budget, while is bounded by and contributes . So must be compressed gently at and can be compressed hard at , and they still cost comparable amounts.
04.4. Complete the toy example
Answer. Fully worked in A Worked Toy Example. Key generation gives and . Encryption gives , , and . Decryption gives , whose constant coefficient is exactly , so the bit decodes as .
The instructive part is the last coefficient, , against a tolerance of . That is a genuine decryption failure on a coefficient carrying no message, and it is what exercise 2's bound predicts at these parameters.
05.5. The cost of re-encryption
Count the extra ring multiplications decapsulation performs relative to a bare decryption, and speculate on why this is preferred over a MAC.
Answer. Bare decryption is one inner product , so ring multiplications, three at ML-KEM-768.
Re-encryption repeats the whole encryption: is products, plus is another . So twelve extra, four times the cost of the decryption itself.
Why not a MAC instead? A MAC would need a key, and that key would have to be derived from something both parties share. Before decapsulation completes, they share nothing except the public key, which the attacker also has. So a MAC key would have to come from the very secret the ciphertext is establishing, which is circular.
Re-encryption avoids the circularity by checking the ciphertext against itself: it is valid exactly when it is the unique ciphertext that this message and this derived randomness produce. That check needs no shared secret, only determinism, which is why the transform makes encryption deterministic in the first place.
06.6. Confirm the sizes
Answer. For , , , :
Uncompressed the ciphertext would be bytes, so the compressed form is of it, a saving of just over .
07.7. Why the transpose is essential
Answer. The cancellation in Why Decryption Works works because , so substituting it produces a term that exactly matches the one arriving from .
If encryption used instead of , then and decryption would compute , while the substitution still delivers . Since is not symmetric, those are different values and nothing cancels.
What remains would be plus plus the usual noise. That middle term involves a uniform matrix and is large, not small, so it swamps the message entirely and every coefficient decodes at random.
The failure mode is worth knowing because it is silent in the wrong way. Key generation succeeds, encryption succeeds, ciphertexts are the right size, and decryption returns uniformly random bits. Nothing errors.