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.
Glossary
Garbled Circuits

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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
| Feature | Garbled Circuits | Secret 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 |
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.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Garbled circuits rely on a constellation of cryptographic primitives and protocol-level optimizations. Understanding these related terms is essential for grasping how Yao's protocol achieves practical efficiency in secure two-party computation.

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us