Documentation

CslibFrontier.Crypto.Computational.Signature.RandomOracle

Signature schemes as random-oracle signature schemes #

A signature scheme that never queries a random oracle is a random-oracle signature scheme (ROMSignature.Scheme, [BS23], Section 13.2.1) with no oracle points: Query is Empty. Signature.Scheme.toROM is this view; its signing coins are the signature itself.

Its random-oracle forgery experiment ROMSignature.worldGame, against the forger Signature.Forger.toROM A, is the forgery experiment of the scheme against A, for every freshness condition (Signature.Scheme.worldGame_toROM). The random-oracle experiment keeps the signed pairs newest first and the forgery experiment oldest first. In particular, the random-oracle EUF-CMA and SUF-CMA experiments of S.toROM are S.eufCmaExperiment and S.sufCmaExperiment.

Through SignatureScheme.toScheme, the word-level EUF-CMA games are random-oracle experiments too, and honest signatures of n-bit messages verify in (S.toScheme n).toROM.

Main definitions #

Main results #

References #

noncomputable def Cslib.Crypto.Signature.Scheme.toROM {PK SK M Sig : Type} (S : Scheme PK SK M Sig) :

The scheme S as a random-oracle signature scheme with no oracle points: the signing coins are the signature drawn by S.sign, and signing and verification make no oracle calls.

@[simp]
theorem Cslib.Crypto.Signature.Scheme.toROM_keyGen {PK SK M Sig : Type} (S : Scheme PK SK M Sig) :
@[simp]
theorem Cslib.Crypto.Signature.Scheme.toROM_verify {PK SK M Sig : Type} (S : Scheme PK SK M Sig) (pk : PK) (m : M) (σ : Sig) :
S.toROM.verify pk m σ = pure (S.verify pk m σ)

The forger A as a random-oracle forger: each signing query m becomes the signing call .inl m, and private sampling is unchanged. It makes no hash calls.

theorem Cslib.Crypto.Signature.Scheme.correctOn_toROM {PK SK M Sig : Type} {S : Scheme PK SK M Sig} {adm : M → Prop} (h : ∀ keys ∈ S.keyGen.eval.support, ∀ (m : M), adm m → ∀ σ ∈ (S.sign keys.2 m).eval.support, S.verify keys.1 m σ = true) :

S.toROM is correct on the messages satisfying adm when every honest signature on such a message verifies under S.

theorem Cslib.Crypto.Signature.Scheme.correct_toROM {PK SK M Sig : Type} {S : Scheme PK SK M Sig} (h : S.Correct) :

A correct scheme is a correct random-oracle scheme.

theorem Cslib.Crypto.Signature.Scheme.worldGame_toROM {PK SK M Sig : Type} [Inhabited Sig] (S : Scheme PK SK M Sig) (fresh : M → Sig → List (M × Sig) → Bool) (A : Forger PK M Sig) :
(Protocols.ROMSignature.worldGame S.toROM A.toROM fun (verified : Bool) (x : M × Sig) (pairs : List (M × Sig)) => match x with | (m, σ) => verified && fresh m σ pairs.reverse) = ProbComp.eval (forgeExperiment S.keyGen (Signer.ofSign S.sign) (fun (pk : PK) (x : SK) => S.verify pk) fresh A)

The random-oracle experiment of S.toROM is the forgery experiment of S: for every freshness condition fresh, the random-oracle experiment that accepts a verified candidate fresh for the signed pairs (newest first) has the distribution of forgeExperiment with fresh.

theorem Cslib.Crypto.Signature.Scheme.worldGame_toROM_eufCma {PK SK M Sig : Type} [Inhabited Sig] [DecidableEq M] (S : Scheme PK SK M Sig) (A : Forger PK M Sig) :
(Protocols.ROMSignature.worldGame S.toROM A.toROM fun (verified : Bool) (x : M × Sig) (pairs : List (M × Sig)) => match x with | (m, snd) => verified && !(List.map Prod.fst pairs).contains m) = ProbComp.eval (S.eufCmaExperiment A)

The random-oracle EUF-CMA experiment of S.toROM is S.eufCmaExperiment.

theorem Cslib.Crypto.Signature.Scheme.worldGame_toROM_sufCma {PK SK M Sig : Type} [Inhabited Sig] [DecidableEq M] [DecidableEq Sig] (S : Scheme PK SK M Sig) (A : Forger PK M Sig) :
(Protocols.ROMSignature.worldGame S.toROM A.toROM fun (verified : Bool) (msig : M × Sig) (pairs : List (M × Sig)) => verified && !pairs.contains msig) = ProbComp.eval (S.sufCmaExperiment A)

The random-oracle SUF-CMA experiment of S.toROM is S.sufCmaExperiment.

theorem Cslib.Crypto.SignatureScheme.eufCmaGame_eq_worldGame_toROM (S : SignatureScheme) (adversary : Forger) (n : ℕ) :
(S.eufCmaGame adversary n).eval = Protocols.ROMSignature.worldGame (S.toScheme n).toROM (adversary.toTyped n).toROM fun (verified : Bool) (x : List Bool × List Bool) (pairs : List (List Bool × List Bool)) => match x with | (m, snd) => verified && !(List.map Prod.fst pairs).contains m

At each parameter n, the word-level EUF-CMA game is the random-oracle EUF-CMA experiment of (S.toScheme n).toROM.

At each parameter n, honest signatures of n-bit messages verify in (S.toScheme n).toROM.

theorem Cslib.Crypto.WordSignatureScheme.eufCmaGame_eq_worldGame_toROM (S : WordSignatureScheme) (adversary : Forger) (n : ℕ) :
(S.eufCmaGame adversary n).eval = Protocols.ROMSignature.worldGame (S.toScheme n).toROM (adversary.toTyped n).toROM fun (verified : Bool) (x : List Bool × List Bool) (pairs : List (List Bool × List Bool)) => match x with | (m, snd) => verified && !(List.map Prod.fst pairs).contains m

At each parameter n, the unrestricted word-level EUF-CMA game is the random-oracle EUF-CMA experiment of (S.toScheme n).toROM.

At each parameter n, (S.toScheme n).toROM is correct on every message.