Inferensys

Glossary

Garbled Circuit

A cryptographic protocol that allows two parties to jointly evaluate a Boolean circuit over their private inputs without revealing those inputs to each other, forming a basis for general secure two-party computation.
Operations room with a large monitor wall for system visibility and control.
FOUNDATIONAL SECURE COMPUTATION

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.

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.

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.

CRYPTOGRAPHIC FOUNDATIONS

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.

01

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.

02

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.

03

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.

04

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.
05

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.

06

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.

GARBLED CIRCUIT PROTOCOL

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.

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.