Documentation

CslibFrontier.Crypto.Computational.SchnorrSignature.EncodedROM

Encoded Schnorr signatures in the shared random-oracle game #

The existing ROMSignature.Scheme can expose word public keys and outer signature words while retaining the sole native verifier. Key and nonce laws are explicit: the representation bridge does not identify actual sampling with uniform sampling. A forger receives encoded canonical public keys and signing replies; all hash words remain unchanged, and every final signature word is processed by the existing total pair decoder, without a framing rejection.

Main definitions #

Main results #

Actual key-generation and adaptive signing errors, and native realization of the full forking reduction, remain separate obligations. No efficient public-key decoder is assumed or introduced.

References #

Original representation adapters for the existing Schnorr ROM scheme and native algorithms.

The concrete word interface with explicit key and scalar-nonce laws. Verification accepts exactly what the existing native verifier accepts after total pair decoding, even when the outer signature is not a pair encoding. Malformed public keys receive the native algorithm's behavior; the representation theorem uses only encoded group public keys.

The Schnorr signature scheme in the random-oracle model, as the native algorithms run it, at security parameter n, group description d and challenge width m: keys come from the actual key generator schnorrSigKeyGen and nonces from the actual sampler sampleExp, whose laws are only statistically close to uniform. Public keys, messages, signatures and hash points are words, and challenges are m-bit strings.

Adapt an existing word forger without changing its coins or hash queries. Signing replies are encoded, the public key is encoded, and the final outer signature is total-decoded.

Both call budgets are preserved on every public key and every forger coin value.

Canonical scalar keys make encoded signing exactly the encoding of word-pair signing.

Total signature decoding agrees with the word-pair verifier for every outer word.

theorem Cslib.Crypto.PrimeOrderGroupFamily.runWith_schnorrROMSign_encoded (F : PrimeOrderGroupFamily) (d : F.Desc) {m : ℕ} (hm : 2 ^ m ≤ F.order d) (keyLaw : PMF (List Bool × List Bool)) (n : ℕ) (x : ZMod (F.order d)) {Store : Type} (reply : List Bool → StateT Store PMF (BitString m)) (msg : List Bool) (state : Store) :
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 = ((F.schnorrEncodedROMScheme d m keyLaw (PMF.map Nat.cast (F.sampleExp n d).eval)).signCoins ((F.encScalar d) x) msg).bind fun (r : (F.schnorrEncodedROMScheme d m keyLaw (PMF.map Nat.cast (F.sampleExp n d).eval)).SignCoins) => OracleComp.runWith reply ((F.schnorrEncodedROMScheme d m keyLaw (PMF.map Nat.cast (F.sampleExp n d).eval)).sign ((F.encScalar d) x) msg r) state

The native signer realizes the encoded scheme with the actual scalar-nonce law, retaining arbitrary external state. This is an exact actual-sampling law, not a uniform-sampling claim.

theorem Cslib.Crypto.PrimeOrderGroupFamily.runWith_schnorrROMVerify_encoded (F : PrimeOrderGroupFamily) (d : F.Desc) {m : ℕ} (hm : 2 ^ m ≤ F.order d) (keyLaw : PMF (List Bool × List Bool)) (nonceLaw : PMF (ZMod (F.order d))) (u : F.Carrier d) {Store : Type} (reply : List Bool → StateT Store PMF (BitString m)) (msg sig : List Bool) (state : Store) :
ProbOracleComp.runWith (fun (q : Unit × List Bool) (st : Store) => PMF.map (Prod.map List.ofFn id) (reply q.2 st)) (F.schnorrROMVerify d m (F.encode d u) msg sig) state = OracleComp.runWith reply ((F.schnorrEncodedROMScheme d m keyLaw nonceLaw).verify (F.encode d u) msg sig) state

The native verifier realizes the encoded scheme for every outer signature word and every starting state, under canonical public keys and typed-width hash replies.

theorem Cslib.Crypto.PrimeOrderGroupFamily.schnorrEncodedROMScheme_keyGen_ideal (F : PrimeOrderGroupFamily) (d : F.Desc) {m : ℕ} (hm : 2 ^ m ≤ F.order d) (nonceLaw : PMF (ZMod (F.order d))) :
(F.schnorrEncodedROMScheme d m (F.schnorrIdealKeyGen d) nonceLaw).keyGen = PMF.map (fun (x : F.Carrier d × ZMod (F.order d) × F.Carrier d) => match x with | (pk, sk, snd) => (F.encode d pk, (F.encScalar d) sk)) (F.schnorrWordROMScheme d hm).keyGen

Ideal key generation is exactly the encoding of the canonical word-ROM key law. The actual native key law remains separate and is compared by closeTo_schnorrSigKeyGen.

Ideal signing preserves the joint encoded signature and external state. The hash handler is arbitrary, so the law applies to every starting shared cache, including junk query entries.

In the ideal specialization the adapted forger preserves the complete shared cache and message log. Every final signature word is decoded, with no image or canonicality premise.

Exact equality of the existing ideal EUF-CMA games after changing key and signature representations. All outer signature words are total-decoded, every hash word remains distinct, and freshness depends only on the unchanged final message and signing log. Actual key and nonce sampling require separate statistical transport.