Documentation

CslibFrontier.Crypto.Computational.MLDSA.SecretRowServices

Private expansion rows in the adaptive public-pair signing experiment #

FIPS 204, Algorithms 3, 6 and 8, use the raw SHAKE256 stream for key generation, message representatives and commitment digests. The signing simulator retains terminal writes. When two streams differ only on private expansion inputs, identical terminal writes preserve agreement everywhere else. The public hash matching the secret seed is the one exceptional honest read. The controller can still query the private inputs in superposition.

Apply the exact recorded prefix writes in chronological order to a second raw oracle.

theorem Cslib.Crypto.MLDSA.FIPS204.TerminalSigningWrite.History.replay_eq {s : Level} {H G : Xofs} {tr : List Byte} {ws : List (TerminalSigningWrite s)} (history : History s H tr ws G) :
replay H ws = G

Replaying a certified signing history's terminal writes recovers its final oracle.

Run public-pair signing and final verification on honest. The query device uses device with every prior terminal signing write applied in the same order.

noncomputable def Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.secretRowDeviceGame (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b : ℕ} (ha : 528 ≤ a) (hb : 481 ≤ b) (share : Bool) :

The honest simulator and verifier use the refreshed oracle. The forger's queries use the chosen view with the same signing writes. Failed setup and the exceptional public-key hash match return false before the interaction.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.secretRowDeviceGame_bounds (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b : ℕ} (ha : 528 ≤ a) (hb : 481 ≤ b) :
have native := (base.uniformPrefixes a b).bind fun (H : Xofs) => H.fullPairExperiment s fun (rho : FixedBytes 32) (pk : PublicKey s.params) => PMF.map (fun (x : C.ProgrammedSigningResult s H) => x.trial.newDigestWin) (C.publicPairSigning s H rho pk); native true ≤ (C.secretRowDeviceGame s base ha hb true) true + (2 ^ 512)⁻¹ ∧ (C.secretRowDeviceGame s base ha hb false) true ≤ (C.independentExpandSGame s base a b) true

Transfer every adaptive signing request and final byte verification to the same refreshed oracle. Only the coherent query device varies between the two middle games. The public-hash exception costs at most 2⁻⁵¹² once over the whole comparison at every FIPS level.

Measure a selected query in the reference public-pair signing experiment and test whether replaying the signing writes on the other device changes the XOR response at that address.

theorem Cslib.Crypto.MLDSA.FIPS204.QuantumSigningForger.secretRow_changedResponse_le (C : QuantumSigningForger) (s : Level) (base : Xofs) {a b : ℕ} (ha : 528 ≤ a) (hb : 481 ≤ b) (share : Bool) (j : ℕ) :
((base.sampleSecretExpansionViews s ha hb).bind fun (v : SecretExpansionViews s) => v.refreshKeySeed.bind fun (H : Xofs) => match v.pair with | none => PMF.pure false | some pk => C.publicPairResponseChange s j (if share = true then v.shared else v.background) H v.publicSeed pk) true ≤ (2 ^ 256)⁻¹

At a chosen coherent query in the refreshed reference execution, measuring the address finds a different XOR response on either source device with probability at most 2⁻²⁵⁶. Both sides replay every prior terminal signature or exhaustion write before comparing all the response bytes requested by the controller.