Inferensys

Glossary

Garbled Circuits

A cryptographic protocol, introduced by Andrew Yao, that enables two parties to jointly evaluate a boolean circuit over their private inputs without revealing those inputs to each other.
Stylish WeWork-like workspace with hot desks and document wall, professional searching through enterprise knowledge base on a mounted ultrawide display, warm industrial pendants overhead.
CRYPTOGRAPHIC PROTOCOL

What is Garbled Circuits?

A foundational secure two-party computation protocol that enables the joint evaluation of a function while keeping each party's input private.

A garbled circuit is a cryptographic protocol, introduced by Andrew Yao, that enables two mutually distrusting parties to jointly evaluate a boolean circuit over their private inputs without revealing those inputs to each other. One party, the garbler, encrypts the circuit by assigning two random cryptographic labels to each wire, representing the possible binary values 0 and 1.

The second party, the evaluator, uses oblivious transfer to privately retrieve the labels corresponding to its own input from the garbler. The evaluator then processes the encrypted gates sequentially, decrypting only the single output label for each gate, which serves as the input key for the next gate, ultimately revealing only the final output of the computation.

CRYPTOGRAPHIC PRIMITIVES

Key Features of Garbled Circuits

The foundational building blocks and optimizations that make Yao's Garbled Circuits a practical protocol for secure two-party computation.

01

Boolean Circuit Representation

The function to be computed jointly must first be represented as a Boolean circuit—a directed acyclic graph of logic gates (AND, XOR, NOT). This is the fundamental abstraction that distinguishes garbled circuits from arithmetic-based MPC protocols. The circuit is agreed upon by both parties before the protocol begins and is public knowledge. The size of the circuit directly impacts performance: each AND gate requires cryptographic operations, making circuit optimization a critical engineering concern.

02

Garbling: The Encryption Phase

The garbler constructs the encrypted circuit by assigning two random cryptographic labels (representing 0 and 1) to every wire in the circuit. For each gate, the garbler encrypts the output label using the two input labels as keys, creating a garbled truth table. The resulting encrypted gate entries are randomly permuted so the evaluator cannot determine which row corresponds to which input combination. This process ensures the evaluator can compute the gate's output only if they possess exactly one label per input wire.

03

Oblivious Transfer for Input Delivery

The evaluator must obtain the wire labels corresponding to their private input bits without revealing those bits to the garbler. This is achieved through Oblivious Transfer (OT). For each input bit, the garbler offers two labels; the evaluator selects one via OT. The garbler remains oblivious to the choice. This primitive is the only step requiring public-key cryptography in the online phase, and its efficiency is dramatically improved by OT extension protocols that amplify a few base OTs into many using only symmetric-key operations.

04

Free-XOR Optimization

Introduced by Kolesnikov and Schneider, the Free-XOR technique eliminates all cryptographic operations and ciphertext transmission for XOR gates. The garbler chooses a global random offset R and generates wire labels such that the label for 0 and the label for 1 on any wire differ by exactly R. An XOR gate's output label is simply the XOR of its two input labels, requiring no encryption or decryption. Since XOR gates often constitute the majority of a circuit, this optimization yields a substantial reduction in computation and bandwidth.

05

Half-Gates Optimization

The Half-Gates technique, introduced by Zahur, Rosulek, and Evans, reduces the cost of each AND gate to just two ciphertexts (down from four in classical Yao). It decomposes an AND gate into two 'half-gates' where one party knows one input. This is the current state-of-the-art for garbled circuit AND gates and, when combined with Free-XOR, makes the protocol remarkably efficient. The construction is proven secure in the random oracle model and is the standard in modern implementations.

06

Point-and-Permute

To enable the evaluator to correctly decrypt the garbled truth table without knowing the semantic values of the labels, the point-and-permute technique appends a single random select bit to each wire label. The garbled table is sorted by these select bits, allowing the evaluator to identify the correct row to decrypt using only the select bits of their input labels. This eliminates the need to trial-decrypt all entries, reducing evaluation cost to a single decryption per gate.

PROTOCOL COMPARISON

Garbled Circuits vs. Other Secure Computation Techniques

A comparative analysis of garbled circuits against other prominent secure multi-party computation paradigms for privacy-preserving machine learning tasks.

FeatureGarbled CircuitsSecret Sharing (SS)Homomorphic Encryption (HE)

Primary Computation Model

Boolean circuits

Arithmetic circuits

Arithmetic circuits

Round Complexity

Constant (2 rounds)

Linear in circuit depth

Non-interactive (1 round)

Communication Overhead

High (per-gate ciphertexts)

Moderate (per-multiplication)

Very High (ciphertext expansion)

Best for Deep Neural Networks

Best for Comparison-Rich Logic

Security Against Malicious Adversaries

Achievable (cut-and-choose)

Achievable (MACs, e.g., SPDZ)

Achievable (verifiable HE)

Computation Cost (Party)

Symmetric-key ops (low)

Moderate

Public-key ops (very high)

Preprocessing Dependency

High (OT extension)

High (Beaver triples)

None

GARBLED CIRCUITS EXPLAINED

Frequently Asked Questions

Clear, technically precise answers to the most common questions about Yao's Garbled Circuits protocol, its security model, and its role in modern secure multi-party computation.

A garbled circuit is a cryptographic protocol, introduced by Andrew Yao in 1986, that enables two mutually distrusting parties to jointly evaluate a boolean circuit over their private inputs without revealing those inputs to each other. The protocol works by having one party, the garbler, construct an encrypted version of the circuit. For each wire in the boolean circuit, the garbler assigns two random cryptographic labels: one representing a logical 0 and one representing a logical 1. For each logic gate, the garbler encrypts the output wire labels using the corresponding input wire labels as keys, creating a garbled truth table. The second party, the evaluator, receives the garbled circuit and the labels corresponding to their own input bits via Oblivious Transfer (OT). The evaluator then evaluates the circuit gate-by-gate, decrypting exactly one output label per gate, and ultimately learns only the final output labels, which map to the computation result. The evaluator learns nothing about the garbler's input, and the garbler learns nothing about the evaluator's input or the final output unless the protocol explicitly includes output revelation.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.