Documentation

CslibFrontier.Crypto.Computational.MLDSA.MaskSeedQuery

Measuring the address of a coherent ML-DSA hash query #

Run the background-oracle side of the mask-seed comparison from the strong-forgery bound. At the selected coherent call measure the XOR address. The event tests whether the two actual query tables return different words there. The execution up to the measurement includes the forger's adaptive classical signing requests and earlier coherent operations.

For a budget of n signatures the probability of this event is at most 2 * n / 2^256. The sharper bound multiplies this coefficient by the probability that a candidate from the public-key hash or the measured SHAKE256 input predicts the 32-byte private signing seed K.

A coherent raw XOF query, charged once against the device query budget.

noncomputable def Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.maskSeedQueryHit (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n : ℕ} (ha : 1024 ≤ a) (hb : 64 ≤ b) (hsize : n ≤ 2 ^ 256) (j : ℕ) :

Measure the address just before coherent query number j (zero based) in the background-device experiment. Signing uses the shared programmed XOFs. Return true if the two XOR tables differ at the measured address. Early termination and failed setup lose.

Predict the 32-byte private signing seed K in the encoded FIPS 204 private key. The candidates are the first 32 bytes of the public-key hash and the first 256 input bits at the selected SHAKE256 query, using independent mask-seed rows. The experiment makes one extra 64-byte SHAKE256 read at the published key on successful key generation, independently of the forger's register widths. Missing candidates cannot win.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.maskSeedQueryHit_le_signingSeedPrediction (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n : ℕ} (ha : 1024 ≤ a) (hb : 64 ≤ b) (hn : C.SigningCallsLe n) (hsize : n ≤ 2 ^ 256) (j : ℕ) :
↑(C.maskSeedQueryHit s base ha hb hsize j).succProbability ≤ 2 * ↑n / 2 ^ 256 * ↑(C.signingSeedPredictionGame s base a b n j).succProbability

Detecting a changed row requires the hedge tape to cover a candidate and the private signing seed K to match one of two predicted prefixes in the independent background execution.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.maskSeedQueryHit_le (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b n : ℕ} (ha : 1024 ≤ a) (hb : 64 ≤ b) (hn : C.SigningCallsLe n) (hsize : n ≤ 2 ^ 256) (j : ℕ) :
↑(C.maskSeedQueryHit s base ha hb hsize j).succProbability ≤ 2 * ↑n / 2 ^ 256

For every adaptive forger and every fixed coherent query index, the probability of measuring an address at which the two actual XOR tables differ is at most twice the signing budget divided by the 256-bit hedge space.