Documentation

CslibFrontier.Crypto.Game.CloseTo.RejectedProgramming

Erasing writes at rejected random-oracle programming trials #

Each trial samples fresh coins, writes its digest at a point determined by those coins, and returns an optional response. A second oracle hides rejected writes. Adaptive direct hash queries use the resulting table. If every trial address has point mass at most δ, the visible laws for T trials and H direct queries differ by at most T H δ.

The hidden-point argument retains the original coins in the joint law. This permits rejection to depend on both the point and digest, while charging only the unconditional guessing probability of the point. This is an original game lemma for classical signing with aborts.

def Cslib.RandomOracle.programmedTrialStep {Key Ω Msg Value Out : Type} [BEq Key] (writeAborts : Bool) (point : Msg → Ω → Key) (digest : Ω → Value) (reply : Msg → Ω → Option Out) (q : Msg ⊕ Key) :
Ω → List (Key × Value) → OracleSpec.sum (fun (x : Msg) => Option Out) (fun (x : Key) => Value) q × List (Key × Value)

A single trial draws its external coins, returns an optional reply and writes its digest at its sampled point on success. The all-write mode also writes the digest on rejection. Direct requests perform lazy lookup, using the supplied fresh digest on a miss.

theorem Cslib.RandomOracle.closeTo_eraseRejectedTrialWrites {Key Ω α Msg Value Out : Type} [BEq Key] [LawfulBEq Key] (μ : PMF Ω) (point : Msg → Ω → Key) (digest : Ω → Value) (reply : Msg → Ω → Option Out) {program : OracleComp (OracleSpec.sum (fun (x : Msg) => Option Out) fun (x : Key) => Value) α} {T H : ℕ} (hs : OracleComp.IsCostBounded (Sum.elim (fun (x : Msg) => 1) fun (x : Key) => 0) program T) (hh : OracleComp.IsCostBounded (Sum.elim (fun (x : Msg) => 0) fun (x : Key) => 1) program H) {δ : ENNReal} (hδ : ∀ (m : Msg) (k : Key), (PMF.map (point m) μ) k ≤ δ) (st : List (Key × Value)) :
Probability.CloseTo (PMF.map Prod.fst ((OracleComp.interpret (fun (q : Msg ⊕ Key) (s : List (Key × Value)) => PMF.map (fun (x : Ω) => programmedTrialStep true point digest reply q x s) μ) program).run st)) (PMF.map Prod.fst ((OracleComp.interpret (fun (q : Msg ⊕ Key) (s : List (Key × Value)) => PMF.map (fun (x : Ω) => programmedTrialStep false point digest reply q x s) μ) program).run st)) (↑T * (↑H * δ))

Erasing the writes of rejected trials changes the visible result of a program with at most T trials and H direct reads by at most T H δ. Here δ bounds the largest atom of each unconditioned trial address. Rejection can depend on the address and digest. Both executions sample fresh coins at each operation, and share one table across all operations.