Documentation

CslibFrontier.Crypto.Protocols.UC.HybridFunctionality

Ideal functionalities with a private outgoing call port #

This module defines UC.HybridFunctionality, an n-party ideal functionality equipped with a private outgoing call port G, in this library's call-and-return, call-bounded port model. Each activation (onInput for party inputs and onBackdoor for adversary backdoor queries) is a stateful ProbOracleComp G program that may call G and wait for the answer before continuing. Closing F with a closed resource machine R κ C : Machine OracleSpec.empty G via HybridFunctionality.close F R yields an ordinary UC.Protocol by sequential machine composition (F.toMachine κ C).comp (R κ C), reusing Machine.comp from CslibFrontier.Crypto.Protocols.UC.Machine.

Model and scope #

Main definitions #

Main results #

References #

structure Cslib.Crypto.Protocols.UC.HybridFunctionality (n : ℕ) (In Out BackQ BackR : Type) {ιG : Type} (G : ιG → Type) :

Library construction (no cited definition): an n-party ideal functionality with a private outgoing call port G in this library's call-and-return reading, where onInput and onBackdoor may call G and wait for the answer. The general mechanism in [Can20a], Section 3.1.2 (JACM p. 28:23), is the external-write instruction, restricted here to call-and-return.

  • State : Type

    The private state.

  • init : ℕ → Finset (Fin n) → ProbComp self.State

    The initial state, given the security parameter and the corrupted parties.

  • onInput : Fin n → In → StateT self.State (ProbOracleComp G) (Option Out)

    Party i gives input x (or polls) and receives its pending output, if any; the activation may call the resource port G.

  • onBackdoor : BackQ → StateT self.State (ProbOracleComp G) BackR

    A backdoor query of the adversary; the activation may call the resource port G.

def Cslib.Crypto.Protocols.UC.HybridFunctionality.toMachine {n : ℕ} {In Out BackQ BackR ιG : Type} {G : ιG → Type} (F : HybridFunctionality n In Out BackQ BackR G) (κ : ℕ) (C : Finset (Fin n)) :
Machine G (protocolSpec n In Out BackQ BackR)

Library construction (no cited result): the interactive machine of F for security parameter κ and corrupted parties C: party inputs go to onInput, the network port is the backdoor, and resource calls go out on G.

def Cslib.Crypto.Protocols.UC.HybridFunctionality.close {n : ℕ} {In Out BackQ BackR ιG : Type} {G : ιG → Type} (F : HybridFunctionality n In Out BackQ BackR G) (R : ℕ → Finset (Fin n) → Machine OracleSpec.empty G) :
Protocol n In Out BackQ BackR

Library construction (no cited result): F with its resource calls answered by R, a private resource indexed by (κ, C) with no direct raw resource port for the environment or the adversary; all resource calls are mediated by F, either through a permitted (including corrupted) party activation via onInput or through onBackdoor. Because close uses Machine.comp, R κ C is initialized before F.init κ C.

def Cslib.Crypto.Protocols.UC.IdealFunctionality.toHybrid {n : ℕ} {In Out BackQ BackR : Type} (F : IdealFunctionality n In Out BackQ BackR) :

Library construction (no cited result): an ideal functionality viewed as a hybrid functionality over the empty resource interface OracleSpec.empty.

@[simp]
theorem Cslib.Crypto.Protocols.UC.IdealFunctionality.toHybrid_toMachine {n : ℕ} {In Out BackQ BackR : Type} (F : IdealFunctionality n In Out BackQ BackR) (κ : ℕ) (C : Finset (Fin n)) :

Library infrastructure (no cited result): converting an ideal functionality to a hybrid functionality and then to a machine recovers IdealFunctionality.toProtocol.

theorem Cslib.Crypto.Protocols.UC.HybridFunctionality.close_polyBounded {n : ℕ} {In Out BackQ BackR ιG : Type} {G : ιG → Type} {F : HybridFunctionality n In Out BackQ BackR G} {R : ℕ → Finset (Fin n) → Machine OracleSpec.empty G} {p q : Polynomial ℕ} (hF : ∀ (κ : ℕ) (C : Finset (Fin n)), (F.toMachine κ C).IsBounded (Polynomial.eval κ p)) (hR : ∀ (κ : ℕ) (C : Finset (Fin n)), (R κ C).IsBounded (Polynomial.eval κ q)) :
(F.close R).PolyBounded (p * (q + 1) + q)

Library infrastructure (no cited result), in this library's call-bounded port model (budgets bound oracle call counts only; computational polynomial time is open in #6043): closing a bounded hybrid functionality with a bounded resource gives a bounded protocol.

theorem Cslib.Crypto.Protocols.UC.HybridFunctionality.exec_close {n : ℕ} {In Out BackQ BackR AdvQ AdvR ιG : Type} {G : ιG → Type} (F : HybridFunctionality n In Out BackQ BackR G) (R : ℕ → Finset (Fin n) → Machine OracleSpec.empty G) (A : ExecAdversary n In Out BackQ BackR AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :
exec (F.close R) A C Z κ z = (R κ C).run ((routeCorrupt C (F.toMachine κ C)).link (absorbAdversary C A Z κ z))

Library infrastructure (no cited result): running the UC execution of F.close R is, as an exact equation of programs, running the private resource R κ C against the program that links absorbAdversary C A Z κ z with the corruption-routed machine routeCorrupt C (F.toMachine κ C).

theorem Cslib.Crypto.Protocols.UC.HybridFunctionality.advantage_close {n : ℕ} {In Out BackQ BackR AdvQ AdvR ιG : Type} {G : ιG → Type} (F : HybridFunctionality n In Out BackQ BackR G) (R R' : ℕ → Finset (Fin n) → Machine OracleSpec.empty G) (A : ExecAdversary n In Out BackQ BackR AdvQ AdvR) (C : Finset (Fin n)) (Z : Environment n In Out AdvQ AdvR) (κ : ℕ) (z : List Bool) :
advantage (F.close R) (F.close R') A A C Z κ z = SSP.advantage ((routeCorrupt C (F.toMachine κ C)).link (absorbAdversary C A Z κ z)) (R κ C) (R' κ C)

Library infrastructure (no cited result): swapping the private resource of a hybrid functionality is a state-separating reduction. The environment's advantage between F.close R and F.close R' (with the same adversary) equals the SSP.advantage between the two resources for the program that links absorbAdversary C A Z κ z with routeCorrupt C (F.toMachine κ C).

theorem Cslib.Crypto.Protocols.UC.HybridFunctionality.isQueryBounded_closeReduction {n : ℕ} {In Out BackQ BackR AdvQ AdvR ιG : Type} {G : ιG → Type} {F : HybridFunctionality n In Out BackQ BackR G} {A : ExecAdversary n In Out BackQ BackR AdvQ AdvR} {Z : Environment n In Out AdvQ AdvR} {pF pA pZ : Polynomial ℕ} (hF : ∀ (κ : ℕ) (C : Finset (Fin n)), (F.toMachine κ C).IsBounded (Polynomial.eval κ pF)) (hA : Adversary.PolyBounded A pA) (hZ : Z.PolyBounded pZ) (C : Finset (Fin n)) (κ : ℕ) (z : List Bool) :

Library infrastructure (no cited result), in this library's call-bounded port model (budgets bound oracle call counts only; computational polynomial time is open in #6043): call budget for the resource-swap reduction program in HybridFunctionality.advantage_close.