Documentation

CslibFrontier.Crypto.Protocols.UC.PPT.Wrappers

Strict-PPT closure for UC routing and lifting wrappers #

This module proves that strict-PPT certificates (PPTCertificate, Machine.IsPPTFamily, Protocol.IsPPT, Adversary.IsPPT) in this library's word model survive the query-adapting, static-corruption routing, and adversary-lifting wrappers of UC.Linking, UC.Execution, and UC.Composition. Every construction and theorem here is library infrastructure for this word model (not Definition 6 of [Can20a]).

Modelling notes #

Main definitions #

Main results #

References #

Word-level port maps and lowered-program adaptation #

structure Cslib.Crypto.Protocols.UC.WordInterface.PortMap {ιJ ιK : Type} {J : ιJ → Type} {K : ιK → Type} (iJ : WordInterface J) (iK : WordInterface K) :

Library construction (no cited definition): a polynomial-time translation between two word-backed oracle interfaces, expressing a query-translating ProbOracleComp.simulate adapter on the underlying word interface.

def Cslib.Crypto.Protocols.UC.WordInterface.PortMap.adapt {ιJ ιK α : Type} {J : ιJ → Type} {K : ιK → Type} {iJ : WordInterface J} {iK : WordInterface K} (m : iJ.PortMap iK) (program : ProbOracleComp J α) :

Library construction (no cited definition): adapt a J-oracle program into a K-oracle program by translating each query with queryMap and each reply with replyBack.

def Cslib.Crypto.Protocols.UC.WordInterface.PortMap.inr {ιL ιR : Type} {L : ιL → Type} {R : ιR → Type} (iL : WordInterface L) (iR : WordInterface R) :
iR.PortMap (iL.sum iR)

Library construction (no cited definition): the right-injection PortMap embedding iR into iL.sum iR. Its adapt equals Machine.liftRightProgram L.

def Cslib.Crypto.Protocols.UC.WordInterface.PortMap.inl {ιL ιR : Type} {L : ιL → Type} {R : ιR → Type} (iL : WordInterface L) (iR : WordInterface R) :
iL.PortMap (iL.sum iR)

Library construction (no cited definition): the left-injection PortMap embedding iL into iL.sum iR.

theorem Cslib.Crypto.Protocols.UC.WordInterface.isOraclePPTOn_lowerWith_adapt {ιJ ιK α β : Type} {J : ιJ → Type} {K : ιK → Type} {iJ : WordInterface J} {iK : WordInterface K} (m : iJ.PortMap iK) {input : α ↪ List Bool} {output : β ↪ List Bool} {program : α → ProbOracleComp J β} {r capIn : α → ℕ} (hprogram : Probability.IsOraclePPTOn input output fun (a : α) => ProbOracleComp.lowerWith iJ (capIn a) (program a)) (hr : Turing.MultiTapeTM.ComputableInPolyTime r input Turing.MultiTapeTM.encUnary) (hfit : ∀ (a : α) (c : iJ.Channel) (w : List Bool), (m.replyMap c (List.take (r a) w)).length ≤ capIn a) :
Probability.IsOraclePPTOn input output fun (a : α) => ProbOracleComp.lowerWith iK (r a) (m.adapt (program a))

Library infrastructure (no cited result): adapting a lowered strict oracle-PPT program through a WordInterface.PortMap preserves IsOraclePPTOn, provided every translated r a-truncated reply fits inside the inner reply cap capIn a.

theorem Cslib.Crypto.Protocols.UC.WordInterface.PortMap.support_lowerWith_adapt {ιJ ιK α : Type} {J : ιJ → Type} {K : ιK → Type} {iJ : WordInterface J} {iK : WordInterface K} (m : iJ.PortMap iK) (hreply : ∀ (c : iJ.Channel) (w : List Bool), m.replyMap c w = w) (limit : ℕ) (program : ProbOracleComp J α) :

Library infrastructure (no cited result): adapting through a PortMap whose word-level reply translation is the identity leaves the support of the lowered program unchanged.

theorem Cslib.Crypto.Protocols.UC.support_lowerWith_liftParty {n : ℕ} {SubIn SubOut NQ NR α : Type} (subParty : WordPort (Fin n × SubIn) (Option SubOut)) (nq : WordPort NQ NR) (limit : ℕ) (program : ProbOracleComp (partySpec n SubIn SubOut) α) :

Library infrastructure (no cited result): lowering a liftParty program through WordInterface.protocol subParty nq has the same OracleComp.support as lowering the underlying party-interface program through WordInterface.net subParty.

Static-corruption routing (routeCorrupt and corruptRouter) #

def Cslib.Crypto.Protocols.UC.PPTCertificate.routeCorrupt {n : ℕ} {ιI : Type} {I : ιI → Type} {In Out NetQ NetR : Type} {M : ℕ → Finset (Fin n) → Machine I (protocolSpec n In Out NetQ NetR)} {iI : WordInterface I} {party : WordPort (Fin n × In) (Option Out)} {netPort : WordPort NetQ NetR} (hparty : Turing.MultiTapeTM.ComputableInPolyTime (fun (w : List Bool) => (party.queryDecoder.decode w).1) Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encFinite (Fin n))) (cert : PPTCertificate M iI (WordInterface.protocol party netPort)) :
PPTCertificate (fun (κ : ℕ) (C : Finset (Fin n)) => UC.routeCorrupt C (M κ C)) iI (WordInterface.protocol party (party.sum netPort))

Library construction (no cited definition): lift a PPTCertificate through routeCorrupt, preserving the state codec and adding cert.growth p w.tail to cover tag-stripped routed requests.

theorem Cslib.Crypto.Protocols.UC.Machine.IsPPTFamily.routeCorrupt {n : ℕ} {ιI : Type} {I : ιI → Type} {In Out NetQ NetR : Type} {M : ℕ → Finset (Fin n) → Machine I (protocolSpec n In Out NetQ NetR)} {iI : WordInterface I} {party : WordPort (Fin n × In) (Option Out)} {netPort : WordPort NetQ NetR} (hparty : Turing.MultiTapeTM.ComputableInPolyTime (fun (w : List Bool) => (party.queryDecoder.decode w).1) Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encFinite (Fin n))) (h : IsPPTFamily M iI (WordInterface.protocol party netPort)) :
IsPPTFamily (fun (κ : ℕ) (C : Finset (Fin n)) => UC.routeCorrupt C (M κ C)) iI (WordInterface.protocol party (party.sum netPort))

Library infrastructure (no cited result): static-corruption routing (routeCorrupt) preserves Machine.IsPPTFamily whenever the party port exposes the decoded party index in polynomial time (automatic for WordPort.party via WordPort.computable_partyIndex).

theorem Cslib.Crypto.Protocols.UC.Protocol.IsPPT.corruptRouter {n : ℕ} {In Out NetQ NetR : Type} {π : Protocol n In Out NetQ NetR} {party : WordPort (Fin n × In) (Option Out)} {netPort : WordPort NetQ NetR} (hparty : Turing.MultiTapeTM.ComputableInPolyTime (fun (w : List Bool) => (party.queryDecoder.decode w).1) Turing.MultiTapeTM.encBits (Turing.MultiTapeTM.encFinite (Fin n))) (h : π.IsPPT party netPort) :
IsPPT (fun (κ : ℕ) (C : Finset (Fin n)) => UC.corruptRouter C (π κ C)) party (party.sum netPort)

Library infrastructure (no cited result): static-corruption routing (corruptRouter) preserves Protocol.IsPPT whenever the party port exposes the decoded party index in polynomial time (automatic for WordPort.party via WordPort.computable_partyIndex).

Hybrid wrapper (hybridWrap) #

def Cslib.Crypto.Protocols.UC.HybridProtocol.IsPPT {n : ℕ} {In Out NetQ NetR SubIn SubOut : Type} (ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut) (party : WordPort (Fin n × In) (Option Out)) (net : WordPort NetQ NetR) (subParty : WordPort (Fin n × SubIn) (Option SubOut)) :

Library construction (no cited definition; follows the typed-object-plus-encoding convention of AdversaryOf.IsPPT, not Definition 6 of [Can20a]): a hybrid protocol is strict PPT in this library's word model for its party port party, network port net, and the party port subParty of its subroutine. No implication to or from HybridProtocol.PolyBounded is claimed.

def Cslib.Crypto.Protocols.UC.PPTCertificate.hybridWrap {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} {ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut} {party : WordPort (Fin n × In) (Option Out)} {net : WordPort NetQ NetR} {subParty : WordPort (Fin n × SubIn) (Option SubOut)} {nq : WordPort NQ NR} (cert : PPTCertificate ρ (WordInterface.net subParty) (WordInterface.protocol party net)) :
PPTCertificate (fun (κ : ℕ) (C : Finset (Fin n)) => UC.hybridWrap (ρ κ C)) (WordInterface.protocol subParty nq) (WordInterface.protocol party (net.sum nq))

Library construction (no cited definition): lift a hybrid protocol's PPTCertificate through hybridWrap, preserving the state codec; subroutine-network requests are forwarded and leave the state word normalized.

theorem Cslib.Crypto.Protocols.UC.HybridProtocol.IsPPT.hybridWrap {n : ℕ} {In Out NetQ NetR SubIn SubOut NQ NR : Type} {ρ : HybridProtocol n In Out NetQ NetR SubIn SubOut} {party : WordPort (Fin n × In) (Option Out)} {net : WordPort NetQ NetR} {subParty : WordPort (Fin n × SubIn) (Option SubOut)} {nq : WordPort NQ NR} (h : ρ.IsPPT party net subParty) :
Machine.IsPPTFamily (fun (κ : ℕ) (C : Finset (Fin n)) => UC.hybridWrap (ρ κ C)) (WordInterface.protocol subParty nq) (WordInterface.protocol party (net.sum nq))

Library infrastructure (no cited result), toward #6043: hybridWrap preserves strict PPT.

Machine lifting (liftRight and liftAdversary) #

theorem Cslib.Crypto.Protocols.UC.support_lowerWith_liftRightProgram {ιL ιR α : Type} {L : ιL → Type} {R : ιR → Type} (iL : WordInterface L) (iR : WordInterface R) (limit : ℕ) (program : ProbOracleComp R α) :

Library infrastructure (no cited result): lowering a right-lifted program through iL.sum iR has the same OracleComp.support as lowering the underlying program through iR.

def Cslib.Crypto.Protocols.UC.PPTCertificate.liftRight {n : ℕ} {ιL ιR ιE : Type} {L : ιL → Type} {R : ιR → Type} {E : ιE → Type} {M : ℕ → Finset (Fin n) → Machine R E} {iR : WordInterface R} {iE : WordInterface E} (iL : WordInterface L) (cert : PPTCertificate M iR iE) :
PPTCertificate (fun (κ : ℕ) (C : Finset (Fin n)) => Machine.liftRight L (M κ C)) (iL.sum iR) (iL.sum iE)

Library construction (no cited definition): lift a PPTCertificate through Machine.liftRight, preserving the state codec and additive growth bound.

theorem Cslib.Crypto.Protocols.UC.Machine.IsPPTFamily.liftRight {n : ℕ} {ιL ιR ιE : Type} {L : ιL → Type} {R : ιR → Type} {E : ιE → Type} {M : ℕ → Finset (Fin n) → Machine R E} {iL : WordInterface L} {iR : WordInterface R} {iE : WordInterface E} (h : IsPPTFamily M iR iE) :
IsPPTFamily (fun (κ : ℕ) (C : Finset (Fin n)) => Machine.liftRight L (M κ C)) (iL.sum iR) (iL.sum iE)

Library infrastructure (no cited result): lifting a strict-PPT machine family past an arbitrary left word interface preserves Machine.IsPPTFamily.

def Cslib.Crypto.Protocols.UC.PPTCertificate.liftAdversary {n : ℕ} {In Out NetQ NetR AdvQ AdvR : Type} {A : Adversary n AdvQ AdvR NetQ NetR} {netPort : WordPort NetQ NetR} {adv : WordPort AdvQ AdvR} (party : WordPort (Fin n × In) (Option Out)) (cert : PPTCertificate A (WordInterface.net netPort) (WordInterface.net adv)) :
PPTCertificate (fun (κ : ℕ) (C : Finset (Fin n)) => UC.liftAdversary (A κ C)) (WordInterface.protocol party netPort) (WordInterface.exec party adv)

Library construction (no cited definition): lift an adversary's PPTCertificate through liftAdversary.

theorem Cslib.Crypto.Protocols.UC.Adversary.IsPPT.liftAdversary {n : ℕ} {In Out NetQ NetR AdvQ AdvR : Type} {A : Adversary n AdvQ AdvR NetQ NetR} {party : WordPort (Fin n × In) (Option Out)} {netPort : WordPort NetQ NetR} {adv : WordPort AdvQ AdvR} (h : A.IsPPT netPort adv) :
Machine.IsPPTFamily (fun (κ : ℕ) (C : Finset (Fin n)) => UC.liftAdversary (A κ C)) (WordInterface.protocol party netPort) (WordInterface.exec party adv)

Library infrastructure (no cited result): lifting a strict-PPT adversary past the party port (liftAdversary) preserves strict PPT.