<s>
Garbled	B-Protocol
circuit	I-Protocol
is	O
a	O
cryptographic	B-Protocol
protocol	I-Protocol
that	O
enables	O
two-party	O
secure	B-Protocol
computation	I-Protocol
in	O
which	O
two	O
mistrusting	O
parties	O
can	O
jointly	O
evaluate	O
a	O
function	O
over	O
their	O
private	O
inputs	O
without	O
the	O
presence	O
of	O
a	O
trusted	O
third	O
party	O
.	O
</s>
<s>
In	O
the	O
garbled	B-Protocol
circuit	I-Protocol
protocol	I-Protocol
,	O
the	O
function	O
has	O
to	O
be	O
described	O
as	O
a	O
Boolean	O
circuit	O
.	O
</s>
<s>
The	O
history	O
of	O
garbled	B-Protocol
circuits	I-Protocol
is	O
complicated	O
.	O
</s>
<s>
The	O
invention	O
of	O
garbled	B-Protocol
circuit	I-Protocol
was	O
credited	O
to	O
Andrew	O
Yao	O
,	O
as	O
Yao	O
introduced	O
the	O
idea	O
in	O
the	O
oral	O
presentation	O
of	O
a	O
paper	O
in	O
FOCS'86	O
.	O
</s>
<s>
The	O
term	O
"	O
garbled	B-Protocol
circuit	I-Protocol
"	O
was	O
first	O
used	O
by	O
Beaver	O
,	O
Micali	O
,	O
and	O
Rogaway	O
in	O
STOC'90	O
.	O
</s>
<s>
Yao	B-Protocol
's	I-Protocol
protocol	I-Protocol
solving	O
Yao	O
's	O
Millionaires	O
 '	O
Problem	O
was	O
the	O
beginning	O
example	O
of	O
secure	B-Protocol
computation	I-Protocol
,	O
yet	O
it	O
is	O
not	O
directly	O
related	O
to	O
garbled	B-Protocol
circuits	I-Protocol
.	O
</s>
<s>
In	O
the	O
garbled	B-Protocol
circuit	I-Protocol
protocol	I-Protocol
,	O
we	O
make	O
use	O
of	O
oblivious	O
transfer	O
.	O
</s>
<s>
The	O
oblivious	O
transfer	O
can	O
be	O
built	O
using	O
asymmetric	B-Application
cryptography	I-Application
like	O
the	O
RSA	B-Architecture
cryptosystem	I-Architecture
.	O
</s>
<s>
Operator	O
is	O
bit-wise	O
XOR	B-Application
.	O
</s>
<s>
Alice	O
sends	O
the	O
garbled	B-Protocol
circuit	I-Protocol
to	O
Bob	O
along	O
with	O
her	O
encrypted	O
input	O
.	O
</s>
<s>
It	O
is	O
conventional	O
to	O
make	O
the	O
circuit	O
out	O
of	O
2-input	O
XOR	B-Application
and	O
AND	O
gates	O
.	O
</s>
<s>
It	O
is	O
important	O
that	O
the	O
generated	O
circuit	O
has	O
the	O
minimum	O
number	O
of	O
AND	O
gates	O
(	O
see	O
Free	O
XOR	B-Application
optimization	O
)	O
.	O
</s>
<s>
The	O
circuit	O
for	O
the	O
Millionaires	O
 '	O
Problem	O
is	O
a	O
digital	O
comparator	O
circuit	O
(	O
which	O
is	O
a	O
chain	O
of	O
full	O
adders	O
working	O
as	O
a	O
subtractor	O
and	O
outputting	O
the	O
carry	B-Algorithm
flag	I-Algorithm
)	O
.	O
</s>
<s>
A	O
full	O
adder	O
circuit	O
can	O
be	O
implemented	O
using	O
only	O
one	O
AND	O
gate	O
and	O
some	O
XOR	B-Application
gates	O
.	O
</s>
<s>
Alice	O
(	O
garbler	O
)	O
encrypts	O
the	O
Boolean	O
circuit	O
in	O
this	O
step	O
to	O
obtain	O
a	O
garbled	B-Protocol
circuit	I-Protocol
.	O
</s>
<s>
In	O
the	O
table	O
below	O
,	O
is	O
a	O
double-key	O
symmetric	B-Algorithm
encryption	I-Algorithm
in	O
which	O
k	O
is	O
the	O
secret	O
key	O
and	O
X	O
is	O
the	O
value	O
to	O
be	O
encrypted	O
(	O
see	O
Fixed-Key	O
Blockcipher	O
)	O
.	O
</s>
<s>
Using	O
these	O
values	O
,	O
the	O
label	O
of	O
an	O
XOR	B-Application
gate	O
's	O
output	O
wire	O
with	O
input	O
wires	O
,	O
is	O
set	O
to	O
.	O
</s>
<s>
The	O
proof	O
of	O
security	O
in	O
the	O
Random	B-Application
Oracle	I-Application
Model	I-Application
for	O
this	O
optimization	O
is	O
given	O
in	O
the	O
Free-XOR	O
paper	O
.	O
</s>
<s>
Free	O
XOR	B-Application
optimization	O
implies	O
an	O
important	O
point	O
that	O
the	O
amount	O
of	O
data	O
transfer	O
(	O
communication	O
)	O
and	O
number	O
of	O
encryption	O
and	O
decryption	O
(	O
computation	O
)	O
of	O
the	O
garbled	B-Protocol
circuit	I-Protocol
protocol	I-Protocol
relies	O
only	O
on	O
the	O
number	O
of	O
AND	O
gates	O
in	O
the	O
Boolean	O
circuit	O
not	O
the	O
XOR	B-Application
gates	O
.	O
</s>
<s>
This	O
method	O
allows	O
to	O
efficiently	O
garble	O
and	O
evaluate	O
AND	O
gates	O
using	O
fixed-key	O
AES	B-Algorithm
,	O
instead	O
of	O
costly	O
cryptographic	B-Algorithm
hash	I-Algorithm
function	I-Algorithm
like	O
SHA-2	B-Algorithm
.	O
</s>
<s>
In	O
this	O
garbling	O
scheme	O
which	O
is	O
compatible	O
with	O
the	O
Free	O
XOR	B-Application
and	O
Row	O
Reduction	O
techniques	O
,	O
the	O
output	O
key	O
is	O
encrypted	O
with	O
the	O
input	O
token	O
and	O
using	O
the	O
encryption	O
function	O
,	O
where	O
,	O
is	O
a	O
fixed-key	O
block	O
cipher	O
(	O
e.g.	O
,	O
instantiated	O
with	O
AES	B-Algorithm
)	O
,	O
and	O
is	O
a	O
unique-per-gate	O
number	O
(	O
e.g.	O
,	O
gate	O
identifier	O
)	O
called	O
tweak	O
.	O
</s>
<s>
The	O
Yao	B-Protocol
's	I-Protocol
Garbled	I-Protocol
Circuit	I-Protocol
is	O
secure	O
against	O
a	O
semi-honest	O
adversary	O
.	O
</s>
<s>
Another	O
solution	O
is	O
to	O
make	O
the	O
garbling	O
scheme	O
authenticated	O
such	O
that	O
the	O
evaluator	O
can	O
verify	O
the	O
garbled	B-Protocol
circuit	I-Protocol
.	O
</s>
