Documentation

CslibFrontier.Crypto.Protocols.MPC.Yao.Family

Yao's protocol over a garbling scheme in the ideal OT hybrid model #

This module defines two word-level protocol families (Cslib.Crypto.Protocols.MPC.ProtocolFamily) running Yao's two-party protocol [Yao86] in the ideal batchOTWorld (batchOTSpec) oblivious-transfer hybrid model (#6045), rather than composing with concrete 1-out-of-2 oblivious-transfer executions as in Protocol 2 of Lindell and Pinkas [LP09] (ePrint 2004/175, §4.2, p. 15) or §7.1 of Bellare, Hoang and Rogaway [BHR12b] (p. 34, Fig. 16):

Both families are parameterized over any garbling scheme G : Garbling.Scheme Fn of [BHR12b] whose input encoding is projectiveEncode: projective in the sense of §3.2 (p. 8), in the word layout of point-and-permute and half-gates garbling, with 2 n tokens of one width.

The public parameters Yao.Params G are a function description fn, known to both parties, and the number garblerLen of its input bits held by the garbler (party 0); the evaluator (party 1) holds the rest. At the security parameter n:

  1. the garbler draws G.coins n fn fair coins, garbles fn to (F, e, d) with G.gb, and sends F, the tokens of its own input bits (projectiveToken) and d (Yao.garblerMessage);
  2. one batched oblivious transfer gives the evaluator the tokens of its own input bits, from the pairs that the garbler offers (Yao.garblerOffer);
  3. the evaluator evaluates F on all the tokens and decodes with d (Yao.evaluatorOutput): in Yao.oneSidedProtocol the garbler outputs [] and the evaluator outputs this decoding; in Yao.protocol the evaluator sends it back and both parties output it.

When G is correct, the evaluator's decoding equals G.ev fn x on the garbler's bits followed by the evaluator's (Yao.circuitInput) in every run at a parameter n ≥ 1 (Yao.oneSided_output_of_mem_support, Yao.output_of_mem_support); the correctness of Garbling.Scheme.Correct is stated for k ≥ 1.

Yao.oneSidedEncoding G encFn and Yao.encoding G encFn write the public parameters, inputs, outputs and views as words, for the efficiency predicates of ProtocolFamily.SemiHonestSecure. A corrupted garbler sees its input and coins (and, in Yao.family, the output returned in the final round): Yao.oneSidedGarblerSim and Yao.garblerSim draw fresh coins, match the real joint law at every n ≥ 1 (Yao.idealJoint_oneSidedGarblerSim, Yao.idealJoint_garblerSim), and are PPT when G computes its coin count in polynomial time (Yao.isPPT_oneSidedGarblerSim, Yao.isPPT_garblerSim). So both families are semi-honest secure against the garbler in the batchOTWorld hybrid (Yao.hybridSemiHonestSecure_oneSided_garbler, Yao.hybridSemiHonestSecure_garbler), with no computational assumption. These are steps towards Theorem 7 of Lindell and Pinkas (#6045), not that theorem or its Case 1 (p. 16). Case 1 simulates the garbler's view of the oblivious-transfer protocol and then uses correctness (Claim 6); in the hybrid model the garbler's view of the transfer is empty, so only the correctness step remains.

Comparison with [LP09] and [BellareHoangRogaway2009 / 2012] #

Main definitions #

Main results #

References #

The protocol #

The public parameters of Yao's protocol over the garbling scheme G: a function description fn, known to both parties, and the number garblerLen of its input bits that the garbler holds, the first ones. The evaluator holds the other G.inLen fn - garblerLen.

  • fn : Fn

    The function description.

  • garblerLen : ℕ

    The number of input bits that the garbler holds.

  • garblerLen_le : self.garblerLen ≤ G.inLen self.fn

    The garbler holds at most all the input bits.

@[reducible, inline]

The number of input bits that the evaluator holds.

@[reducible, inline]

The parties' inputs: c.garblerLen bits for the garbler (party 0) and c.evaluatorLen bits for the evaluator (party 1).

@[reducible, inline]

The parties' coins: the garbler's coin string for Gb; the evaluator uses none.

def Cslib.Crypto.Protocols.MPC.Yao.circuitInput {Fn : Type} {G : Garbling.Scheme Fn} {c : Params G} (x : (i : Fin 2) → Input c i) :

The input of the function: the garbler's bits followed by the evaluator's.

theorem Cslib.Crypto.Protocols.MPC.Yao.length_circuitInput {Fn : Type} {G : Garbling.Scheme Fn} {c : Params G} (x : (i : Fin 2) → Input c i) :

The input of the function has G.inLen c.fn bits.

The garbler's message: the garbled function F, the tokens of the garbler's input bits and the decoding information d.

  • fn : List Bool

    The garbled function F.

  • labels : List (List Bool)

    The tokens of the garbler's input bits.

  • decInfo : List Bool

    The decoding information d.

theorem Cslib.Crypto.Protocols.MPC.Yao.Message.ext {x y : Message} (fn : x.fn = y.fn) (labels : x.labels = y.labels) (decInfo : x.decInfo = y.decInfo) :
x = y
@[reducible, inline]

The schedule of the one-sided protocol: the garbler sends its message, and the parties run one batched oblivious transfer of the tokens of the evaluator's input bits.

@[reducible, inline]

The schedule of the two-output protocol: oneSidedSchedule c followed by the evaluator sending the decoded output to the garbler.

@[reducible, inline]

A party's local state after the oblivious transfer.

@[reducible, inline]

A party's final local state in protocol.

The output tuple of the one-sided protocol for a decoded output y: [] for the garbler (party 0) and y for the evaluator (party 1).

The one-sided functionality ([BHR12b], §7.1, Fig. 16, p. 34): the garbler outputs [] and the evaluator learns G.ev c.fn on the garbler's bits followed by the evaluator's.

The two-output functionality ([LP09], Protocol 2, §4.2, p. 15): both parties learn G.ev c.fn on the garbler's bits followed by the evaluator's.

The garbler's message at parameter n on input x₀ and coins coins: garble c.fn to (F, e, d) and send F, the token of each bit of x₀ and d.

The garbler's offer to the oblivious transfer at parameter n with coins coins: both tokens of each of the evaluator's input bits.

def Cslib.Crypto.Protocols.MPC.Yao.evaluatorOutput {Fn : Type} (G : Garbling.Scheme Fn) (msg : Message) {ℓ : ℕ} (labels : Fin ℓ → List Bool) :

The evaluator's output: evaluate F on the garbler's tokens followed by the evaluator's own and decode with d, or the empty word if decoding fails.

The oblivious-transfer queries: the garbler offers both tokens of each of the evaluator's input bits, and the evaluator chooses with its input bits.

The parties' outputs in oneSidedProtocol: [] for the garbler and the decoded output for the evaluator.

The parties' outputs in protocol: the garbler outputs what the evaluator sent, and the evaluator its decoding.

One-sided Yao's protocol over the garbling scheme G at parameter n ([BHR12b], §7.1, Fig. 16, p. 34, in the ideal batchOTSpec oblivious-transfer hybrid): the garbler garbles c.fn with G.coins n c.fn fair coins and sends F, the tokens of its input bits and d; one batched oblivious transfer gives the evaluator the tokens of its input bits; the garbler outputs [], and the evaluator evaluates and decodes.

@[reducible, inline]

One-sided Yao's protocol as a protocol family over the garbling scheme G: at parameter n and public parameters c, Yao.oneSidedProtocol G n c in the hybrid model of the batched oblivious transfer batchOTSpec c.evaluatorLen (List Bool), computing Yao.oneSidedFunctionality G c.

noncomputable def Cslib.Crypto.Protocols.MPC.Yao.protocol {Fn : Type} (G : Garbling.Scheme Fn) (n : ℕ) (c : Params G) :

Yao's protocol over the garbling scheme G at parameter n (Protocol 2 of [LP09], §4.2, p. 15, over a projective garbling scheme and one ideal batched oblivious transfer): the garbler garbles c.fn with G.coins n c.fn fair coins and sends F, the tokens of its input bits and d; one batched oblivious transfer gives the evaluator the tokens of its input bits; the evaluator evaluates and decodes, sends the result to the garbler, and both output it.

@[reducible, inline]

Yao's protocol as a protocol family over the garbling scheme G: at parameter n and public parameters c, Yao.protocol G n c in the hybrid model of the batched oblivious transfer batchOTSpec c.evaluatorLen (List Bool), computing Yao.functionality G c.

Views and runs #

The garbler's view in oneSidedProtocol, from its input x₀ and its coins: it receives nothing.

The evaluator's view in oneSidedProtocol, from its input x₁, the garbler's message and the tokens that the oblivious transfer delivers.

The garbler's view in protocol, from its input x₀, its coins and the output y that the evaluator sends: it receives nothing else.

The evaluator's view in protocol, from its input x₁, the garbler's message and the tokens that the oblivious transfer delivers; it sends the last message and receives nothing in that round.

def Cslib.Crypto.Protocols.MPC.Yao.runOutput {Fn : Type} (G : Garbling.Scheme Fn) (n : ℕ) (c : Params G) (x : (i : Fin 2) → Input c i) (coins : List Bool) :

The evaluator's decoded output in a run on inputs x with the garbler's coins coins.

def Cslib.Crypto.Protocols.MPC.Yao.oneSidedViews {Fn : Type} (G : Garbling.Scheme Fn) (n : ℕ) (c : Params G) (x : (i : Fin 2) → Input c i) (coins : List Bool) (i : Fin 2) :

Both parties' views in a run of oneSidedProtocol on inputs x with the garbler's coins coins: oneSidedGarblerView for party 0 and oneSidedEvaluatorView for party 1.

theorem Cslib.Crypto.Protocols.MPC.Yao.realJoint_oneSided {Fn : Type} (G : Garbling.Scheme Fn) (I : Finset (Fin 2)) (n : ℕ) (c : Params G) (x : (i : Fin 2) → Input c i) :

The real joint distribution for any static coalition I in oneSidedProtocol, from the garbler's coins.

The real joint distribution for a corrupted garbler in oneSidedProtocol: fresh coins and nothing received, paired with [] for the garbler and the evaluator's decoding for the evaluator.

theorem Cslib.Crypto.Protocols.MPC.Yao.realJoint_oneSided_evaluator {Fn : Type} (G : Garbling.Scheme Fn) (n : ℕ) (c : Params G) (x : (i : Fin 2) → Input c i) :
(oneSidedProtocol G n c).realJoint (batchOTWorld c.evaluatorLen (List Bool)) {1} x = PMF.map (fun (coins : List Bool) => (singletonView (oneSidedEvaluatorView c (x 1) (garblerMessage G n c (x 0) coins) fun (j : Fin c.evaluatorLen) => garblerOffer G n c coins j (x 1 j)), oneSidedOutputs (runOutput G n c x coins))) (BitString.uniformList (G.coins n c.fn))

The real joint distribution for a corrupted evaluator in oneSidedProtocol: its view holds the garbler's message and the tokens of its own bits, paired with [] for the garbler and its decoding for the evaluator.

theorem Cslib.Crypto.Protocols.MPC.Yao.realJoint_garbler {Fn : Type} (G : Garbling.Scheme Fn) (n : ℕ) (c : Params G) (x : (i : Fin 2) → Input c i) :
(protocol G n c).realJoint (batchOTWorld c.evaluatorLen (List Bool)) {0} x = PMF.map (fun (coins : List Bool) => (singletonView (garblerView c (x 0) coins (runOutput G n c x coins)), fun (x_1 : Fin 2) => runOutput G n c x coins)) (BitString.uniformList (G.coins n c.fn))

The real joint distribution for a corrupted garbler in protocol: fresh coins, and the evaluator's decoding as the message of the last round and as both outputs.

theorem Cslib.Crypto.Protocols.MPC.Yao.realJoint_evaluator {Fn : Type} (G : Garbling.Scheme Fn) (n : ℕ) (c : Params G) (x : (i : Fin 2) → Input c i) :
(protocol G n c).realJoint (batchOTWorld c.evaluatorLen (List Bool)) {1} x = PMF.map (fun (coins : List Bool) => (singletonView (evaluatorView c (x 1) (garblerMessage G n c (x 0) coins) fun (j : Fin c.evaluatorLen) => garblerOffer G n c coins j (x 1 j)), fun (x_1 : Fin 2) => runOutput G n c x coins)) (BitString.uniformList (G.coins n c.fn))

The real joint distribution for a corrupted evaluator in protocol: its view holds the garbler's message and the tokens of its own bits, and both outputs are its decoding.

Correctness #

theorem Cslib.Crypto.Protocols.MPC.Yao.ofFn_projectiveToken_append {Fn : Type} {G : Garbling.Scheme Fn} (e : List Bool) (c : Params G) (x : (i : Fin 2) → Input c i) :
((List.ofFn fun (i : Fin c.garblerLen) => Garbling.projectiveToken e (G.inLen c.fn) (↑i) (x 0 i)) ++ List.ofFn fun (j : Fin c.evaluatorLen) => Garbling.projectiveToken e (G.inLen c.fn) (c.garblerLen + ↑j) (x 1 j)) = List.ofFn fun (i : Fin (circuitInput x).length) => Garbling.projectiveToken e (circuitInput x).length (↑i) (circuitInput x)[i]

The garbler's tokens followed by the evaluator's are the tokens of the bits of the function's input.

theorem Cslib.Crypto.Protocols.MPC.Yao.runOutput_eq {Fn : Type} {G : Garbling.Scheme Fn} (hproj : G.encode = Garbling.projectiveEncode) (hcorrect : G.Correct) {n : ℕ} (hn : 0 < n) (c : Params G) (x : (i : Fin 2) → Input c i) {coins : List Bool} (hcoins : coins.length = G.coins n c.fn) :
runOutput G n c x coins = G.ev c.fn (circuitInput x)

In a run at a parameter n ≥ 1 with coins of the right length, the evaluator decodes the function's output, when G is correct and its encoding is projective.

theorem Cslib.Crypto.Protocols.MPC.Yao.oneSided_output_of_mem_support {Fn : Type} {G : Garbling.Scheme Fn} (hproj : G.encode = Garbling.projectiveEncode) (hcorrect : G.Correct) {n : ℕ} (hn : 0 < n) (c : Params G) (x : (i : Fin 2) → Input c i) {r : ((i : Fin 2) → PartyView (Input c) Coins (oneSidedSchedule c) i) × (Fin 2 → List Bool)} (hr : r ∈ ((oneSidedProtocol G n c).evalWith (batchOTWorld c.evaluatorLen (List Bool)) x).support) :

Correctness of oneSidedProtocol: in every run of Yao.oneSidedProtocol G n c at a parameter n ≥ 1, the garbler outputs [] and the evaluator outputs G.ev c.fn on the garbler's bits followed by the evaluator's, when G is correct and its encoding is projective.

theorem Cslib.Crypto.Protocols.MPC.Yao.output_of_mem_support {Fn : Type} {G : Garbling.Scheme Fn} (hproj : G.encode = Garbling.projectiveEncode) (hcorrect : G.Correct) {n : ℕ} (hn : 0 < n) (c : Params G) (x : (i : Fin 2) → Input c i) {r : ((i : Fin 2) → PartyView (Input c) Coins (schedule c) i) × (Fin 2 → List Bool)} (hr : r ∈ ((protocol G n c).evalWith (batchOTWorld c.evaluatorLen (List Bool)) x).support) :
r.2 = fun (x_1 : Fin 2) => G.ev c.fn (circuitInput x)

Correctness of protocol: in every run of Yao.protocol G n c at a parameter n ≥ 1, both parties output G.ev c.fn on the garbler's bits followed by the evaluator's, when G is correct and its encoding is projective.

Encoding for machines #

The words of a corrupted garbler's view in oneSidedProtocol: its input bits and its coins (it receives nothing).

The encoding of a one-sided garbler's view words: input framed, then coins.

theorem Cslib.Crypto.Protocols.MPC.Yao.encOneSidedGarblerViewWords_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { input := x0 x, coins := x1 x }) encIn encOneSidedGarblerViewWords (fun (x : γ) => T0 x + T1 x) fun (x : γ) => S0 x + S1 x

The words of a corrupted garbler's view in protocol: its input bits, its coins and the output that the evaluator sends it.

  • input : List Bool

    The garbler's input bits.

  • coins : List Bool

    The garbler's coins.

  • output : List Bool

    The output received in the last round.

theorem Cslib.Crypto.Protocols.MPC.Yao.encGarblerViewWords_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List Bool} {T2 S2 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn Turing.MultiTapeTM.encBits T2 S2) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { input := x0 x, coins := x1 x, output := x2 x }) encIn encGarblerViewWords (fun (x : γ) => T0 x + (T1 x + T2 x)) fun (x : γ) => S0 x + (S1 x + S2 x)
theorem Cslib.Crypto.Protocols.MPC.Yao.encGarblerViewWords_input_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → GarblerViewWords} :

The encoding of a garbler's view words: each field in turn, all but the last framed.

theorem Cslib.Crypto.Protocols.MPC.Yao.encGarblerViewWords_output_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → GarblerViewWords} :
theorem Cslib.Crypto.Protocols.MPC.Yao.encGarblerViewWords_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 x2 : γ → List Bool} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn Turing.MultiTapeTM.encBits budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { input := x0 x, coins := x1 x, output := x2 x }) encIn encGarblerViewWords budget
theorem Cslib.Crypto.Protocols.MPC.Yao.encGarblerViewWords_coins_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → GarblerViewWords} :

The words of a corrupted evaluator's view: its input bits, the garbler's message (F, the tokens of the garbler's bits and d) and the tokens of its own bits.

  • input : List Bool

    The evaluator's input bits.

  • fn : List Bool

    The garbled function F.

  • garblerLabels : List (List Bool)

    The tokens of the garbler's input bits.

  • decInfo : List Bool

    The decoding information d.

  • evaluatorLabels : List (List Bool)

    The tokens of the evaluator's input bits, from the oblivious transfer.

theorem Cslib.Crypto.Protocols.MPC.Yao.encEvaluatorViewWords_mk_inO {γ : Type} {encIn : γ ↪ List Bool} {x0 : γ → List Bool} {T0 S0 : γ → ℕ} {x1 : γ → List Bool} {T1 S1 : γ → ℕ} {x2 : γ → List (List Bool)} {T2 S2 : γ → ℕ} {x3 : γ → List Bool} {T3 S3 : γ → ℕ} {x4 : γ → List (List Bool)} {T4 S4 : γ → ℕ} (h0 : Turing.MultiTapeTM.ComputableInO x0 encIn Turing.MultiTapeTM.encBits T0 S0) (h1 : Turing.MultiTapeTM.ComputableInO x1 encIn Turing.MultiTapeTM.encBits T1 S1) (h2 : Turing.MultiTapeTM.ComputableInO x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T2 S2) (h3 : Turing.MultiTapeTM.ComputableInO x3 encIn Turing.MultiTapeTM.encBits T3 S3) (h4 : Turing.MultiTapeTM.ComputableInO x4 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) T4 S4) :
Turing.MultiTapeTM.ComputableInO (fun (x : γ) => { input := x0 x, fn := x1 x, garblerLabels := x2 x, decInfo := x3 x, evaluatorLabels := x4 x }) encIn encEvaluatorViewWords (fun (x : γ) => T0 x + (T1 x + (T2 x + (T3 x + T4 x)))) fun (x : γ) => S0 x + (S1 x + (S2 x + (S3 x + S4 x)))
theorem Cslib.Crypto.Protocols.MPC.Yao.encEvaluatorViewWords_mk_deg :
Turing.MultiTapeTM.ComputableInDegree (fun (p : List Bool × List Bool × List (List Bool) × List Bool × List (List Bool)) => { input := p.1, fn := p.2.1, garblerLabels := p.2.2.1, decInfo := p.2.2.2.1, evaluatorLabels := p.2.2.2.2 }) encEvaluatorViewWordsFields encEvaluatorViewWords 1 1
theorem Cslib.Crypto.Protocols.MPC.Yao.encEvaluatorViewWords_mk_budget {γ : Type} {encIn : γ ↪ List Bool} {budget : γ → ℕ} {x0 x1 : γ → List Bool} {x2 : γ → List (List Bool)} {x3 : γ → List Bool} {x4 : γ → List (List Bool)} (h0 : Turing.MultiTapeTM.ComputableInSpace x0 encIn Turing.MultiTapeTM.encBits budget) (h1 : Turing.MultiTapeTM.ComputableInSpace x1 encIn Turing.MultiTapeTM.encBits budget) (h2 : Turing.MultiTapeTM.ComputableInSpace x2 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) (h3 : Turing.MultiTapeTM.ComputableInSpace x3 encIn Turing.MultiTapeTM.encBits budget) (h4 : Turing.MultiTapeTM.ComputableInSpace x4 encIn (Turing.MultiTapeTM.encList Turing.MultiTapeTM.encBits) budget) :
Turing.MultiTapeTM.ComputableInSpace (fun (x : γ) => { input := x0 x, fn := x1 x, garblerLabels := x2 x, decInfo := x3 x, evaluatorLabels := x4 x }) encIn encEvaluatorViewWords budget

The encoding of an evaluator's view words: each field in turn, all but the last framed.

theorem Cslib.Crypto.Protocols.MPC.Yao.encEvaluatorViewWords_fn_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → EvaluatorViewWords} :
theorem Cslib.Crypto.Protocols.MPC.Yao.encEvaluatorViewWords_input_budget {γ✝ : Type} {encIn✝ : γ✝ ↪ List Bool} {S✝ : γ✝ → ℕ} {g✝ : γ✝ → EvaluatorViewWords} :
@[reducible, inline]

The view words of the two parties in oneSidedProtocol: OneSidedGarblerViewWords for the garbler (party 0) and EvaluatorViewWords for the evaluator (party 1).

@[reducible, inline]

The view words of the two parties in protocol: GarblerViewWords for the garbler (party 0) and EvaluatorViewWords for the evaluator (party 1).

The words of a garbler's view in protocol.

The words of an evaluator's view in protocol.

The encoding of the public parameters: the function description by encFn, framed, then the garbler's input length in unary.

theorem Cslib.Crypto.Protocols.MPC.Yao.encParams_fn_polyTime {Fn : Type} {G : Garbling.Scheme Fn} {encFn : Fn ↪ List Bool} {γ : Type} {enc : γ ↪ List Bool} {c : γ → Params G} (h : Turing.MultiTapeTM.ComputableInPolyTime c enc (encParams encFn)) :
Turing.MultiTapeTM.ComputableInPolyTime (fun (a : γ) => (c a).fn) enc encFn

The function description of computed public parameters is computed in polynomial time.

The garbler's input length of computed public parameters is computed in polynomial time.

The number of transfers of computed public parameters is computed in polynomial time, in unary, when the garbling scheme reads input lengths in polynomial time: it is the input length of the function less the garbler's share. For a uniform family c : ℕ → Yao.Params G it makes fun n => (c n).evaluatorLen polynomially bounded (ComputableInPolyTime.polynomiallyBounded).

The machine representation of the parties' inputs, shared by oneSidedEncoding and encoding: each party's input bit string as its word of bits (List.ofFn).

def Cslib.Crypto.Protocols.MPC.Yao.outputEncoding {Fn : Type} (G : Garbling.Scheme Fn) :
PartyEncoding (Params G) 2 fun (x : ℕ) (x_1 : Params G) (x_2 : Fin 2) => List Bool

The machine representation of the parties' outputs, shared by oneSidedEncoding and encoding: each party's output word verbatim.

The encoding of Yao.oneSidedFamily G for machines, with function descriptions encoded by encFn. The public parameters are written by encParams encFn. Each party's input is the word of its bits, and each output is itself. The views are their view words (oneSidedGarblerViewWords, oneSidedEvaluatorViewWords), encoded by encOneSidedGarblerViewWords and encEvaluatorViewWords.

noncomputable def Cslib.Crypto.Protocols.MPC.Yao.encoding {Fn : Type} (G : Garbling.Scheme Fn) (encFn : Fn ↪ List Bool) :

The encoding of Yao.family G for machines, with function descriptions encoded by encFn. The public parameters are written by encParams encFn. Each party's input is the word of its bits, and each output is itself. The views are their view words (garblerViewWords, evaluatorViewWords), encoded by encGarblerViewWords and encEvaluatorViewWords.

A corrupted garbler #

The simulator family for a corrupted garbler in oneSidedFamily: draw a fresh coin string for Gb and record nothing received.

The simulator family for a corrupted garbler in family: draw a fresh coin string for Gb and deliver the garbler's output as the evaluator's last message.

The one-sided garbler simulator is exact at every parameter n ≥ 1, when G is correct and its encoding is projective: the ideal joint distribution with oneSidedGarblerSim equals the real one.

theorem Cslib.Crypto.Protocols.MPC.Yao.idealJoint_garblerSim {Fn : Type} {G : Garbling.Scheme Fn} (hproj : G.encode = Garbling.projectiveEncode) (hcorrect : G.Correct) {n : ℕ} (hn : 0 < n) (c : Params G) (x : (i : Fin 2) → Input c i) :

The garbler's simulator is exact at every parameter n ≥ 1, when G is correct and its encoding is projective: the ideal joint distribution with garblerSim equals the real one.

The simulator family oneSidedGarblerSim for a corrupted garbler is PPT for oneSidedEncoding G encFn when G computes its coin count in polynomial time.

The simulator family garblerSim for a corrupted garbler is PPT for encoding G encFn when G computes its coin count in polynomial time: it draws G.coins n c.fn fair coins.

Step in the ideal batchOTWorld oblivious-transfer hybrid model (#6045), with no computational assumption: semi-honest security of Yao.oneSidedFamily G against a corrupted garbler, towards Theorem 7 of [LP09] (ePrint 2004/175, §4.2, p. 15; Case 1, p. 16) and Theorem 14 of [BHR12b] (§7.1, p. 35), which compose with a concrete semi-honest 1-out-of-2 oblivious-transfer protocol. For every setup law of the public parameters, when G is correct, its encoding is projectiveEncode and its coin count is computed in polynomial time, the PPT simulator family oneSidedGarblerSim makes the real and ideal games equal at every parameter n ≥ 1.

Semi-honest security of Yao.family G against a corrupted garbler in the ideal batchOTWorld oblivious-transfer hybrid model (#6045), with no computational assumption: a step towards Theorem 7 of [LP09] (ePrint 2004/175, §4.2, p. 15), not plain-model Theorem 7 or its Case 1 (p. 16), which compose with a concrete semi-honest 1-out-of-2 oblivious-transfer protocol. For every setup law of the public parameters, when G is correct, its encoding is projectiveEncode and its coin count is computed in polynomial time, the PPT simulator family garblerSim makes the real and ideal games equal at every parameter n ≥ 1. Case 1 simulates the garbler's view of the oblivious-transfer protocol and then uses correctness; with the ideal batchOTWorld (batchOTSpec) the garbler's view of the transfer is empty, so only the correctness step remains. The other deviations are those of the module documentation: uniform environments that choose the inputs, a setup law, and the garbling scheme as a parameter, correct from n = 1 on.