Documentation

CslibFrontier.Crypto.Computational.SchnorrSignature.NativeROM

Native sampled Schnorr signing and verification in the ROM #

The actual signer samples sampleExp, normalizes the nonce, hashes the encoded message/commitment pair, reads at most the challenge width, and invokes the existing response arithmetic. The verifier uses the existing total signature-pair decoder and sole canonical-recovery verifier. Runtime certificates charge the full inputs and apply even to arbitrary external replies.

The semantic comparison uses caches whose answers are BitString m; every cached answer therefore has exactly the required width. It does not identify arbitrary raw-word caches with that typed oracle. The per-signature error comes from the actual nonce sampler, separately from the existing key-generation error closeTo_schnorrSigKeyGen, also at most 2⁻ⁿ. Adaptive game composition and efficient forking remain separate obligations.

Main definitions #

Main results #

References #

Original native realization of the existing Schnorr ROM instance, using the sampling law already proved for sampleExp and the arithmetic algorithms from SchnorrSignature.lean.

Sample a nonce, normalize it modulo the actual group order, and sign using one hash query. Only the first m reply bits are read, including for arbitrary malformed or overlong replies.

Decode the signature with the existing total pair decoder, hash its message/commitment point, and invoke the sole native verifier. Only the first m reply bits are read.

The actual signer is uniformly strict oracle-PPT in the full security parameter, group description, challenge width, secret key and message. Both numeric parameters are unary.

The native verifier is uniformly strict oracle-PPT in the full description, unary challenge width, public key, message and signature word, for every external oracle reply.

theorem Cslib.Crypto.PrimeOrderGroupFamily.runWith_schnorrROMSign (F : PrimeOrderGroupFamily) (d : F.Desc) {m : ℕ} (hm : 2 ^ m ≤ F.order d) {Store : Type} (reply : List Bool → StateT Store PMF (BitString m)) (n : ℕ) (x : ZMod (F.order d)) (u : F.Carrier d) (msg : List Bool) (state : Store) :

Exact joint realization of sampled signing under any stateful m-bit hash oracle. The nonce law is the actual sampler mapped modulo the order; no coupling or uniform-sampling equality is assumed. The external state is retained alongside the encoded signature.

theorem Cslib.Crypto.PrimeOrderGroupFamily.runWith_schnorrROMVerify (F : PrimeOrderGroupFamily) (d : F.Desc) {m : ℕ} (hm : 2 ^ m ≤ F.order d) {Store : Type} (reply : List Bool → StateT Store PMF (BitString m)) (u : F.Carrier d) (msg sig : List Bool) (state : Store) :

Verification agrees exactly with the word ROM scheme after the existing total outer-signature pair decoder. The equality retains all external state and permits arbitrary signature words.

theorem Cslib.Crypto.PrimeOrderGroupFamily.closeTo_runWith_schnorrROMSign (F : PrimeOrderGroupFamily) (d : F.Desc) {m : ℕ} (hm : 2 ^ m ≤ F.order d) {Store : Type} (reply : List Bool → StateT Store PMF (BitString m)) (n : ℕ) (x : ZMod (F.order d)) (u : F.Carrier d) (msg : List Bool) (state : Store) :
Probability.CloseTo (((F.schnorrWordROMScheme d hm).signCoins (x, u) msg).bind fun (coins : (F.schnorrWordROMScheme d hm).SignCoins) => PMF.map (Prod.map (⇑(Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits)) id) (OracleComp.runWith reply ((F.schnorrWordROMScheme d hm).sign (x, u) msg coins) state)) (ProbOracleComp.runWith (fun (q : Unit × List Bool) (st : Store) => PMF.map (Prod.map List.ofFn id) (reply q.2 st)) (F.schnorrROMSign n d m ((F.encScalar d) x) msg) state) ↑(1 / 2 ^ n)

Replacing the actual nonce sampler by the ideal word-ROM signing law changes the joint signature/external-state law by at most 2⁻ⁿ. This holds for every stateful m-bit reply handler, so in particular for the shared memoized oracle at every typed cache. The error is paid once, through a common continuation; no assumption about a coupling is needed.