Documentation

CslibFrontier.Crypto.Protocols.SigmaProtocol.LanguageReduction.Efficient

Efficient simulation, extraction and verification under statement maps #

Transfers EfficientSpecialHVZK, EfficientSpecialSoundness and EfficientVerifier along a statement map g whose word representation gw : I × List Bool → List Bool is deterministic polynomial time ([BS23], Section 20.2, p. 829). Also provides EfficientSpecialSoundness.mapWitness to post-process an efficient extractor by a polynomial-time witness map back.

Efficiency of the derived honest prover (which applies f) is not formalized here, because the library has no efficiency predicate for Sigma-protocol honest provers.

Main definitions #

Main results #

def Cslib.Crypto.Protocols.SigmaProtocol.Encoding.withStatement {I : Type} {Y Y' T C Z : I → Type} (enc' : Encoding I Y' T C Z) (encY : (i : I) → Y i ↪ List Bool) :
Encoding I Y T C Z

The encoding of a derived family: that of the original family, with a statement encoding for the new statements.

theorem Cslib.Crypto.Protocols.SigmaProtocol.EfficientSpecialHVZK.comap {I : Type} {X Y X' Y' T C Z : I → Type} {P' : (i : I) → SigmaProtocol (X' i) (Y' i) (T i) (C i) (Z i)} {enc' : Encoding I Y' T C Z} {f : (i : I) → X i → Y i → X' i} {g : (i : I) → Y i → Y' i} {encY : (i : I) → Y i ↪ List Bool} {gw : I × List Bool → List Bool} {R' : (i : I) → X' i → Y' i → Prop} {simulate : (i : I) → Y' i → C i → PMF (T i × Z i)} {δ : I → ENNReal} (h : EfficientSpecialHVZK P' R' enc' simulate δ) {R : (i : I) → X i → Y i → Prop} (hf : ∀ (i : I) (x : X i) (y : Y i), R i x y → R' i (f i x y) (g i y)) (hgw : Turing.MultiTapeTM.ComputableInPolyTime gw (Turing.MultiTapeTM.encPair enc'.index Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hg : ∀ (i : I) (y : Y i), gw (i, (encY i) y) = (enc'.statement i) (g i y)) :
EfficientSpecialHVZK (fun (i : I) => (P' i).comap (f i) (g i)) R (enc'.withStatement encY) (fun (i : I) (y : Y i) (c : C i) => simulate i (g i y) c) δ

Efficient special HVZK is inherited under condition (i) when the statement map is polynomial time on encodings: the derived simulator computes g and runs the simulator of P'.

theorem Cslib.Crypto.Protocols.SigmaProtocol.EfficientSpecialSoundness.comap {I : Type} {X Y X' Y' T C Z W : I → Type} {P' : (i : I) → SigmaProtocol (X' i) (Y' i) (T i) (C i) (Z i)} {enc' : Encoding I Y' T C Z} {g : (i : I) → Y i → Y' i} {encY : (i : I) → Y i ↪ List Bool} {gw : I × List Bool → List Bool} {R' : (i : I) → W i → Y' i → Prop} {encW : (i : I) → W i ↪ List Bool} {extract : (i : I) → Y' i → T i → C i → Z i → C i → Z i → W i} (h : EfficientSpecialSoundness P' R' enc' encW extract) (f : (i : I) → X i → Y i → X' i) (hgw : Turing.MultiTapeTM.ComputableInPolyTime gw (Turing.MultiTapeTM.encPair enc'.index Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hg : ∀ (i : I) (y : Y i), gw (i, (encY i) y) = (enc'.statement i) (g i y)) :
EfficientSpecialSoundness (fun (i : I) => (P' i).comap (f i) (g i)) (fun (i : I) (w : W i) (y : Y i) => R' i w (g i y)) (enc'.withStatement encY) encW fun (i : I) (y : Y i) => extract i (g i y)

Efficient special soundness is inherited for the relation "w is a witness of g y" when the statement map is polynomial time on encodings: the derived extractor computes g and runs the extractor of P'.

theorem Cslib.Crypto.Protocols.SigmaProtocol.EfficientSpecialSoundness.mapWitness {I : Type} {X Y T C Z W W' : I → Type} {P : (i : I) → SigmaProtocol (X i) (Y i) (T i) (C i) (Z i)} {enc : Encoding I Y T C Z} {R : (i : I) → W i → Y i → Prop} {R' : (i : I) → W' i → Y i → Prop} {encW : (i : I) → W i ↪ List Bool} {extract : (i : I) → Y i → T i → C i → Z i → C i → Z i → W i} (h : EfficientSpecialSoundness P R enc encW extract) (k : (i : I) → W i → Y i → W' i) (hk : ∀ (i : I) (w : W i) (y : Y i), R i w y → R' i (k i w y) y) (encW' : (i : I) → W' i ↪ List Bool) {kw : I × List Bool × List Bool → List Bool} (hkw : Turing.MultiTapeTM.ComputableInPolyTime kw (Turing.MultiTapeTM.encPair enc.index (Turing.MultiTapeTM.encPair Turing.MultiTapeTM.encBits Turing.MultiTapeTM.encBits)) Turing.MultiTapeTM.encBits) (hkreal : ∀ (i : I) (w : W i) (y : Y i), kw (i, (encW i) w, (enc.statement i) y) = (encW' i) (k i w y)) :
EfficientSpecialSoundness P R' enc encW' fun (i : I) (y : Y i) (t : T i) (c : C i) (z : Z i) (c' : C i) (z' : Z i) => k i (extract i y t c z c' z') y

Post-process an efficient extractor by a witness map that is polynomial time on encodings.

theorem Cslib.Crypto.Protocols.SigmaProtocol.EfficientVerifier.comap {I : Type} {X Y X' Y' T C Z : I → Type} {P' : (i : I) → SigmaProtocol (X' i) (Y' i) (T i) (C i) (Z i)} {enc' : Encoding I Y' T C Z} {g : (i : I) → Y i → Y' i} {encY : (i : I) → Y i ↪ List Bool} {gw : I × List Bool → List Bool} (h : EfficientVerifier P' enc') (f : (i : I) → X i → Y i → X' i) (hgw : Turing.MultiTapeTM.ComputableInPolyTime gw (Turing.MultiTapeTM.encPair enc'.index Turing.MultiTapeTM.encBits) Turing.MultiTapeTM.encBits) (hg : ∀ (i : I) (y : Y i), gw (i, (encY i) y) = (enc'.statement i) (g i y)) :
EfficientVerifier (fun (i : I) => (P' i).comap (f i) (g i)) (enc'.withStatement encY)

Efficient verification is inherited when the statement map is polynomial time on encodings: the derived verifier computes g and runs the verifier of P'.