Documentation

CslibFrontier.Crypto.Protocols.UC.PPT.Link

Strict-PPT closure of UC linking #

Library infrastructure toward #6043 (no cited result): proves that linking a strict-PPT UC environment with a strict-PPT machine family preserves Environment.IsPPT when a polynomial-time computable cap covers every reply on their interaction. A machine-wide reply bound (Machine.IsReplyBounded) gives such a cap for every caller.

Modelling decisions and restrictions #

The caller-relative theorem below also admits machine families with unbounded exports when the specified caller reaches only replies covered by an efficiently computable cap.

Main definitions #

Main results #

Message-bound predicates #

def Cslib.Crypto.Protocols.UC.Machine.IsReplyBounded {n : ℕ} {ιI ιE : Type} {I : ιI → Type} {E : ιE → Type} (M : ℕ → Finset (Fin n) → Machine I E) (iI : WordInterface I) (iE : WordInterface E) :

Library construction (no cited definition): every encoded reply that the machine family M exports, in any activation from any state with imported replies read up to p.replyBound bits, has length at most a polynomial in (encPPTParam n p).length alone.

Transfer lemmas #

theorem Cslib.Crypto.Protocols.UC.Machine.IsReplyBounded.routeCorrupt {n : ℕ} {ιI : Type} {I : ιI → Type} {In Out NetQ NetR : Type} {iI : WordInterface I} {party : WordPort (Fin n × In) (Option Out)} {netPort : WordPort NetQ NetR} {M : ℕ → Finset (Fin n) → Machine I (protocolSpec n In Out NetQ NetR)} (h : IsReplyBounded M iI (WordInterface.protocol party netPort)) :
IsReplyBounded (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 preserves Machine.IsReplyBounded; every routed reply is either a party/network reply from M (possibly tagged with one sum bit) or a constant none reply.

theorem Cslib.Crypto.Protocols.UC.WordInterface.exists_polyBounded_reply_take {n : ℕ} {ι : Type} {E : ι → Type} (I : WordInterface E) :
∃ (bound : PPTParam n → ℕ), Turing.MultiTapeTM.PolyBounded (fun (p : PPTParam n) => ((encPPTParam n) p).length) bound ∧ ∀ (p : PPTParam n) (q : ι) (w : List Bool), ((I.reply q) (I.decodeReply q (List.take p.replyBound w))).length ≤ bound p

Library infrastructure (no cited result): a reply word truncated at p.replyBound, decoded and re-encoded through a WordInterface, has length at most a polynomial in (encPPTParam n p).length.

theorem Cslib.Crypto.Protocols.UC.Machine.isReplyBounded_id {n : ℕ} {ι : Type} {E : ι → Type} (I : WordInterface E) :
IsReplyBounded (fun (x : ℕ) (x_1 : Finset (Fin n)) => id E) I I

Library infrastructure (no cited result): the forwarding machine Machine.id is Machine.IsReplyBounded: each exported reply is an imported reply truncated at p.replyBound and re-encoded.

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

Library infrastructure (no cited result): lifting a reply-bounded machine family past a left pass-through interface preserves Machine.IsReplyBounded; forwarded left-channel replies are normalized from at most p.replyBound bits in polynomial time, and right-channel replies are bounded by M's bound.

theorem Cslib.Crypto.Protocols.UC.Machine.IsReplyBounded.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 : IsReplyBounded ρ (WordInterface.net subParty) (WordInterface.protocol party net)) :
IsReplyBounded (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 Machine.IsReplyBounded; network replies gain one sum bit, and forwarded subroutine-network replies are bounded as for Machine.id.

Linking #

inductive Cslib.Crypto.Protocols.UC.RepliesFitOn {ιI ιE α : Type} {I : ιI → Type} {E : ιE → Type} (m : Machine I E) (iI : WordInterface I) (iE : WordInterface E) (b L : ℕ) {State : Type} (oracle : iI.Channel × List Bool → StateT State PMF (List Bool)) :
ProbOracleComp E α → m.State → State → Prop

Every actually returned exported word fits the cap along this typed execution. The imported oracle and its state are shared by the handler and the continuation.

theorem Cslib.Crypto.Protocols.UC.RepliesFitOn.mono_cap {ιI ιE α : Type} {I : ιI → Type} {E : ιE → Type} {m : Machine I E} {iI : WordInterface I} {iE : WordInterface E} {b L L' : ℕ} {State : Type} {oracle : iI.Channel × List Bool → StateT State PMF (List Bool)} {prog : ProbOracleComp E α} {s0 : m.State} {s : State} (h : RepliesFitOn m iI iE b L oracle prog s0 s) (larger : L ≤ L') :
RepliesFitOn m iI iE b L' oracle prog s0 s

The typed execution visits the same continuations when its proof uses a larger cap.

theorem Cslib.Crypto.Protocols.UC.RepliesFitOn.of_global {ιI ιE α : Type} {I : ιI → Type} {E : ιE → Type} (m : Machine I E) (iI : WordInterface I) (iE : WordInterface E) (b L : ℕ) {State : Type} (oracle : iI.Channel × List Bool → StateT State PMF (List Bool)) (bound : ∀ (q : ιE) (s0 : m.State), ∀ x ∈ OracleComp.support (ProbOracleComp.lowerWith iI b ((m.handle q).run s0)), ((iE.reply q) x.1).length ≤ L) (prog : ProbOracleComp E α) (s0 : m.State) (s : State) :
RepliesFitOn m iI iE b L oracle prog s0 s

The global reply-length premise from Frontier's existing linking theorem suffices on every supported continuation, for every imported stateful oracle.

theorem Cslib.Crypto.Protocols.UC.runWith_wordHandle_lowerWith_eq_runWith_lowerWith_runFrom_of_repliesFit {n : ℕ} {ιI ιE α : Type} {I : ιI → Type} {E : ιE → Type} (M : ℕ → Finset (Fin n) → Machine I E) (iI : WordInterface I) (iE : WordInterface E) (codec : StateCodec M) (p : PPTParam n) (L : ℕ) (prog : ProbOracleComp E α) {State : Type} (oracle : iI.Channel × List Bool → StateT State PMF (List Bool)) (s0 : (M p.secParam p.corrupted).State) (s : State) (hfit : RepliesFitOn (M p.secParam p.corrupted) iI iE p.replyBound L oracle prog s0 s) :
ProbOracleComp.runWith oracle ((OracleComp.interpret (OracleComp.sumHandler (fun (k : ℕ) => StateT.lift (ProbOracleComp.sample (ProbComp.unifFin k))) (wordHandle M iI iE codec p)) (ProbOracleComp.lowerWith iE L prog)).run ((codec p.secParam p.corrupted).enc s0)) s = PMF.map (fun (x : (α × (M p.secParam p.corrupted).State) × State) => match x with | ((a, nextMachine), nextOracle) => ((a, (codec p.secParam p.corrupted).enc nextMachine), nextOracle)) (ProbOracleComp.runWith oracle (ProbOracleComp.lowerWith iI p.replyBound ((M p.secParam p.corrupted).runFrom prog s0)) s)

Truncating exported replies preserves the full joint distribution of result, encoded machine state and imported-oracle state on a supported execution.

def Cslib.Crypto.Protocols.UC.Computational.ReplyCap {n : ℕ} {ι : Type} {I : ι → Type} {In Out Q R : Type} (M : ℕ → Finset (Fin n) → Machine I (execSpec n In Out Q R)) (iI : WordInterface I) (party : WordPort (Fin n × In) (Option Out)) (adv : WordPort Q R) (C : Finset (Fin n)) (Z : Environment n In Out Q R) :

A uniform caller-specific cap on encoded machine replies for a fixed static corruption set. The same polynomial-time computable cap covers all external stateful oracles and each supported initial machine state. It can depend on the security parameter, auxiliary word and reply bound.

theorem Cslib.Crypto.Protocols.UC.Computational.ReplyCap.of_global {n : ℕ} {ι : Type} {I : ι → Type} {In Out Q R : Type} {M : ℕ → Finset (Fin n) → Machine I (execSpec n In Out Q R)} {iI : WordInterface I} {party : WordPort (Fin n × In) (Option Out)} {adv : WordPort Q R} (Z : Environment n In Out Q R) (C : Finset (Fin n)) (hMR : Machine.IsReplyBounded M iI (WordInterface.exec party adv)) :
ReplyCap M iI party adv C Z

A polynomial majorant of a machine-wide reply bound gives a computable cap for each caller.