A garbled circuit is a cryptographic protocol that allows two parties, an evaluator and a garbler, to compute a function over their private inputs without revealing them. The garbler encrypts a Boolean circuit by assigning two random cryptographic labels to each wire, representing 0 and 1, and encrypting the truth table of each gate so that only one valid output label can be decrypted.
Glossary
Garbled Circuit

What is a Garbled Circuit?
A garbled circuit is a cryptographic protocol enabling two parties to jointly evaluate a Boolean function over their private inputs without revealing those inputs to each other, forming the theoretical bedrock of general secure two-party computation.
The evaluator receives the garbled circuit and uses oblivious transfer (OT) to obtain the labels corresponding to their private input bits without the garbler learning which labels were selected. The evaluator then processes the circuit gate-by-gate, decrypting exactly one output label per gate, which serves as the input key for the next gate, ultimately revealing only the final output.
Key Properties of Garbled Circuits
Garbled circuits are the foundational building block for general secure two-party computation, enabling two parties to jointly evaluate any Boolean function over their private inputs without revealing those inputs to each other. The following properties define their security, performance, and practical deployment characteristics.
Constant-Round Interaction
Garbled circuit protocols require only a constant number of communication rounds regardless of circuit depth. The garbler sends the garbled circuit and its input labels in a single message, while the evaluator responds with its output. This makes garbled circuits ideal for high-latency networks where round-trip time dominates performance. Unlike secret-sharing-based protocols that require rounds proportional to circuit depth, garbled circuits collapse all interaction into a fixed, small number of back-and-forth exchanges.
Free-XOR Optimization
The Free-XOR technique allows XOR gates to be evaluated without any cryptographic operations or ciphertexts. By setting the wire label relationship such that the two labels on a wire differ by a global offset Δ, XOR gates become a simple XOR of the input labels. This eliminates the need to garble XOR gates entirely, making circuits dominated by XOR operations—such as AES evaluation or matrix multiplication—dramatically more efficient. Modern garbling schemes achieve zero communication and zero computation cost for XOR gates.
Half-Gate Construction
The half-gate technique reduces the cost of garbling an AND gate to just two ciphertexts, down from four in classical Yao's construction. It decomposes each AND gate into two half-gates: one generated by the garbler and one by the evaluator. This optimization, introduced by Zahur, Rosulek, and Evans, achieves the theoretical lower bound for garbled AND gates under the random oracle model. Combined with Free-XOR, it makes garbled circuits the most communication-efficient approach for many secure computation tasks.
Authenticated Garbling
Authenticated garbling extends the standard semi-honest protocol to achieve malicious security by embedding cryptographic checks that prevent the garbler from constructing a circuit that deviates from the agreed function. Techniques include:
- Cut-and-choose: The evaluator requests opening of a random subset of garbled circuits to verify correctness
- Batched cut-and-choose: Amortizes verification across multiple executions
- Authenticated shares: Uses information-theoretic MACs on wire labels to detect cheating These methods ensure that even an actively malicious garbler cannot influence the output beyond choosing its own input.
Point-and-Permute Technique
The point-and-permute optimization prevents the evaluator from learning both labels on a wire, which would break privacy. Each wire's two labels are assigned a random select bit (0 or 1), and the garbled truth table is permuted according to these bits. The evaluator uses the select bit of its input label to locate the correct ciphertext without learning the semantic value. This eliminates the need for trial decryption and reduces evaluation to exactly one decryption per gate, making garbled circuit evaluation deterministic and fast.
Oblivious Transfer Integration
Garbled circuits rely on Oblivious Transfer (OT) to deliver the evaluator's input wire labels without revealing the evaluator's input to the garbler. For each input bit, the evaluator retrieves exactly one of two labels via OT—learning the label corresponding to its input while the garbler remains oblivious to which label was selected. Modern protocols use OT extension to efficiently generate millions of OTs from a small number of base OTs using only symmetric-key operations, making the input phase negligible compared to circuit garbling and evaluation.
Frequently Asked Questions
Clear answers to common questions about garbled circuits, the foundational cryptographic protocol enabling general secure two-party computation over private inputs.
A garbled circuit is a cryptographic protocol that allows two mutually distrusting parties to jointly evaluate any Boolean function 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 Boolean circuit representing the function. For each wire in the circuit, the garbler generates two random labels—one representing logical 0 and one representing logical 1. Each logic gate is then encrypted as a garbled table of ciphertexts, where each row encrypts the appropriate output label under the two input labels. The garbler sends this garbled circuit to the other party, the evaluator, along with the labels corresponding to the garbler's own input. The evaluator then obliviously obtains the labels for its own input using oblivious transfer (OT). The evaluator proceeds gate-by-gate, decrypting exactly one row per gate to obtain the output label, which is finally decoded to reveal the computation result. The evaluator learns nothing beyond the output, and the garbler learns nothing at all.
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 are a core building block for general secure two-party computation. The following concepts form the cryptographic ecosystem that enables, optimizes, and complements garbled circuit evaluation.
Point-and-Permute
A standard optimization technique that prevents the evaluator from needing to decrypt all four rows of a garbled truth table to find the correct one. A select bit (or pointer bit) is appended to each wire label, and the garbled table rows are permuted based on these bits. The evaluator uses the select bits of their input keys to directly index the correct row, reducing evaluation cost from 4 decryptions per gate to 1 decryption per gate. This eliminates the trial-and-error decryption process while maintaining security.
Free-XOR
A pivotal optimization that makes evaluation of XOR gates computationally free—requiring no garbled table entries and no cryptographic operations. It works by setting a global offset R such that the two wire labels on any wire differ by R. For an XOR gate, the output label is simply the XOR of the input labels, eliminating the need for any encrypted table. Since XOR gates are ubiquitous in Boolean circuits, this dramatically reduces both communication and computation costs in practical garbled circuit protocols.
Half-Gates
A state-of-the-art optimization that reduces garbled AND gates to just two ciphertexts per gate (down from four in classical Yao). It decomposes each AND gate into two "half-gates"—one where the garbler knows one input and one where the evaluator knows one input—using the Free-XOR technique. Combined with Free-XOR, this yields the most efficient known garbling scheme, requiring only 2κ bits of communication per AND gate, where κ is the computational security parameter.
Cut-and-Choose
A technique for upgrading garbled circuit protocols from semi-honest security to malicious security. The garbler constructs multiple independent copies of the circuit, and the evaluator randomly selects a fraction to be "opened" and verified for correctness. If the opened circuits are correctly constructed, the remaining unopened circuits are evaluated with majority voting on the output. This statistical enforcement ensures a cheating garbler is caught with high probability, at the cost of increased computation and communication proportional to the replication factor.
Authenticated Garbling
A modern approach to achieving malicious security without the high replication overhead of cut-and-choose. The garbler commits to the entire garbled circuit, and during evaluation, the evaluator can verify correctness using Message Authentication Codes (MACs) embedded in the wire labels. Any deviation from the protocol specification causes a MAC verification failure, allowing immediate abort. This approach achieves malicious security with only a small constant factor overhead over semi-honest protocols, making it the preferred method in modern implementations.

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