| title | Garbled Circuit |
|---|---|
| parent | Protocols |
| has_children | true |
| nav_order | 1 |
Before technique details, one should define the security goal, which is called the security model in cryptography. The semi-honest model and malicious model are widely considered to capture the capabilities of adversaries.
In this article, we introduce the classic Yao's garbled circuit in the two-party setting, it is also one of the most efficient constructions by now.
Alice and Bob who have private input
For the easy understanding of the description, we assume that
Alice takes as input the circuit, and writes down all the truth table of each gate. Then it chooses two uniformly random string, which is called labels, for each gate to represent 0 or 1 as in Figure 2. Note that, although Alice does not know the input of
After choosing the labels, Alice replaces the truth table with labels according to the topology of the circuit. Take the left-up two gates as an example. It has
After replacing all the truth tables, Alice gets a "label table" as in Figure 4.
Figure 4For each gate Alice garbles the gates using the labels. I.e., for each row of the label table, Alice encrypts the output label with the input label as keys to a double encryption. More specifically, for the first row in the first label table, Alice uses
Suppose Alice's input
Before Bob evaluates the garbled circuit, he has to obtain the input labels according to his input information. Since the labels are sampled by Alice, he has to run a "transfer protocol" with Alice to get the labels without telling her the inputs in plain. This "transfer protocol" is called oblivious transfer in cryptography, since it is a very fundamental cryptographic primitive, we will not get into the details, but list the properties below.
-
Alice takes labels
$X_0$ ,$X_1$ as input, and Bob takes bit$b=0/1$ as input. At the end of the protocol, Bob will get$X_b$ . -
Alice does not know which label is chosen by Bob.
-
Bob does not know the other label
$X_{1-b}$ .
After running the oblivious transfer protocol with Alice, Bob gets the labels
So far, we illustrate the basic principle of Yao's garbled circuits. For almost 40 years, many optimized techniques are proposed to improve this basic protocol. Free-XOR (no encryption for XOR gate), row reduction and half gate (reduce the number of each AND gate to 2 ciphertexts) techniques and hardware acceleration (using AES-NI ) significantly improve the efficiency of garbled circuit.
Garbling is one of the most useful and practical techniques to implement MPC protocols. The computation cost of garbling is very low since using AES-NI. The round complexity of garbling-based protocol is constant, which is good in practice. However, the amount of data in communication is relatively large, and it is more suitatble for high-bandwidth network environment.
- Protocols for secure computations. Andrew C. Yao.
- How to Generate and Exchange Secrets. Andrew C. Yao.
- How to exchange secrets with oblivious transfer. Michael O. Rabin.
- Improved Garbled Circuit: Free XOR Gates and Applications. Vladimir Kolesnikov, Thomas Schneider.
- Practical Garbled Circuit Optimizations. Mike Rosulek. https://web.engr.oregonstate.edu/~rosulekm/
Author: Xiang Xie @PlatON





