Documentation

CslibFrontier.Crypto.Computational.SchnorrSignature

Computational Schnorr signatures under the discrete-logarithm assumption #

Schnorr's signature scheme ([Sch91]; [BS23], Sections 19.2–19.3) applies the Fiat–Shamir transform ([FS87]; [PS00]) to Schnorr's identification protocol over a PrimeOrderGroupFamily F:

  1. Bit-encoded Schnorr signature operations and strict-PPT certificates:

    • Key generation (schnorrSigKeyGen): at security parameter n and group description d, samples sk ← F.sampleExp n d (ProbComp.sampleModNat) and outputs the encoded public key F.smul (d, sk, F.encode d (F.generator d)) (encode (sk • g)) and encoded secret key (sk % F.order d).bits. It is uniform strict PPT (isPPTOn_schnorrSigKeyGen) and within statistical distance 1 / 2 ^ n of the ideal encoded Schnorr key generator (closeTo_schnorrSigKeyGen).
    • Commitment, response, and signing (schnorrCommitBits, schnorrRespondBits, schnorrSignCoins): given the description d, encoded secret key sk, message msg, commitment randomness r, and k n-bit random-oracle challenge roOut, computes the encoded commitment t = r • g and response z = (r + roOut * sk) mod q, both certified in ComputableInPolyTime and IsPPTOn.
    • Verification and commitment recovery (schnorrSigVerifyBits, schnorrRecoverCommitBits): compares the commitment word with the canonical recovery of z • g - roOut • pk. Under a canonical public key, acceptance forces a canonical commitment without a decoder. Both operations run in polynomial time (computableInPolyTime_schnorrSigVerifyBits, computableInPolyTime_schnorrRecoverCommitBits), with exact completeness on honest signatures (schnorrSigVerifyBits_schnorrSignCoins).
  2. The discrete-logarithm game in one group: in F.Carrier d, the one-way game of the typed key generator schnorrKeyGen (F.generator d) is the exact discrete-logarithm experiment (oneWayGame_schnorrKeyGen_eq).

Scope. This module provides the algorithms and their certificates. EUF-CMA security of the native scheme under F.DiscreteLog, for every oracle-PPT forger, is DiscreteLog.eufCma_schnorrNativeROMScheme in CslibFrontier.Crypto.Computational.SchnorrSignature.Security, through a certified native forking reduction; that proof uses oneWayGame_schnorrKeyGen_eq. The concrete typed bound for any group, challenge set and call-bounded forger is schnorr_succProbability_eufCmaGame_le_ideal in CslibFrontier.Crypto.Protocols.SigmaProtocol.SchnorrSignature. Strict-PPT identification and eavesdropping security under F.DiscreteLog are negligible_schnorrDirectProbGame and schnorr_isProbEavesdropSecure_of_discreteLogHard in SchnorrEavesdrop.

Main definitions #

Main results #

References #

1. Bit-encoded Schnorr signature algorithms and strict-PPT certificates #

Deterministic bit-encoded Schnorr signing from explicit coins and a random-oracle challenge ([BS23], Section 19.2): given (d, sk, msg, r, roOut) where r is the commitment randomness and roOut is the random-oracle digest on (msg, encode (r • g)), output the encoded signature (t, z) = (schnorrCommitBits (d, r), schnorrRespondBits (d, sk, r, roOut)). This arithmetic kernel takes roOut as an input; its caller must obtain it from the shared hash oracle. The message is not used again once that challenge has been supplied.

@[simp]
theorem Cslib.Crypto.PrimeOrderGroupFamily.schnorrSignCoins_encScalar (F : PrimeOrderGroupFamily) (d : F.Desc) (α r : ZMod (F.order d)) (msg roOut : List Bool) :
F.schnorrSignCoins (d, (F.encScalar d) α, msg, (F.encScalar d) r, roOut) = (F.encode d (r • F.generator d), (F.encScalar d) (r + ↑(Turing.MultiTapeTM.ofBits roOut) * α))

On encoded scalars α, r : ZMod (F.order d), schnorrSignCoins outputs the encoded commitment r • g and response r + c * α.

Bit-encoded Schnorr signature verification ([BS23], Section 19.2): given (d, pk, msg, (t, z), roOut) where roOut is the random-oracle challenge for (msg, t), compare t with the canonical encoding of z • g - roOut • pk via encodeSchnorrVerify. For a canonical public key this rejects noncanonical commitments without requiring a group-membership decoder. This checks the algebraic equation for a supplied challenge; the caller must enforce roOut = H(msg, t) in the same oracle world used by the signer and adversary.

On encoded group elements pk = F.encode d u and t = F.encode d T, schnorrSigVerifyBits decides Schnorr's verification equation z • g = T + c • u.

Completeness of bit-encoded Schnorr signing and verification: every signature produced by schnorrSignCoins on a key pair (encode (α • g), encScalar α) verifies under schnorrSigVerifyBits with the same random-oracle challenge roOut.

Verification compares the supplied commitment with public commitment recovery on all words, including malformed inputs.

Under a canonical public key, acceptance forces the exact canonical recovered commitment. The response and supplied challenge are arbitrary words, interpreted as scalars modulo the order. No encoding-range conclusion is asserted for malformed public keys.

Every accepted commitment is in the encoding range when the public key is canonical.

2. The discrete-logarithm game in one group #

In F.Carrier d, the one-way game for schnorrKeyGen (F.generator d) is the exact discrete-logarithm experiment: draw α ← PMF.uniformOfFintype (ZMod (F.order d)), run B (α • g), and accept when the output equals α.