Documentation

CslibFrontier.Computability.Interactive.Efficient

Efficient extractors and simulators for interactive reductions #

Interactive.Verifier.KnowledgeSound and Interactive.Reduction.HVZK name their extractor and simulator but place no efficiency requirement on them. Without one, knowledge soundness says no more than soundness, and HVZK says no more than honest-verifier witness indistinguishability (test modules CslibFrontierTests.InteractiveKnowledgeSound and CslibFrontierTests.UnboundedSimulators). This module adds the efficient variants.

Efficiency is uniform over a family of reductions indexed by i : I, typically a unary security parameter together with a system parameter. Statements, witnesses and protocol shapes may depend on the index, so the algorithms are certified on words, through the encodings collected in an Interactive.Encoding.

Both variants contain the exact property at every index with the same extractor or simulator, so every theorem about KnowledgeSound and HVZK applies to them; the realizing program of an efficient simulator is ε i + δ i-close to honest transcripts (SimulatorRealizedBy.closeTo_run). Note that ε and δ are explicit, unconstrained parameters of these predicates rather than bundled Negligible obligations: when ε i ≥ 1 or δ i ≥ 1 (since event probabilities are at most 1), KnowledgeSound or SimulatorRealizedBy holds vacuously (not_efficientKnowledgeSound_dlTrustMe and not_efficientHVZK_sendWitnessDL in CslibFrontierTests.EfficientSimulators require ε i < 1 and ε i + δ i ≤ 1 / 2). Computational theorems and security claims built on these predicates must therefore pair them with an explicit error bound (such as Negligible) across the setup distribution. Extraction here is straight-line, from the transcript, as for interactive oracle proofs; rewinding extractors in the sense of Bellare and Goldreich are a different notion, as are malicious-verifier zero knowledge and computational zero knowledge.

Main definitions #

Main results #

structure Cslib.Interactive.Encoding (I : Type) (s : I → Spec) (Stmt : I → Type) :

Word encodings for a family of reductions indexed by I, with rounds s i and input statements in Stmt i at the index i.

  • index : I ↪ List Bool

    The index, such as a unary security parameter with a system parameter.

  • statement (i : I) : Stmt i ↪ List Bool

    The input statements at each index.

  • transcript (i : I) : (s i).Transcript ↪ List Bool

    The transcripts at each index.

def Cslib.Interactive.ExtractorRealizedBy {I : Type} {s : I → Spec} {StmtIn WitIn WitOut : I → Type} (enc : Encoding I s StmtIn) (encOut : (i : I) → WitOut i ↪ List Bool) (encIn : (i : I) → WitIn i ↪ List Bool) (E : (i : I) → StmtIn i → (s i).Transcript → WitOut i → WitIn i) (f : I × List Bool × List Bool × List Bool → List Bool) :

The word function f computes the extractor family E on encodings: from the index, the encoded statement, the encoded transcript and the encoded output witness, it returns the encoded input witness.

def Cslib.Interactive.SimulatorRealizedBy {I : Type} {s : I → Spec} {StmtIn : I → Type} (enc : Encoding I s StmtIn) (Sim : (i : I) → StmtIn i → ProbComp (s i).Transcript) (program : I × List Bool → ProbComp (List Bool)) (δ : I → ENNReal) :

The program program realizes the simulator family Sim on encodings up to statistical distance δ: on the index and the encoded statement, its output is within δ i of the encoded transcript sampled by Sim i.

structure Cslib.Interactive.Verifier.EfficientKnowledgeSound {I : Type} {s : I → Spec} {StmtIn WitIn StmtOut WitOut : I → Type} (V : (i : I) → Verifier OracleSpec.empty (s i) (StmtIn i) (StmtOut i)) (relIn : (i : I) → StmtIn i → WitIn i → Prop) (relOut : (i : I) → StmtOut i → WitOut i → Prop) (enc : Encoding I s StmtIn) (encOut : (i : I) → WitOut i ↪ List Bool) (encIn : (i : I) → WitIn i ↪ List Bool) (E : (i : I) → StmtIn i → (s i).Transcript → WitOut i → WitIn i) (ε : I → ENNReal) :

Efficient straight-line knowledge soundness. At every index, E i is a straight-line extractor for V i with error ε i, in the plain model, and one deterministic polynomial-time function of the index and words computes the whole family on encodings.

structure Cslib.Interactive.Reduction.EfficientHVZK {I : Type} {s : I → Spec} {StmtIn WitIn StmtOut WitOut : I → Type} (R : (i : I) → Reduction OracleSpec.empty OracleSpec.empty (s i) (StmtIn i) (WitIn i) (StmtOut i) (WitOut i)) (rel : (i : I) → StmtIn i → WitIn i → Prop) (enc : Encoding I s StmtIn) (Sim : (i : I) → StmtIn i → ProbComp (s i).Transcript) (ε δ : I → ENNReal) :

Efficient honest-verifier zero knowledge, with simulation error ε and realization error δ. At every index, Sim i is an ε i-HVZK simulator for R i, in the plain model, and one uniform strict PPT program of the index and the encoded statement realizes the whole family on encoded transcripts up to δ.

theorem Cslib.Interactive.SimulatorRealizedBy.closeTo_run {I : Type} {s : I → Spec} {StmtIn WitIn StmtOut WitOut : I → Type} {R : (i : I) → Reduction OracleSpec.empty OracleSpec.empty (s i) (StmtIn i) (WitIn i) (StmtOut i) (WitOut i)} {rel : (i : I) → StmtIn i → WitIn i → Prop} {enc : Encoding I s StmtIn} {Sim : (i : I) → StmtIn i → ProbComp (s i).Transcript} {program : I × List Bool → ProbComp (List Bool)} {ε δ : I → ENNReal} (hzk : ∀ (i : I), (R i).HVZK (rel i) (Sim i) (ε i)) (h : SimulatorRealizedBy enc Sim program δ) {i : I} {x : StmtIn i} {w : WitIn i} (hxw : rel i x w) :
Probability.CloseTo (PMF.map (⇑(enc.transcript i)) (PMF.map Prod.fst (World.plain.eval ((R i).run x w)))) (program (i, (enc.statement i) x)).eval (ε i + δ i)

A program realizing an ε-HVZK simulator up to δ is ε i + δ i-close to the honest encoded transcript, for every statement and valid witness.