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):
Yao.oneSidedFamily G(Yao.oneSidedProtocol,Yao.oneSidedFunctionality): the two-round one-sided output protocol of [BHR12b], §7.1 (Fig. 16, p. 34), where party0(the garbler) outputs[]and party1(the evaluator) outputsG.ev fn x;Yao.family G(Yao.protocol,Yao.functionality): the three-round symmetric two-output protocol of [LP09], Protocol 2 (§4.2, p. 15), where the evaluator sends the decoded result back in a final message round so that both parties outputG.ev fn x.
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:
- the garbler draws
G.coins n fnfair coins, garblesfnto(F, e, d)withG.gb, and sendsF, the tokens of its own input bits (projectiveToken) andd(Yao.garblerMessage); - one batched oblivious transfer gives the evaluator the tokens of its own input bits, from the
pairs that the garbler offers (
Yao.garblerOffer); - the evaluator evaluates
Fon all the tokens and decodes withd(Yao.evaluatorOutput): inYao.oneSidedProtocolthe garbler outputs[]and the evaluator outputs this decoding; inYao.protocolthe 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] #
- Oblivious transfer. The transfers are the ideal
batchOTSpec, one call for all of the evaluator's bits; Theorem 7 of [LP09] (p. 15) and Theorem 14 of [BHR12b] (§7.1, p. 35) assume an oblivious transfer protocol, run for each bit. Composition with a protocol is not formalized here (#6045). - Notion.
ProtocolFamily.SemiHonestSecurehas uniform PPT environments that choose the inputs after seeing the public parameters, drawn from a setup law; Definition 1 (§2.1, p. 5) of [LP09] quantifies over all inputs against non-uniform distinguishers, with no setup. - Garbling scheme. Lindell and Pinkas garble with a specific double-encryption construction
(§4.1, p. 12). Here the garbling scheme is a parameter, and the protocol uses only its
algorithms and its encoding
projectiveEncode, as in the modular construction of [BHR12b], §7.1 (p. 34). Its correctness is that ofGarbling.Scheme.Correct, from the security parameter1on. - Inputs and outputs. The garbler holds the first
garblerLeninput bits and the evaluator the rest, where Lindell and Pinkas havenbits each. Outputs are words of any length; inYao.oneSidedFamilyparty0outputs[](as in [BHR12b], §7.1, Fig. 16) and inYao.familyboth parties outputG.ev fn x(as in [LP09], Protocol 2). - Security parameter. The function description is a public parameter drawn from a setup law,
not the auxiliary input of a circuit for inputs of length
n, and the garbling scheme runs at the security parametern.
Main definitions #
Cslib.Crypto.Protocols.MPC.Yao.Params: the public parameters.Cslib.Crypto.Protocols.MPC.Yao.oneSidedProtocol,Cslib.Crypto.Protocols.MPC.Yao.oneSidedFamily: the one-sided protocol and protocol family, with scheduleYao.oneSidedScheduleand functionalityYao.oneSidedFunctionality.Cslib.Crypto.Protocols.MPC.Yao.protocol,Cslib.Crypto.Protocols.MPC.Yao.family: the two-output protocol and protocol family, with scheduleYao.scheduleand functionalityYao.functionality.Cslib.Crypto.Protocols.MPC.Yao.oneSidedGarblerView,Cslib.Crypto.Protocols.MPC.Yao.oneSidedEvaluatorView,Cslib.Crypto.Protocols.MPC.Yao.garblerView,Cslib.Crypto.Protocols.MPC.Yao.evaluatorView: the parties' views.Cslib.Crypto.Protocols.MPC.Yao.oneSidedEncoding,Cslib.Crypto.Protocols.MPC.Yao.encoding: the machine encodings of the two families.Cslib.Crypto.Protocols.MPC.Yao.oneSidedGarblerSim,Cslib.Crypto.Protocols.MPC.Yao.garblerSim: the simulators for a corrupted garbler.
Main results #
Cslib.Crypto.Protocols.MPC.Yao.oneSided_output_of_mem_support,Cslib.Crypto.Protocols.MPC.Yao.output_of_mem_support: correctness.Cslib.Crypto.Protocols.MPC.Yao.idealJoint_oneSidedGarblerSim,Cslib.Crypto.Protocols.MPC.Yao.isPPT_oneSidedGarblerSim,Cslib.Crypto.Protocols.MPC.Yao.idealJoint_garblerSim,Cslib.Crypto.Protocols.MPC.Yao.isPPT_garblerSim: the garbler simulators are exact fromn = 1on and PPT.Cslib.Crypto.Protocols.MPC.Yao.hybridSemiHonestSecure_oneSided_garbler,Cslib.Crypto.Protocols.MPC.Yao.hybridSemiHonestSecure_garbler: corrupted-garbler steps in the idealbatchOTWorldhybrid (#6045) towards Theorem 7 of [LP09].
References #
- A. C. Yao, How to Generate and Exchange Secrets
- Y. Lindell, B. Pinkas, A Proof of Security of Yao's Protocol for Two-Party Computation, cited in the ePrint version 2004/175 of June 26, 2006: Definition 1 (§2.1, p. 5), §4.1 (p. 12), Protocol 2 and Theorem 7 (§4.2, p. 15), Case 1 (p. 16).
- M. Bellare, V. T. Hoang, P. Rogaway, Foundations of Garbled Circuits, §3.2 (p. 8) and §7.1 (Fig. 16, p. 34; Theorem 14, p. 35).
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.
The garbler holds at most all the input bits.
The number of input bits that the evaluator holds.
The parties' inputs: c.garblerLen bits for the garbler (party 0) and c.evaluatorLen bits
for the evaluator (party 1).
The parties' coins: the garbler's coin string for Gb; the evaluator uses none.
The input of the function: the garbler's bits followed by the evaluator's.
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.
The garbled function
F.The tokens of the garbler's input bits.
The decoding information
d.
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.
The schedule of the two-output protocol: oneSidedSchedule c followed by the evaluator sending
the decoded output to the garbler.
A party's local state after the oblivious transfer.
A party's final local state in protocol.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 #
The garbler's tokens followed by the evaluator's are the tokens of the bits of the function's input.
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.
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.
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 garbler's input bits.
The garbler's coins.
The encoding of a one-sided garbler's view words: input framed, then coins.
The words of a corrupted garbler's view in protocol: its input bits, its coins and the output
that the evaluator sends it.
The garbler's input bits.
The garbler's coins.
The output received in the last round.
The encoding of a garbler's view words: each field in turn, all but the last framed.
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.
The evaluator's input bits.
The garbled function
F.The tokens of the garbler's input bits.
The decoding information
d.The tokens of the evaluator's input bits, from the oblivious transfer.
The encoding of an evaluator's view words: each field in turn, all but the last framed.
The view words of the two parties in oneSidedProtocol: OneSidedGarblerViewWords for the
garbler (party 0) and EvaluatorViewWords for the evaluator (party 1).
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 oneSidedProtocol.
The words of an evaluator's view in oneSidedProtocol.
The words of a garbler's view in protocol.
The words of an evaluator's view in protocol.
The words determine a garbler's view in oneSidedProtocol.
The words determine an evaluator's view in oneSidedProtocol.
The words determine a garbler's view in protocol.
The words determine an evaluator's view in protocol.
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).
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.
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.
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.