Documentation

CslibFrontier.Crypto.Protocols.VOLE.ROExtractor

Straight-line ROM VOLE-in-the-head leaf extraction #

This module formalizes straight-line knowledge extraction in the classical random oracle model (ROM) for flat all-but-one 2 ^ d-leaf (one-repetition, µ = 1) leaf_hash::shake-style VOLE-in-the-head vector commitments, together with an adaptive multi-verify bound and a shared verify-gated handler soundness-transfer interface.

Protocol model and extraction mechanism #

Main definitions #

Main results #

Scope and gaps #

References #

Two-Channel leaf_hash::shake ROM Interface and FAEST.Conversion Extraction #

structure Cslib.Crypto.Protocols.VOLE.LeafQuery (d : ℕ) (Seed IV : Type) :

Input query (k, iv, idx) to the leaf_hash::shake-style random oracle H_leaf.

  • seed : Seed

    Leaf root seed key k_idx.

  • iv : IV

    Proof initialization vector iv.

  • index : Fin (2 ^ d)

    Leaf index idx : Fin (2 ^ d).

@[instance_reducible]
instance Cslib.Crypto.Protocols.VOLE.instDecidableEqLeafQuery {d✝ : ℕ} {Seed✝ IV✝ : Type} [DecidableEq Seed✝] [DecidableEq IV✝] :
DecidableEq (LeafQuery d✝ Seed✝ IV✝)
def Cslib.Crypto.Protocols.VOLE.instDecidableEqLeafQuery.decEq {d✝ : ℕ} {Seed✝ IV✝ : Type} [DecidableEq Seed✝] [DecidableEq IV✝] (x✝ x✝¹ : LeafQuery d✝ Seed✝ IV✝) :
Decidable (x✝ = x✝¹)
structure Cslib.Crypto.Protocols.VOLE.LeafOutput (sdLen comLen : ℕ) :

Output (sd, com) of H_leaf(k, iv, idx).

  • seedOut : BitString sdLen

    Expanded leaf seed bits sd_idx.

  • com : BitString comLen

    Leaf commitment digest com_idx.

Instances For
    def Cslib.Crypto.Protocols.VOLE.instDecidableEqLeafOutput.decEq {sdLen✝ comLen✝ : ℕ} (x✝ x✝¹ : LeafOutput sdLen✝ comLen✝) :
    Decidable (x✝ = x✝¹)
    @[instance_reducible]
    instance Cslib.Crypto.Protocols.VOLE.instDecidableEqLeafOutput {sdLen✝ comLen✝ : ℕ} :
    DecidableEq (LeafOutput sdLen✝ comLen✝)
    @[instance_reducible]
    structure Cslib.Crypto.Protocols.VOLE.FSQuery (d comLen rowLen : ℕ) (Stmt IV PreMsg : Type) :

    Input query to the Fiat–Shamir oracle H_FS, hashing (stmt, iv, coms, dCorr, preMsg) before drawing challenge Δ.

    • stmt : Stmt

      Public instance statement.

    • iv : IV

      Proof initialization vector iv.

    • coms : Fin (2 ^ d) → BitString comLen

      Committed leaf digests coms.

    • dCorr : BitString rowLen

      Witness correction d_corr binding w* = decWit (dCorr + u) prior to Δ.

    • preMsg : PreMsg

      Any pre-challenge check commitments fixed prior to Δ.

    @[instance_reducible]
    instance Cslib.Crypto.Protocols.VOLE.instDecidableEqFSQuery {d✝ comLen✝ rowLen✝ : ℕ} {Stmt✝ IV✝ PreMsg✝ : Type} [DecidableEq Stmt✝] [DecidableEq IV✝] [DecidableEq PreMsg✝] :
    DecidableEq (FSQuery d✝ comLen✝ rowLen✝ Stmt✝ IV✝ PreMsg✝)
    def Cslib.Crypto.Protocols.VOLE.instDecidableEqFSQuery.decEq {d✝ comLen✝ rowLen✝ : ℕ} {Stmt✝ IV✝ PreMsg✝ : Type} [DecidableEq Stmt✝] [DecidableEq IV✝] [DecidableEq PreMsg✝] (x✝ x✝¹ : FSQuery d✝ comLen✝ rowLen✝ Stmt✝ IV✝ PreMsg✝) :
    Decidable (x✝ = x✝¹)
    structure Cslib.Crypto.Protocols.VOLE.VOLEITHProof (d comLen rowLen : ℕ) (Seed IV PreMsg : Type) :

    Combined non-interactive leaf_hash::shake VOLEitH proof.

    • iv : IV

      Proof initialization vector iv.

    • coms : Fin (2 ^ d) → BitString comLen

      Leaf commitments coms.

    • dCorr : BitString rowLen

      Witness correction d_corr.

    • preMsg : PreMsg

      Pre-challenge check message.

    • openKeys : Fin (2 ^ d) → Seed

      Opened keys k_idx (checked by verifier for all idx ≠ Δ).

    @[instance_reducible]
    instance Cslib.Crypto.Protocols.VOLE.instDecidableEqVOLEITHProof {d✝ comLen✝ rowLen✝ : ℕ} {Seed✝ IV✝ PreMsg✝ : Type} [DecidableEq Seed✝] [DecidableEq IV✝] [DecidableEq PreMsg✝] :
    DecidableEq (VOLEITHProof d✝ comLen✝ rowLen✝ Seed✝ IV✝ PreMsg✝)
    def Cslib.Crypto.Protocols.VOLE.instDecidableEqVOLEITHProof.decEq {d✝ comLen✝ rowLen✝ : ℕ} {Seed✝ IV✝ PreMsg✝ : Type} [DecidableEq Seed✝] [DecidableEq IV✝] [DecidableEq PreMsg✝] (x✝ x✝¹ : VOLEITHProof d✝ comLen✝ rowLen✝ Seed✝ IV✝ PreMsg✝) :
    Decidable (x✝ = x✝¹)
    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.VOLEITHLeafSpec (d sdLen comLen : ℕ) (Seed IV : Type) :
    OracleSpec (LeafQuery d Seed IV)

    Leaf random-oracle specification H_leaf.

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.VOLEITHFSSpec (d comLen rowLen : ℕ) (Stmt IV PreMsg Chal : Type) :
    OracleSpec (FSQuery d comLen rowLen Stmt IV PreMsg)

    Fiat–Shamir random-oracle specification H_FS.

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.VOLEITHROSpec (d sdLen comLen rowLen : ℕ) (Stmt Seed IV PreMsg Chal : Type) :
    OracleSpec (LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg)

    Two-channel VOLEitH ROM oracle specification: leaf oracle on Sum.inl, Fiat–Shamir oracle on Sum.inr.

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.LeafTrace (d sdLen comLen : ℕ) (Seed IV : Type) :

    Association-list trace recorded by H_leaf.

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.FSTrace (d comLen rowLen : ℕ) (Stmt IV PreMsg Chal : Type) :

    Association-list trace recorded by H_FS.

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.VOLEITHTraceState (d sdLen comLen rowLen : ℕ) (Stmt Seed IV PreMsg Chal : Type) :

    Combined two-channel lazy ROM trace (tr_leaf, tr_FS).

    def Cslib.Crypto.Protocols.VOLE.VOLEITHProof.fsQuery {d comLen rowLen : ℕ} {Stmt Seed IV PreMsg : Type} (stmt : Stmt) (prf : VOLEITHProof d comLen rowLen Seed IV PreMsg) :
    FSQuery d comLen rowLen Stmt IV PreMsg

    Extract the Fiat–Shamir query corresponding to (stmt, prf).

    def Cslib.Crypto.Protocols.VOLE.voleithLeafCost {d comLen rowLen : ℕ} {Stmt Seed IV PreMsg : Type} :
    LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg → ℕ

    Query-cost indicator charging 1 per H_leaf query (0 on H_FS).

    def Cslib.Crypto.Protocols.VOLE.voleithFSCost {d comLen rowLen : ℕ} {Stmt Seed IV PreMsg : Type} :
    LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg → ℕ

    Query-cost indicator charging 1 per H_FS query (0 on H_leaf).

    noncomputable def Cslib.Crypto.Protocols.VOLE.voleithMemoizeProg {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (q : LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) :
    StateT (VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) ProbComp (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal q)

    Two-channel association-list memoizer inside ProbComp, evaluating to RandomOracle.memoizeSum.

    noncomputable def Cslib.Crypto.Protocols.VOLE.voleithMemoize {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (q : LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) :
    StateT (VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) PMF (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal q)

    PMF-level two-channel lazy random-oracle handler for VOLEITHROSpec.

    theorem Cslib.Crypto.Protocols.VOLE.eval_voleithMemoizeProg {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (q : LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) (st : VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) :

    Evaluating voleithMemoizeProg in PMF equals voleithMemoize.

    def Cslib.Crypto.Protocols.VOLE.collectOpenRows {d sdLen comLen rowLen : ℕ} {Seed IV : Type} (expand : BitString sdLen → BitString rowLen) (iv : IV) (openKeys : Fin (2 ^ d) → Seed) (coms : Fin (2 ^ d) → BitString comLen) (hidden : Fin (2 ^ d)) (k : ℕ) :
    k ≤ 2 ^ d → OracleComp (VOLEITHLeafSpec d sdLen comLen Seed IV) (Option (Fin (2 ^ d) → BitString rowLen))

    Query H_leaf for indices i = 1, ..., k - 1 (vIdx ≠ 0) at prover positions pIdx = FAEST.xorIndex i hidden, matching FAEST.verifierRows (0 at position 0).

    def Cslib.Crypto.Protocols.VOLE.voleithVerifyROM {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal : Type} (expand : BitString sdLen → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (stmt : Stmt) (prf : VOLEITHProof d comLen rowLen Seed IV PreMsg) :
    ProbOracleComp (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) Bool

    VOLEitH verifier in the two-channel ROM (VOLEITHROSpec): queries H_FS on prf.fsQuery stmt to draw Δ, opens the 2 ^ d - 1 non-hidden leaves via collectOpenRows, runs FAEST.convertExpandedRows to compute qCols, and evaluates checkRel.

    theorem Cslib.Crypto.Protocols.VOLE.isCostBounded_leaf_voleithVerifyROM {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal : Type} (expand : BitString sdLen → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (stmt : Stmt) (prf : VOLEITHProof d comLen rowLen Seed IV PreMsg) :
    OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) voleithLeafCost) (voleithVerifyROM expand chalToIdx checkRel stmt prf) (2 ^ d - 1)
    theorem Cslib.Crypto.Protocols.VOLE.isCostBounded_fs_voleithVerifyROM {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal : Type} (expand : BitString sdLen → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (stmt : Stmt) (prf : VOLEITHProof d comLen rowLen Seed IV PreMsg) :
    OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) voleithFSCost) (voleithVerifyROM expand chalToIdx checkRel stmt prf) 1
    def Cslib.Crypto.Protocols.VOLE.extractLeafFromTrace {d sdLen comLen : ℕ} {Seed IV : Type} [DecidableEq IV] (tr : LeafTrace d sdLen comLen Seed IV) (iv : IV) (coms : Fin (2 ^ d) → BitString comLen) (idx : Fin (2 ^ d)) :
    Option (Seed × BitString sdLen)

    Look up a leaf_hash::shake leaf query (k, iv, idx) ↦ (sd, com) in tr_leaf matching iv, idx, and target commitment coms idx.

    def Cslib.Crypto.Protocols.VOLE.extractRowsFromTrace {d sdLen comLen rowLen : ℕ} {Seed IV : Type} [DecidableEq IV] (expand : BitString sdLen → BitString rowLen) (tr : LeafTrace d sdLen comLen Seed IV) (iv : IV) (coms : Fin (2 ^ d) → BitString comLen) :
    Fin (2 ^ d) → BitString rowLen

    Straight-line extraction of all 2 ^ d expanded VOLE rows from tr_leaf using expand, defaulting unqueried leaves to 0.

    def Cslib.Crypto.Protocols.VOLE.extractVOLEFromTrace {d sdLen comLen rowLen : ℕ} {Seed IV : Type} [DecidableEq IV] (expand : BitString sdLen → BitString rowLen) (tr : LeafTrace d sdLen comLen Seed IV) (iv : IV) (coms : Fin (2 ^ d) → BitString comLen) :

    Straight-line extraction of the binary VOLE (u, v₀, ..., v_{d-1}) conversion from tr_leaf using FAEST.convertExpandedRows.

    def Cslib.Crypto.Protocols.VOLE.extractWitnessFromTrace {d sdLen comLen rowLen : ℕ} {Seed IV PreMsg Wit : Type} [DecidableEq IV] (expand : BitString sdLen → BitString rowLen) (decWit : BitString rowLen → Wit) (tr : LeafTrace d sdLen comLen Seed IV) (prf : VOLEITHProof d comLen rowLen Seed IV PreMsg) :
    Wit

    Zero-rewinding straight-line witness extractor: reads ONLY tr_leaf and prf, recovering decWit (prf.dCorr + u).

    def Cslib.Crypto.Protocols.VOLE.honestCommitLeaves {d sdLen comLen rowLen : ℕ} {Seed IV : Type} (expand : BitString sdLen → BitString rowLen) (iv : IV) (keys : Fin (2 ^ d) → Seed) (k : ℕ) :
    k ≤ 2 ^ d → OracleComp (VOLEITHLeafSpec d sdLen comLen Seed IV) ((Fin (2 ^ d) → BitString rowLen) × (Fin (2 ^ d) → BitString comLen))

    Query H_leaf across all k leaves 0, ..., k - 1 under fresh keys, returning the expanded rows rows and leaf commitment digests coms.

    def Cslib.Crypto.Protocols.VOLE.voleithProveLeafFS {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} (expand : BitString sdLen → BitString rowLen) (encWit : Wit → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (mkPreMsg : (Fin d → BitString rowLen) → BitString rowLen → BitString rowLen → PreMsg) (defaultSeed : Seed) (iv : IV) (keys : Fin (2 ^ d) → Seed) (stmt : Stmt) (w : Wit) :
    OracleComp ((VOLEITHLeafSpec d sdLen comLen Seed IV).sum (VOLEITHFSSpec d comLen rowLen Stmt IV PreMsg Chal)) (VOLEITHProof d comLen rowLen Seed IV PreMsg)

    Leaf-and-FS oracle program for the honest leaf_hash::shake prover: commits all 2 ^ d leaves via H_leaf, masks the witness with conv.u, queries H_FS on (stmt, iv, coms, dCorr, preMsg), and outputs openKeys for all idx ≠ hidden.

    def Cslib.Crypto.Protocols.VOLE.voleithProveROM {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} (expand : BitString sdLen → BitString rowLen) (encWit : Wit → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (mkPreMsg : (Fin d → BitString rowLen) → BitString rowLen → BitString rowLen → PreMsg) (defaultSeed : Seed) (iv : IV) (keys : Fin (2 ^ d) → Seed) (stmt : Stmt) (w : Wit) :
    ProbOracleComp (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) (VOLEITHProof d comLen rowLen Seed IV PreMsg)

    Honest leaf_hash::shake prover in VOLEITHROSpec.

    theorem Cslib.Crypto.Protocols.VOLE.isCostBounded_leaf_voleithProveLeafFS {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} (expand : BitString sdLen → BitString rowLen) (encWit : Wit → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (mkPreMsg : (Fin d → BitString rowLen) → BitString rowLen → BitString rowLen → PreMsg) (defaultSeed : Seed) (iv : IV) (keys : Fin (2 ^ d) → Seed) (stmt : Stmt) (w : Wit) :
    OracleComp.IsCostBounded voleithLeafCost (voleithProveLeafFS expand encWit chalToIdx mkPreMsg defaultSeed iv keys stmt w) (2 ^ d)

    voleithProveLeafFS makes at most 2 ^ d H_leaf queries.

    theorem Cslib.Crypto.Protocols.VOLE.isCostBounded_fs_voleithProveLeafFS {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} (expand : BitString sdLen → BitString rowLen) (encWit : Wit → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (mkPreMsg : (Fin d → BitString rowLen) → BitString rowLen → BitString rowLen → PreMsg) (defaultSeed : Seed) (iv : IV) (keys : Fin (2 ^ d) → Seed) (stmt : Stmt) (w : Wit) :
    OracleComp.IsCostBounded voleithFSCost (voleithProveLeafFS expand encWit chalToIdx mkPreMsg defaultSeed iv keys stmt w) 1

    voleithProveLeafFS makes at most 1 H_FS query.

    def Cslib.Crypto.Protocols.VOLE.voleithHonestGame {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} (expand : BitString sdLen → BitString rowLen) (encWit : Wit → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (mkPreMsg : (Fin d → BitString rowLen) → BitString rowLen → BitString rowLen → PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (defaultSeed : Seed) (iv : IV) (keys : Fin (2 ^ d) → Seed) (stmt : Stmt) (w : Wit) :
    ProbOracleComp (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) Bool

    Honest prover-then-verifier execution in VOLEITHROSpec.

    theorem Cslib.Crypto.Protocols.VOLE.voleithProveLeafFS_verify_of_fresh {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} [BEq (LeafQuery d Seed IV)] [LawfulBEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [LawfulBEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (encWit : Wit → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (mkPreMsg : (Fin d → BitString rowLen) → BitString rowLen → BitString rowLen → PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (defaultSeed : Seed) (iv : IV) (keys : Fin (2 ^ d) → Seed) (stmt : Stmt) (w : Wit) (hRel : ∀ (pCols : Fin d → BitString rowLen) (u : BitString rowLen) (delta : Chal), checkRel stmt (fun (j : Fin d) => pCols j + fun (k : Fin rowLen) => (BitString.equivFin d).symm (chalToIdx delta) j * u k) (encWit w + u) (mkPreMsg pCols u (encWit w + u)) delta = true) (st₀ : VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) (hiv₁ : ∀ e ∈ st₀.1, e.1.iv ≠ iv) (hiv₂ : ∀ e ∈ st₀.2, e.1.iv ≠ iv) {prf : VOLEITHProof d comLen rowLen Seed IV PreMsg} {st_mid : VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal} (hprove : (prf, st_mid) ∈ ((OracleComp.interpret voleithMemoize (voleithProveLeafFS expand encWit chalToIdx mkPreMsg defaultSeed iv keys stmt w)).run st₀).support) :
    ProbOracleComp.runWith voleithMemoize (voleithVerifyROM expand chalToIdx checkRel stmt prf) st_mid = PMF.pure (true, st_mid) ∧ (∀ e ∈ st_mid.1, e.1.iv = iv ∨ e ∈ st₀.1) ∧ ∀ e ∈ st_mid.2, e.1.iv = iv ∨ e ∈ st₀.2

    Generalized completeness of voleithProveLeafFS followed by voleithVerifyROM from any ROM trace st₀ free of prior queries tagged with iv. Every generated proof verifies to true without modifying st_mid, and all newly added trace entries carry iv.

    theorem Cslib.Crypto.Protocols.VOLE.voleithHonestGame_eq_pure_true {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} [BEq (LeafQuery d Seed IV)] [LawfulBEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [LawfulBEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (encWit : Wit → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (mkPreMsg : (Fin d → BitString rowLen) → BitString rowLen → BitString rowLen → PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (defaultSeed : Seed) (iv : IV) (keys : Fin (2 ^ d) → Seed) (stmt : Stmt) (w : Wit) (hRel : ∀ (pCols : Fin d → BitString rowLen) (u : BitString rowLen) (delta : Chal), checkRel stmt (fun (j : Fin d) => pCols j + fun (k : Fin rowLen) => (BitString.equivFin d).symm (chalToIdx delta) j * u k) (encWit w + u) (mkPreMsg pCols u (encWit w + u)) delta = true) :
    PMF.map Prod.fst (ProbOracleComp.runWith voleithMemoize (voleithHonestGame expand encWit chalToIdx mkPreMsg checkRel defaultSeed iv keys stmt w) ([], [])) = PMF.pure true

    Exact completeness of the leaf_hash::shake VOLEitH protocol in the two-channel lazy ROM: running the honest prover and verifier against voleithMemoize from an empty trace accepts with probability 1.

    Sticky Two-Channel Bad-Event Bound and Straight-Line Knowledge Extraction #

    noncomputable def Cslib.Crypto.Protocols.VOLE.voleithKSBound (d comLen Q_leaf Q_FS : ℕ) (ε_rel : NNReal) :

    Concrete knowledge-soundness error bound ε_KS for leaf_hash::shake VOLEitH in the two-channel ROM: leaf collision + post-H_FS preimage hit + Fiat–Shamir unsound challenge hit.

    def Cslib.Crypto.Protocols.VOLE.VOLEITHSoundnessError {d rowLen : ℕ} {Stmt PreMsg Chal Wit : Type} [Fintype Chal] [Nonempty Chal] (decWit : BitString rowLen → Wit) (chalToIdx : Chal → Fin (2 ^ d)) (Rel : Stmt → Wit → Bool) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (ε_rel : NNReal) :

    Soundness error assumption on the underlying non-ROM check predicate checkRel: whenever the reconstructed witness w* = decWit (dCorr + conv.u) fails Rel stmt, a uniform challenge Δ ← Chal passes checkRel on FAEST.verifierRows rows (chalToIdx Δ) with probability at most ε_rel : ℝ≥0.

    noncomputable def Cslib.Crypto.Protocols.VOLE.voleithKSFailurePMF {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [DecidableEq IV] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (decWit : BitString rowLen → Wit) (chalToIdx : Chal → Fin (2 ^ d)) (Rel : Stmt → Wit → Bool) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (P : ProbOracleComp (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) (Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg)) :

    Probability that an adaptive prover P followed by voleithVerifyROM succeeds (ok = true) while extractWitnessFromTrace on P's pre-verification trace tr_P fails Rel.

    theorem Cslib.Crypto.Protocols.VOLE.voleithKnowledgeSoundness_bound {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} [BEq (LeafQuery d Seed IV)] [LawfulBEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [LawfulBEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [DecidableEq IV] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (decWit : BitString rowLen → Wit) (chalToIdx : Chal → Fin (2 ^ d)) (Rel : Stmt → Wit → Bool) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) {ε_rel : NNReal} (hSound : VOLEITHSoundnessError decWit chalToIdx Rel checkRel ε_rel) (P : ProbOracleComp (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) (Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg)) {Q_leaf Q_FS : ℕ} (hleaf : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) voleithLeafCost) P Q_leaf) (hfs : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) voleithFSCost) P Q_FS) :
    (voleithKSFailurePMF expand decWit chalToIdx Rel checkRel P) true ≤ ↑(voleithKSBound d comLen (Q_leaf + (2 ^ d - 1)) (Q_FS + 1) ε_rel)

    Bounded, conditional step toward straight-line VOLEitH knowledge soundness (#7068, #4987), not the cited lemma itself: conditional on hSound : VOLEITHSoundnessError ... ε_rel for a single challenge repetition (µ = 1) over flat 2 ^ d-leaf leaf_hash::shake RO commitments (ProbOracleComp query bounds, not full multi-tree BAVC or runtime certificates), running prover P and extracting w* = extractWitnessFromTrace from tr_P without rewinding prior to voleithVerifyROM fails with probability at most voleithKSBound d comLen (Q_leaf + (2 ^ d - 1)) (Q_FS + 1) ε_rel : ℝ≥0. After [BBDdSG+23b], Lemma 4, pp. 19–20.

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.VOLEITHVerifyOracleSpec (d comLen rowLen : ℕ) (Stmt Seed IV PreMsg : Type) :
    OracleSpec (Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg)

    Oracle specification for an adaptive m-call VOLEitH verification oracle alongside VOLEITHROSpec.

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.VOLEITHMultiVerifySpec (d sdLen comLen rowLen : ℕ) (Stmt Seed IV PreMsg Chal : Type) :
    OracleSpec (Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg ⊕ LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg)

    Combined oracle allowing adaptive queries to both Verify (Sum.inl) and VOLEITHROSpec (Sum.inr).

    @[reducible, inline]
    abbrev Cslib.Crypto.Protocols.VOLE.VOLEITHMultiVerifyState (d sdLen comLen rowLen : ℕ) (Stmt Seed IV PreMsg Chal : Type) :

    State of the multi-verify tracking oracle: (roState, anyExtractFailure).

    noncomputable def Cslib.Crypto.Protocols.VOLE.voleithMultiVerifyHandler {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [DecidableEq IV] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (decWit : BitString rowLen → Wit) (chalToIdx : Chal → Fin (2 ^ d)) (Rel : Stmt → Wit → Bool) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (q : Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg ⊕ LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) :
    StateT (VOLEITHMultiVerifyState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) PMF (VOLEITHMultiVerifySpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal q)

    Adaptive multi-verify handler running voleithVerifyROM on shared lazy ROM voleithMemoize and recording anyExtractFailure = true if any verified proof fails straight-line witness extraction against the H_leaf trace captured before verification.

    theorem Cslib.Crypto.Protocols.VOLE.voleithMultiVerifyROM_sound_bound {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit α : Type} [BEq (LeafQuery d Seed IV)] [LawfulBEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [LawfulBEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [DecidableEq IV] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (decWit : BitString rowLen → Wit) (chalToIdx : Chal → Fin (2 ^ d)) (Rel : Stmt → Wit → Bool) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) {ε_rel : NNReal} (hSound : VOLEITHSoundnessError decWit chalToIdx Rel checkRel ε_rel) (A : ProbOracleComp (VOLEITHMultiVerifySpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) α) {m Q_leaf Q_FS : ℕ} (hm : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) (Sum.elim (fun (x : Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg) => 1) fun (x : LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) => 0)) A m) (hleaf : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) (Sum.elim (fun (x : Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg) => 0) voleithLeafCost)) A Q_leaf) (hfs : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) (Sum.elim (fun (x : Stmt × VOLEITHProof d comLen rowLen Seed IV PreMsg) => 0) voleithFSCost)) A Q_FS) :
    (PMF.map (fun (x : α × VOLEITHMultiVerifyState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) => match x with | (fst, fst_1, bad) => bad) (ProbOracleComp.runWith (voleithMultiVerifyHandler expand decWit chalToIdx Rel checkRel) A (([], []), false))) true ≤ ↑(voleithKSBound d comLen (Q_leaf + m * (2 ^ d - 1)) (Q_FS + m) ε_rel)

    Bounded, conditional step toward adaptive multi-verify VOLEitH soundness (#7068, #4987), not the cited lemma itself: conditional on hSound : VOLEITHSoundnessError ... ε_rel for single-repetition flat 2 ^ d-leaf leaf_hash::shake commitments (ProbOracleComp query bounds, without full multi-tree BAVC or runtime certificates), if an adaptive adversary A with access to Verify and VOLEITHROSpec makes at most m verification queries, Q_leaf direct H_leaf queries, and Q_FS direct H_FS queries, then against voleithMultiVerifyHandler the probability that any verified proof fails Rel extraction from tr_leaf prior to that call is at most voleithKSBound d comLen (Q_leaf + m * (2 ^ d - 1)) (Q_FS + m) ε_rel : ℝ≥0. After [BBDdSG+23b], Lemma 4, pp. 19–20, at µ = 1.

    Shared Verify-Gated Sticky ROM Bridge #

    noncomputable def Cslib.Crypto.Protocols.VOLE.verifyGatedHandlerProg {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Req Resp Log : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (toStmt : Req → Stmt) (toProof : Req → VOLEITHProof d comLen rowLen Seed IV PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (onReject : Resp) (onAccept : Req → Log → ProbComp (Resp × Log)) (q : Req ⊕ LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) :
    StateT (VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal × Log) ProbComp (OracleSpec.sum (fun (x : Req) => Resp) (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) q)

    Executable two-channel ROM oracle handler that gates external requests on voleithVerifyROM before sampling onAccept.

    noncomputable def Cslib.Crypto.Protocols.VOLE.verifyGatedHandler {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Req Resp Log : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (toStmt : Req → Stmt) (toProof : Req → VOLEITHProof d comLen rowLen Seed IV PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (onReject : Resp) (onAccept : LeafTrace d sdLen comLen Seed IV → Req → Log → ProbComp (Resp × Log)) (q : Req ⊕ LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) :
    StateT (VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal × Log) PMF (OracleSpec.sum (fun (x : Req) => Resp) (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) q)

    PMF semantics of verifyGatedHandlerProg, passing the current H_leaf trace roSt.1 to onAccept.

    theorem Cslib.Crypto.Protocols.VOLE.verifyGatedHandlerProg_eval {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Req Resp Log : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (toStmt : Req → Stmt) (toProof : Req → VOLEITHProof d comLen rowLen Seed IV PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (onReject : Resp) (onAccept : Req → Log → ProbComp (Resp × Log)) (q : Req ⊕ LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) (st : VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal × Log) :
    (verifyGatedHandlerProg expand chalToIdx toStmt toProof checkRel onReject onAccept q st).eval = verifyGatedHandler expand chalToIdx toStmt toProof checkRel onReject (fun (x : LeafTrace d sdLen comLen Seed IV) => onAccept) q st

    Evaluating verifyGatedHandlerProg on any query/state reduces to verifyGatedHandler.

    theorem Cslib.Crypto.Protocols.VOLE.runWith_verifyGatedHandler_liftRight {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Req Resp Log α : Type} [BEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (chalToIdx : Chal → Fin (2 ^ d)) (toStmt : Req → Stmt) (toProof : Req → VOLEITHProof d comLen rowLen Seed IV PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) (onReject : Resp) (onAccept : LeafTrace d sdLen comLen Seed IV → Req → Log → ProbComp (Resp × Log)) (prog : OracleComp ((VOLEITHLeafSpec d sdLen comLen Seed IV).sum (VOLEITHFSSpec d comLen rowLen Stmt IV PreMsg Chal)) α) (roSt : VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) (log : Log) :
    ProbOracleComp.runWith (verifyGatedHandler expand chalToIdx toStmt toProof checkRel onReject onAccept) prog.liftRight.liftRight (roSt, log) = PMF.map (fun (x : α × VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal) => match x with | (a, roSt') => (a, roSt', log)) ((OracleComp.interpret voleithMemoize prog).run roSt)

    Lifting a VOLEITHLeafSpec ⊕ₒ VOLEITHFSSpec subprogram into verifyGatedHandler runs against voleithMemoize on roSt and preserves log unchanged.

    theorem Cslib.Crypto.Protocols.VOLE.toOuterMeasure_runWith_verifyGatedHandler_le {d sdLen comLen rowLen : ℕ} {Stmt Seed IV PreMsg Chal Wit Req Resp Log α : Type} [BEq (LeafQuery d Seed IV)] [LawfulBEq (LeafQuery d Seed IV)] [BEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [LawfulBEq (FSQuery d comLen rowLen Stmt IV PreMsg)] [DecidableEq IV] [Fintype Chal] [Nonempty Chal] (expand : BitString sdLen → BitString rowLen) (decWit : BitString rowLen → Wit) (chalToIdx : Chal → Fin (2 ^ d)) (Rel : Stmt → Wit → Bool) (toStmt : Req → Stmt) (toProof : Req → VOLEITHProof d comLen rowLen Seed IV PreMsg) (checkRel : Stmt → (Fin d → BitString rowLen) → BitString rowLen → PreMsg → Chal → Bool) {ε_rel : NNReal} (hSound : VOLEITHSoundnessError decWit chalToIdx Rel checkRel ε_rel) (onReject : Resp) (onAccept₁ : Req → Log → ProbComp (Resp × Log)) (onAccept₂ : LeafTrace d sdLen comLen Seed IV → Req → Log → ProbComp (Resp × Log)) (hAgree : ∀ (tr : LeafTrace d sdLen comLen Seed IV) (req : Req) (log : Log), Rel (toStmt req) (extractWitnessFromTrace expand decWit tr (toProof req)) = true → onAccept₁ req log = onAccept₂ tr req log) (log₀ : Log) (prog : ProbOracleComp (OracleSpec.sum (fun (x : Req) => Resp) (VOLEITHROSpec d sdLen comLen rowLen Stmt Seed IV PreMsg Chal)) α) {m Q_leaf Q_FS : ℕ} (hm : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) (Sum.elim (fun (x : Req) => 1) fun (x : LeafQuery d Seed IV ⊕ FSQuery d comLen rowLen Stmt IV PreMsg) => 0)) prog m) (hleaf : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) (Sum.elim (fun (x : Req) => 0) voleithLeafCost)) prog Q_leaf) (hfs : OracleComp.IsCostBounded (Sum.elim (fun (x : ℕ) => 0) (Sum.elim (fun (x : Req) => 0) voleithFSCost)) prog Q_FS) (pred : α × VOLEITHTraceState d sdLen comLen rowLen Stmt Seed IV PreMsg Chal × Log → Bool) :
    (PMF.map pred (ProbOracleComp.runWith (verifyGatedHandler expand chalToIdx toStmt toProof checkRel onReject fun (x : LeafTrace d sdLen comLen Seed IV) => onAccept₁) prog (([], []), log₀))) true ≤ (PMF.map pred (ProbOracleComp.runWith (verifyGatedHandler expand chalToIdx toStmt toProof checkRel onReject onAccept₂) prog (([], []), log₀))) true + ↑(voleithKSBound d comLen (Q_leaf + m * (2 ^ d - 1)) (Q_FS + m) ε_rel)

    Verify-gated acceptance transfer: running prog against verifyGatedHandler with onAccept₁ satisfies boolean predicate pred with probability at most running with onAccept₂ plus voleithKSBound d comLen (Q_leaf + m * (2 ^ d - 1)) (Q_FS + m) ε_rel, provided onAccept₁ and onAccept₂ agree whenever straight-line trace extraction satisfies Rel.