Documentation

CslibFrontier.Crypto.Protocols.BCS.ROM.Soundness

Adaptive two-channel random-oracle soundness of the BCS transform #

Defines the adaptive two-channel BCS random-oracle soundness game (bcsSoundnessProg, bcsSoundnessGame) and proves explicit non-asymptotic soundness bounds (bcsROMSoundness_bound, bcsROMSoundness_bound_of_prover_verifier) from IOPRoundByRoundSoundness ([BSCS16]; compare [CY24], Theorem 25.2.1, printed pp. 276–278, and Chapter 31, Definitions 31.1.1–31.1.2 and Theorem 31.2.1).

Main definitions #

Main results #

References #

noncomputable def Cslib.Crypto.Protocols.BCS.bcsSoundnessProg {r d : ℕ} {Stmt Wit Sym Chal : Type} (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) (lang : Set Stmt) (P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)) :

The BCS ROM soundness execution as an OracleComp (BCSROMSpec Stmt Chal) program: run the cheating prover P to obtain (x, prf), run bcsVerifyROM iop encSym x prf, and return true when x ∉ lang and the verifier accepts.

theorem Cslib.Crypto.Protocols.BCS.isCostBounded_bcsFSCost_bcsSoundnessProg {r d : ℕ} {Stmt Wit Sym Chal : Type} (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) (lang : Set Stmt) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_FS : ℕ} (hFS : OracleComp.IsCostBounded bcsFSCost P t_FS) :

If the cheating prover P makes at most t_FS Fiat–Shamir queries, then bcsSoundnessProg iop encSym lang P makes at most t_FS + r Fiat–Shamir queries.

theorem Cslib.Crypto.Protocols.BCS.isCostBounded_bcsMTCost_bcsSoundnessProg {r d : ℕ} {Stmt Wit Sym Chal : Type} (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) (lang : Set Stmt) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_MT q_V : ℕ} (hMT : OracleComp.IsCostBounded bcsMTCost P t_MT) (hV : ∀ (x : Stmt) (prf : BCSProof r Sym), (x, prf) ∈ P.support → OracleComp.IsCostBounded bcsMTCost (bcsVerifyROM iop encSym x prf) q_V) :
OracleComp.IsCostBounded bcsMTCost (bcsSoundnessProg iop encSym lang P) (t_MT + q_V)

If P makes at most t_MT Merkle hash queries and bcsVerifyROM iop encSym x prf makes at most q_V Merkle hash queries for every (x, prf) ∈ P.support, then bcsSoundnessProg makes at most t_MT + q_V Merkle hash queries.

noncomputable def Cslib.Crypto.Protocols.BCS.bcsSoundnessGame {r d : ℕ} {Stmt Wit Sym Chal : Type} [DecidableEq Stmt] [DecidableEq Chal] [Fintype Chal] [Nonempty Chal] (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) (lang : Set Stmt) (P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)) (σ : ℕ) :

The BCS ROM soundness experiment with σ-bit Merkle digests: runs bcsSoundnessProg against the shared lazy random oracle RandomOracle.answer (bcsOracleDist Stmt Chal σ) from an empty cache.

theorem Cslib.Crypto.Protocols.BCS.bcsSoundnessGame_eq_run_bcsMemoize {r d : ℕ} {Stmt Wit Sym Chal : Type} [DecidableEq Stmt] [DecidableEq Chal] [Fintype Chal] [Nonempty Chal] (iop : PublicCoinIOP r d Stmt Wit Sym Chal) (encSym : Sym → List Bool) (lang : Set Stmt) (P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)) (σ : ℕ) :
bcsSoundnessGame iop encSym lang P σ = PMF.map Prod.fst ((OracleComp.interpret (bcsMemoize σ) (bcsSoundnessProg iop encSym lang P)).run ([], []))
theorem Cslib.Crypto.Protocols.BCS.bcsROMSoundness_bound {r d : ℕ} {Stmt Wit Sym Chal : Type} [DecidableEq Stmt] [DecidableEq Chal] [Fintype Chal] [Nonempty Chal] {iop : PublicCoinIOP r d Stmt Wit Sym Chal} {lang : Set Stmt} {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} (hrbr : IOPRoundByRoundSoundness iop lang doomed goodStep) {ε_rbr : ENNReal} (hescape : ∀ x ∉ lang, ∀ (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_rbr) {encSym : Sym → List Bool} {decSym : List Bool → Sym} (hdec : Function.LeftInverse decSym encSym) (defaultSym : Sym) (σ : ℕ) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_FS Q_MT : ℕ} (hFS : OracleComp.IsCostBounded bcsFSCost P t_FS) (hMT : OracleComp.IsCostBounded bcsMTCost (bcsSoundnessProg iop encSym lang P) Q_MT) :
(bcsSoundnessGame iop encSym lang P σ) true ≤ ↑(t_FS + r) * (ε_rbr + ↑(t_FS + r) * (1 / ↑(Fintype.card Chal))) + ↑Q_MT * (↑(3 * Q_MT + r * (t_FS + r)) * (1 / 2 ^ σ))

Adaptive two-channel BCS ROM soundness theorem (compare state-restoration soundness in [BSCS16] and [CY24], Theorem 25.2.1, printed pp. 276–278, and the round-by-round reduction in [CY24], Chapter 31, Definitions 31.1.1–31.1.2 and Theorem 31.2.1): under IOPRoundByRoundSoundness iop lang doomed goodStep with per-round challenge escape probability ≤ ε_rbr, any adaptive cheating prover P making at most t_FS Fiat–Shamir queries such that bcsSoundnessProg iop encSym lang P makes at most Q_MT Merkle hash queries convinces bcsVerifyROM on a false statement x ∉ lang with probability at most (t_FS + r) * (ε_rbr + (t_FS + r) * (1 / Fintype.card Chal)) + Q_MT * ((3 * Q_MT + r * (t_FS + r)) * (1 / 2 ^ σ)).

theorem Cslib.Crypto.Protocols.BCS.bcsROMSoundness_bound_of_prover_verifier {r d : ℕ} {Stmt Wit Sym Chal : Type} [DecidableEq Stmt] [DecidableEq Chal] [Fintype Chal] [Nonempty Chal] {iop : PublicCoinIOP r d Stmt Wit Sym Chal} {lang : Set Stmt} {doomed : Stmt → List (OracleTable d Sym × Chal) → Prop} {goodStep : Stmt → List (OracleTable d Sym × Chal) → OracleTable d Sym → Chal → Prop} (hrbr : IOPRoundByRoundSoundness iop lang doomed goodStep) {ε_rbr : ENNReal} (hescape : ∀ x ∉ lang, ∀ (pref : List (OracleTable d Sym × Chal)) (π : OracleTable d Sym), doomed x pref → (Probability.PMF.uniformOfFintype Chal).toOuterMeasure {c : Chal | ¬goodStep x pref π c} ≤ ε_rbr) {encSym : Sym → List Bool} {decSym : List Bool → Sym} (hdec : Function.LeftInverse decSym encSym) (defaultSym : Sym) (σ : ℕ) {P : OracleComp (BCSROMSpec Stmt Chal) (Stmt × BCSProof r Sym)} {t_MT t_FS q_V : ℕ} (hMT : OracleComp.IsCostBounded bcsMTCost P t_MT) (hFS : OracleComp.IsCostBounded bcsFSCost P t_FS) (hV : ∀ (x : Stmt) (prf : BCSProof r Sym), (x, prf) ∈ P.support → OracleComp.IsCostBounded bcsMTCost (bcsVerifyROM iop encSym x prf) q_V) :
(bcsSoundnessGame iop encSym lang P σ) true ≤ ↑(t_FS + r) * (ε_rbr + ↑(t_FS + r) * (1 / ↑(Fintype.card Chal))) + ↑(t_MT + q_V) * (↑(3 * (t_MT + q_V) + r * (t_FS + r)) * (1 / 2 ^ σ))

Adaptive two-channel BCS ROM soundness (separate prover/verifier Merkle budgets on P.support): if P makes at most t_MT Merkle hash queries and t_FS Fiat–Shamir queries, and bcsVerifyROM iop encSym x prf makes at most q_V Merkle hash queries for outputs (x, prf) ∈ P.support, then bcsSoundnessGame accepts a false statement with probability at most (t_FS + r) * (ε_rbr + (t_FS + r) * (1 / Fintype.card Chal)) + (t_MT + q_V) * ((3 * (t_MT + q_V) + r * (t_FS + r)) * (1 / 2 ^ σ)).