Documentation

CslibFrontier.Crypto.Protocols.UC.Computational

Computational replacement of one fixed UC child #

A tester supplies party inputs, controls an adversary and observes one bit. A sampler draws its auxiliary input on the unary security parameter. The sampler and tester are uniform strict-PPT programs. A resource profile specifies the network encoding and any further admission conditions for adversaries and testers. The ideal profile receives the same tester under the same static corruption set, which lets a second replacement use the simulator chosen by the first.

Main definitions #

Main results #

These are original rules for Frontier's typed, fixed-party, static-corruption execution (#6043). The PPT conditions here govern the adversary, simulator, tester, and auxiliary-input sampler. Running-time certificates for protocol code are separate. The endpoint identities use the existing single-child routing equations.

@[reducible, inline]

Auxiliary-input sampler indexed by the security parameter.

@[reducible, inline]

A Boolean execution given the security parameter and auxiliary input.

noncomputable def Cslib.Crypto.Protocols.UC.Computational.sampled (run : Run) (draw : Sampler) (k : ℕ) :

Sample the auxiliary word once, then run the typed execution at that input.

@[reducible, inline]

Negligible distinguishing advantage for each uniform strict-PPT auxiliary-input sampler.

theorem Cslib.Crypto.Protocols.UC.Computational.Close.of_eval_eq {x y : Run} (h : ∀ (k : ℕ) (z : List Bool), (x k z).eval = (y k z).eval) :
Close x y

Identical output laws at every auxiliary word suffice for sampled indistinguishability.

structure Cslib.Crypto.Protocols.UC.Computational.Profile (n : ℕ) (I O NQ NR Q R : Type) :

The encoding of the routed network port and the resource conditions on its participants.

def Cslib.Crypto.Protocols.UC.Computational.Profile.Eligible {n : ℕ} {I O NQ NR Q R : Type} (p : Profile n I O NQ NR Q R) (control : WordPort Q R) (A : ExecAdversary n I O NQ NR Q R) :

The adversary has a strict-PPT certificate and meets the endpoint admission condition.

def Cslib.Crypto.Protocols.UC.Computational.Profile.Tests {n : ℕ} {I O NQ NR Q R : Type} (p : Profile n I O NQ NR Q R) (party : WordPort (Fin n × I) (Option O)) (control : WordPort Q R) (A : ExecAdversary n I O NQ NR Q R) (C : Finset (Fin n)) (Z : Environment n I O Q R) :

The environment has a strict-PPT certificate and meets the condition for this interaction.

structure Cslib.Crypto.Protocols.UC.Computational.Witness {n : ℕ} {I O N₁ R₁ N₂ R₂ Q R : Type} (party : WordPort (Fin n × I) (Option O)) (control : WordPort Q R) (p : Profile n I O N₁ R₁ Q R) (t : Profile n I O N₂ R₂ Q R) (X : Protocol n I O N₁ R₁) (F : Protocol n I O N₂ R₂) (A : ExecAdversary n I O N₁ R₁ Q R) (S : ExecAdversary n I O N₂ R₂ Q R) :

Security of a designated simulator. Both executions use the same environment-facing word ports, corruption set, environment and auxiliary-input sampler.

  • eligible : t.Eligible control S

    The simulator qualifies as an adversary for the ideal endpoint.

  • carry (C : Finset (Fin n)) (Z : Environment n I O Q R) : p.Tests party control A C Z → t.Tests party control S C Z

    Every admitted real test remains admitted with the simulator.

  • close (C : Finset (Fin n)) (Z : Environment n I O Q R) : p.Tests party control A C Z → Close (exec X A C Z) (exec F S C Z)

    Every admitted real test has negligible distinguishing advantage.

def Cslib.Crypto.Protocols.UC.Computational.EmulatesOn {n : ℕ} {I O N₁ R₁ N₂ R₂ Q R : Type} (party : WordPort (Fin n × I) (Option O)) (control : WordPort Q R) (p : Profile n I O N₁ R₁ Q R) (t : Profile n I O N₂ R₂ Q R) (X : Protocol n I O N₁ R₁) (F : Protocol n I O N₂ R₂) :

For each eligible adversary, one simulator works for every admitted test and sampler.

theorem Cslib.Crypto.Protocols.UC.Computational.Witness.trans {n : ℕ} {I O N₁ R₁ N₂ R₂ N₃ R₃ Q R : Type} {party : WordPort (Fin n × I) (Option O)} {control : WordPort Q R} {p : Profile n I O N₁ R₁ Q R} {t : Profile n I O N₂ R₂ Q R} {u : Profile n I O N₃ R₃ Q R} {X : Protocol n I O N₁ R₁} {F : Protocol n I O N₂ R₂} {G : Protocol n I O N₃ R₃} {A : ExecAdversary n I O N₁ R₁ Q R} {S : ExecAdversary n I O N₂ R₂ Q R} {T : ExecAdversary n I O N₃ R₃ Q R} (first : Witness party control p t X F A S) (second : Witness party control t u F G S T) :
Witness party control p u X G A T

Chain two designated simulations through the same middle adversary and profile.

theorem Cslib.Crypto.Protocols.UC.Computational.EmulatesOn.trans {n : ℕ} {I O N₁ R₁ N₂ R₂ N₃ R₃ Q R : Type} {party : WordPort (Fin n × I) (Option O)} {control : WordPort Q R} {p : Profile n I O N₁ R₁ Q R} {t : Profile n I O N₂ R₂ Q R} {u : Profile n I O N₃ R₃ Q R} {X : Protocol n I O N₁ R₁} {F : Protocol n I O N₂ R₂} {G : Protocol n I O N₃ R₃} (first : EmulatesOn party control p t X F) (second : EmulatesOn party control t u F G) :
EmulatesOn party control p u X G

Reuse the first simulator as an eligible adversary at the middle endpoint.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.UC.Computational.innerTester {n : ℕ} {I O N B J K XQ XR Q R : Type} (P : HybridProtocol n I O N B J K) (C : Finset (Fin n)) (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R) (Z : Environment n I O Q R) :
Environment n J K (RoutedNetQ n J XQ) (RoutedNetR K XR)

The child-only tester runs the outer tester, adversary and statically routed parent.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.UC.Computational.outerNetPort {n : ℕ} {I O N B J K XQ XR : Type} (party : WordPort (Fin n × I) (Option O)) (raw : WordPort N B) (sub : WordPort (Fin n × J) (Option K)) (subNet : WordPort XQ XR) :
WordPort (Fin n × I ⊕ N ⊕ Fin n × J ⊕ XQ) (Option O ⊕ B ⊕ Option K ⊕ XR)

The full routed real network interface. Successive sum tags choose the parent party, parent raw network, child party, or child raw network.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.UC.Computational.AdversaryCap {n : ℕ} {I O Q R U V : Type} (party : WordPort (Fin n × I) (Option O)) (net : WordPort U V) (control : WordPort Q R) (A : Adversary n Q R U V) (C : Finset (Fin n)) (Z : Environment n I O Q R) :

Reachable replies when the tester runs the outer adversary internally.

@[reducible, inline]
abbrev Cslib.Crypto.Protocols.UC.Computational.ParentCap {n : ℕ} {I O N B J K XQ XR Q R : Type} (P : HybridProtocol n I O N B J K) (party : WordPort (Fin n × I) (Option O)) (raw : WordPort N B) (sub : WordPort (Fin n × J) (Option K)) (subNet : WordPort XQ XR) (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R) (C : Finset (Fin n)) (Z : Environment n I O Q R) :

Reachable parent replies after the tester has absorbed the adversary.

theorem Cslib.Crypto.Protocols.UC.Computational.innerTester_ppt_of_cuts {n : ℕ} {I O N B J K XQ XR Q R : Type} {P : HybridProtocol n I O N B J K} {party : WordPort (Fin n × I) (Option O)} {raw : WordPort N B} {sub : WordPort (Fin n × J) (Option K)} {subNet : WordPort XQ XR} {control : WordPort Q R} {A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R} {C : Finset (Fin n)} {Z : Environment n I O Q R} (hP : P.IsPPT party raw sub) (hidx : Turing.MultiTapeTM.ComputableInPolyTime (fun (w : List Bool) => (party.queryDecoder.decode w).1) Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encFinite (Fin n))) (hA : Adversary.IsPPT A (outerNetPort party raw sub subNet) control) (hZ : Z.IsPPT party control) (capA : AdversaryCap party (outerNetPort party raw sub subNet) control A C Z) (capP : ParentCap P party raw sub subNet A C Z) :
(innerTester P C A Z).IsPPT sub (sub.sum subNet)

Absorbing the adversary and parent preserves strict PPT when both links have reachable caps.

theorem Cslib.Crypto.Protocols.UC.Computational.real_endpoint {n : ℕ} {I O N B J K XQ XR Q R : Type} (P : HybridProtocol n I O N B J K) (X : Protocol n J K XQ XR) (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R) (C : Finset (Fin n)) (Z : Environment n I O Q R) (draw : Sampler) (κ : ℕ) :
sampled (exec (compose P X) A C Z) draw κ = sampled (exec X (dummyAdversary n (RoutedNetQ n J XQ) (RoutedNetR K XR)) C (innerTester P C A Z)) draw κ

Moving the adversary and parent into the tester preserves the real sampled output law.

theorem Cslib.Crypto.Protocols.UC.Computational.ideal_endpoint {n : ℕ} {I O N B J K XQ XR FQ FR Q R : Type} (P : HybridProtocol n I O N B J K) (F : Protocol n J K FQ FR) (D : ExecAdversary n J K FQ FR (RoutedNetQ n J XQ) (RoutedNetR K XR)) (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R) (C : Finset (Fin n)) (Z : Environment n I O Q R) (draw : Sampler) (κ : ℕ) :
sampled (exec (compose P F) (compSim (hybridSim D) A) C Z) draw κ = sampled (exec F D C (innerTester P C A Z)) draw κ

Moving the parent and outer adversary into the tester leaves the child simulator in its network position and preserves the ideal sampled output law.

theorem Cslib.Crypto.Protocols.UC.Computational.oneChildWitness {n : ℕ} {I O N B J K XQ XR FQ FR Q R : Type} (P : HybridProtocol n I O N B J K) (X : Protocol n J K XQ XR) (F : Protocol n J K FQ FR) (D : ExecAdversary n J K FQ FR (RoutedNetQ n J XQ) (RoutedNetR K XR)) (party : WordPort (Fin n × I) (Option O)) (control : WordPort Q R) (childParty : WordPort (Fin n × J) (Option K)) (childControl : WordPort (RoutedNetQ n J XQ) (RoutedNetR K XR)) (p : Profile n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R) (t : Profile n I O (N ⊕ RoutedNetQ n J FQ) (B ⊕ RoutedNetR K FR) Q R) (px : Profile n J K XQ XR (RoutedNetQ n J XQ) (RoutedNetR K XR)) (pf : Profile n J K FQ FR (RoutedNetQ n J XQ) (RoutedNetR K XR)) (child : Witness childParty childControl px pf X F (dummyAdversary n (RoutedNetQ n J XQ) (RoutedNetR K XR)) D) (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R) (sim : t.Eligible control (compSim (hybridSim D) A)) (absorb : ∀ (C : Finset (Fin n)) (Z : Environment n I O Q R), p.Tests party control A C Z → px.Tests childParty childControl (dummyAdversary n (RoutedNetQ n J XQ) (RoutedNetR K XR)) C (innerTester P C A Z)) (carry : ∀ (C : Finset (Fin n)) (Z : Environment n I O Q R), p.Tests party control A C Z → pf.Tests childParty childControl D C (innerTester P C A Z) → t.Tests party control (compSim (hybridSim D) A) C Z) :
Witness party control p t (compose P X) (compose P F) A (compSim (hybridSim D) A)

Lift a designated child witness through this parent and outer adversary. The three resource premises certify the composed simulator, admit the absorbed tester for the real child, and return its ideal admission to the outer interface.

theorem Cslib.Crypto.Protocols.UC.Computational.oneChild_of_emulates {n : ℕ} {I O N B J K XQ XR FQ FR Q R : Type} (P : HybridProtocol n I O N B J K) (X : Protocol n J K XQ XR) (F : Protocol n J K FQ FR) (party : WordPort (Fin n × I) (Option O)) (control : WordPort Q R) (childParty : WordPort (Fin n × J) (Option K)) (childControl : WordPort (RoutedNetQ n J XQ) (RoutedNetR K XR)) (p : Profile n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R) (t : Profile n I O (N ⊕ RoutedNetQ n J FQ) (B ⊕ RoutedNetR K FR) Q R) (px : Profile n J K XQ XR (RoutedNetQ n J XQ) (RoutedNetR K XR)) (pf : Profile n J K FQ FR (RoutedNetQ n J XQ) (RoutedNetR K XR)) (child : EmulatesOn childParty childControl px pf X F) (hdummy : px.Eligible childControl (dummyAdversary n (RoutedNetQ n J XQ) (RoutedNetR K XR))) (sim : ∀ (S : ExecAdversary n J K FQ FR (RoutedNetQ n J XQ) (RoutedNetR K XR)), Witness childParty childControl px pf X F (dummyAdversary n (RoutedNetQ n J XQ) (RoutedNetR K XR)) S → ∀ (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R), p.Eligible control A → t.Eligible control (compSim (hybridSim S) A)) (absorb : ∀ (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R), p.Eligible control A → ∀ (C : Finset (Fin n)) (Z : Environment n I O Q R), p.Tests party control A C Z → px.Tests childParty childControl (dummyAdversary n (RoutedNetQ n J XQ) (RoutedNetR K XR)) C (innerTester P C A Z)) (carry : ∀ (S : ExecAdversary n J K FQ FR (RoutedNetQ n J XQ) (RoutedNetR K XR)), Witness childParty childControl px pf X F (dummyAdversary n (RoutedNetQ n J XQ) (RoutedNetR K XR)) S → ∀ (A : ExecAdversary n I O (N ⊕ RoutedNetQ n J XQ) (B ⊕ RoutedNetR K XR) Q R), p.Eligible control A → ∀ (C : Finset (Fin n)) (Z : Environment n I O Q R), p.Tests party control A C Z → pf.Tests childParty childControl S C (innerTester P C A Z) → t.Tests party control (compSim (hybridSim S) A) C Z) :
EmulatesOn party control p t (compose P X) (compose P F)

Child emulation supplies a witness for the dummy adversary. The resource premises may use all properties of that witness to lift it through an eligible outer adversary. For a specific simulator with its own cost proof, use oneChildWitness directly.