Documentation

CslibFrontier.Crypto.Computational.MLDSA.KeySeedSearch

Private signing-seed prediction and the key-generation query #

FIPS 204, Algorithm 6, line 1, expands the key-generation seed and the two dimension bytes into 128 bytes. The last 32 bytes are the signing seed K.

keySeedDeviceGame_true identifies the original prediction experiment with one in which only the quantum device can access that programmed input. Signing uses the independent mask-seed rows of signingSeedPredictionGame, including its fallback after the tape of n rows is exhausted. The background device predicts K with probability at most 2 / 2^256 and encounters a changed response at each fixed query with probability at most 1 / 2^256.

For any retained density matrix independent of the hidden input seed, the mean squared amplitude displacement of one coherent query by the installed expansion is at most 4 / 2^256. The same bound holds for the mean square change in the square root of the acceptance probability of any seed-dependent measurement after that query.

Install the 128-byte Algorithm 6 expansion at its raw SHAKE256 input, preserving the suffix.

Algorithm 6 reads precisely the installed expansion bytes.

noncomputable def Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.keySeedDeviceGame (C : QuantumSigningForger) (s : Level) (base : Xofs) (a b n j : ℕ) (planted : Bool) :

Predict the private signing seed in an experiment with an independently drawn expansion. Both runs use the same generated public key, its hash, and the same independent mask-seed rows for adaptive signing requests. With planted the device sees the 128 expansion bytes at the FIPS key-generation address. Otherwise all its coherent queries use the original background table.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.keySeedDeviceGame_true (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b : ℕ} (ha : 272 ≤ a) (hb : 128 ≤ b) (n j : ℕ) :
C.keySeedDeviceGame s base a b n j true = C.signingSeedPredictionGame s base a b n j

Programming the expansion at the hidden input reproduces the original prediction experiment exactly, including the encoded public key, signing replies and failed setup.

With background coherent access, even an adaptive signed execution gives at most two guesses for an independent uniform 32-byte private signing seed.

Measure the selected coherent address of the background device. Test whether the XOR response at that address would change if the 128-byte key expansion were installed.

At each query of the background device, the probability of detecting the programmed key-generation response is at most 2⁻²⁵⁶, including after adaptive signing and measurements.

For any retained reference state independent of the hidden 32-byte key-generation seed, the mean squared displacement of the actual XOR gate when the 128 expansion bytes are installed is at most 4 / 2^256. The state and expansion may depend on the entire background table. The device can request any number of response bytes.

Apply any binary measurement after the native query, allowing the measurement to depend on the hidden seed. For a seed-independent input state, the mean square change in the square root of the acceptance probability is at most 4 / 2^256.