Yao's two-party protocol in the oblivious-transfer hybrid model #
Yao's protocol [Yao86] for a Boolean circuit C : Circuit σ (n₀ + n₁) m, in the form analysed by
Lindell and Pinkas [LP09], with the point-and-permute garbling of
Cslib.Crypto.Garbling. Party 0, the garbler, holds x₀ : Fin n₀ → Bool; party 1, the
evaluator, holds x₁ : Fin n₁ → Bool. The garbler samples uniform wire keys and permutation bits,
garbles C, and sends the garbled table, the labels of its own input bits and the decoding bits.
The parties then make one call to the ideal batched oblivious transfer batchOTSpec n₁ (K × Bool):
the garbler offers both labels of each of the evaluator's input wires and the evaluator chooses
with its input bits. The evaluator evaluates the table on all input labels and decodes. In the
one-sided output protocol (yaoProtocol, yaoFunctionality), only the evaluator receives the
output C.eval I (Fin.append x₀ x₁); in the two-output protocol (yaoBothProtocol,
yaoBothFunctionality), the evaluator sends the decoded output to the garbler in a final message
round so that both parties receive C.eval I (Fin.append x₀ x₁).
- Correctness (
yao_output_of_mem_support): in every run the evaluator outputsC.eval I (Fin.append x₀ x₁), exactly, for every round functionFand tweak maptw. - Privacy against the garbler (
idealJoint_yao_garbler): the garbler receives nothing but()from the oblivious transfer, so the simulatoryaoGarblerSimthat samples fresh coins makes the ideal and real joint distributions equal; every distinguisher has advantage zero. - Privacy against the evaluator (
semiHonestAdvantage_yao_evaluator_le): the simulatoryaoEvaluatorSimplaces the garbling simulator's view, computed from the topology ofCand the evaluator's output, into the evaluator's view. The advantagesemiHonestAdvantageof a distinguisherDon the evaluator's view and the outputs is at most the sum over then₀ + n₁ + C.sizewires of the PRF advantage of the reductions ofCslib.Crypto.Garbling.advantage_realGame_simGame_le, run against the distinguisher on garbled views thatDinduces (yaoEvaluatorDistinguisher). The tweak map must be injective; the identity is.
These are the two cases of Goldreich's two-party semi-honest definition (Definition 7.2.1), one simulator per corrupted party, stated on the joint distribution of the corrupted party's view and both outputs, with a concrete distinguishing advantage in place of computational indistinguishability.
Scope: the oblivious transfer is the ideal oracle, and no composition theorem replaces it by a
protocol. The bounds are for a single instance (circuit, inputs and distinguisher fixed), with no
security parameter; running time is not tracked, and neither the simulators nor the reductions are
certified efficient. Both the one-sided output protocol (yaoProtocol, where only the evaluator
receives the circuit output) and the symmetric two-output protocol (yaoBothProtocol, where the
evaluator sends the decoded output back to the garbler via Steps.append) are covered. The
asymptotic one-sided and two-output protocols over word-level garbling schemes, with PPT simulators
and certified reductions, are the protocol families Yao.oneSidedFamily and Yao.family of
CslibFrontier.Crypto.Protocols.MPC.Yao.Family and
CslibFrontier.Crypto.Protocols.MPC.Yao.Security.
Main definitions #
Cslib.Crypto.Protocols.MPC.yaoProtocol: the one-sided output protocol, with scheduleyaoScheduleand functionalityyaoFunctionality.Cslib.Crypto.Protocols.MPC.yaoGarblerSim,Cslib.Crypto.Protocols.MPC.yaoEvaluatorSim: the one-sided simulators.Cslib.Crypto.Protocols.MPC.yaoBothProtocol: the two-output protocol, with scheduleyaoBothScheduleand functionalityyaoBothFunctionality.Cslib.Crypto.Protocols.MPC.yaoBothGarblerSim,Cslib.Crypto.Protocols.MPC.yaoBothEvaluatorSim: the two-output simulators.
Main results #
Cslib.Crypto.Protocols.MPC.yao_output_of_mem_support,Cslib.Crypto.Protocols.MPC.yaoBoth_output_of_mem_support: correctness.Cslib.Crypto.Protocols.MPC.idealJoint_yao_garbler,Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_yao_garbler,Cslib.Crypto.Protocols.MPC.idealJoint_yaoBoth_garbler,Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_yaoBoth_garbler: perfect privacy against the garbler.Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_yao_evaluator_le,Cslib.Crypto.Protocols.MPC.semiHonestAdvantage_yaoBoth_evaluator_le: privacy against the evaluator, bounded by the sum of the PRF advantages of the garbling reductions.
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
- O. Goldreich, Foundations of Cryptography, Volume 2: Basic Applications, Section 7.2.2.1 (Definition 7.2.1, pp. 620–622).
- M. Bellare, V. T. Hoang, P. Rogaway, Foundations of Garbled Circuits
The inputs: n₀ bits for the garbler (party 0) and n₁ bits for the evaluator
(party 1).
The garbler's coins.
The key of each wire and colour.
The permutation bit of each wire.
The coins: the garbler's keys and permutation bits; the evaluator uses none.
The outputs: nothing for the garbler and the circuit's output for the evaluator.
The garbler's message: the garbled table, the labels of its own input bits and the decoding bits.
The garbled table.
The labels of the garbler's input bits.
The decoding bits.
The schedule: the garbler sends its message, then the parties run one batched oblivious transfer of the labels of the evaluator's input bits.
The garbler's message for a garbled circuit and the garbler's input.
The evaluator's output: evaluate the table on the garbler's labels followed by its own, then decode.
The local state of each party after the oblivious transfer.
Sample the garbler's coins uniformly.
The garbler's coins as a coin tuple.
The two-party functionality: the evaluator learns C.eval I (Fin.append x₀ x₁) and the
garbler learns nothing.
The evaluator's view when the view of the garbled circuit is V and its input is x₁:
the garbler's message carries the table, the labels of the garbler's input wires and the decoding
bits, and the oblivious transfer delivers the labels of the evaluator's input wires.
The garbler's view: its input and coins; it receives nothing.
The simulator for a corrupted garbler: fresh coins and nothing received.
The distinguisher on views of the garbled circuit that a distinguisher D on the evaluator's
joint view and outputs induces, for input tuple x and circuit output y.
The garbler's message from its input and coins.
The oblivious-transfer queries: the garbler offers both labels of each of the evaluator's input wires, and the evaluator chooses with its input bits.
The outputs: the garbler outputs nothing; the evaluator decodes with the garbler's message and the labels from the oblivious transfer.
Yao's protocol in the batched oblivious-transfer hybrid model. The garbler garbles C
with uniform keys and permutation bits and sends the garbled table, the labels of its own input
bits and the decoding bits. The evaluator obtains the labels of its input bits by one batched
oblivious transfer, evaluates the table and decodes.
Decoding the message of a garbled circuit with the labels of the evaluator's bits runs the garbled circuit on the whole input.
Correctness: in every run of Yao's protocol the evaluator outputs
C.eval I (Fin.append x₀ x₁) and the garbler outputs nothing.
The real joint distribution for a corrupted evaluator: its view is determined by the view of the garbled circuit on the whole input.
The real joint distribution for a corrupted garbler: fresh coins and nothing received.
Perfect privacy against the garbler: the ideal joint distribution with the simulator
yaoGarblerSim equals the real one.
A corrupted garbler has advantage zero against every distinguisher.
The simulator for a corrupted evaluator: the simulated view of the garbled circuit from the topology and the output, placed in the evaluator's view.
Privacy against the evaluator: every distinguisher's advantage between the ideal joint
distribution with yaoEvaluatorSim and the real one is at most the sum of the PRF advantages of
the n₀ + n₁ + C.size reductions of the garbling scheme, against the distinguisher on views of the
garbled circuit that D induces.
Two-output Yao protocol (both parties learn the output) #
The return round in which the evaluator sends the decoded output to the garbler.
The schedule of two-output Yao's protocol: yaoSchedule C K followed by the evaluator
sending the decoded output to the garbler.
The two-party functionality in which both the garbler and the evaluator learn
C.eval I (Fin.append x₀ x₁).
After yaoProtocol computes YaoOut m (() for the garbler and y : Fin m → Bool for the
evaluator), the evaluator sends y to the garbler and both parties output y.
The evaluator's view in yaoBothProtocol when the view of the garbled circuit is V and its
input is x₁: its view in yaoProtocol, followed by nothing received in the return round.
The garbler's view in yaoBothProtocol: its input, its coins, nothing received in the first
two rounds, and the output y received from the evaluator in the return round.
The simulator for a corrupted garbler in yaoBothProtocol: sample fresh coins and deliver
the garbler's output yI ⟨0, _⟩ as the evaluator's return message.
The simulator for a corrupted evaluator in yaoBothProtocol: simulate the garbled circuit
view from the topology and the evaluator's output, placed in evaluatorBothView.
The distinguisher on views of the garbled circuit that a distinguisher D on the evaluator's
joint view and outputs in yaoBothProtocol induces.
Yao's protocol with output for both parties in the batched oblivious-transfer hybrid model:
yaoProtocol followed by the evaluator sending the decoded output to the garbler.
Correctness of two-output Yao's protocol: in every run both the garbler and the evaluator
output C.eval I (Fin.append x₀ x₁).
The real joint distribution for a corrupted evaluator in yaoBothProtocol.
The real joint distribution for a corrupted garbler in yaoBothProtocol: fresh coins and the
circuit output received in the return round.
Perfect privacy against the garbler in yaoBothProtocol: the ideal joint distribution with
yaoBothGarblerSim equals the real one.
A corrupted garbler in yaoBothProtocol has advantage zero against every distinguisher.
In yaoBothProtocol, a distinguisher's advantage for a corrupted evaluator equals its
distinguishing advantage between the garbling scheme's realGame and simGame.
Privacy against the evaluator in yaoBothProtocol: every distinguisher's advantage between
the ideal joint distribution with yaoBothEvaluatorSim and the real one is at most the sum of the
PRF advantages of the n₀ + n₁ + C.size reductions of the garbling scheme.