GarbledCircuitGenerator

Models & Types · AiDotNet.FederatedLearning.MPC

Implements Yao’s garbled circuit generation with point-and-permute, free XOR, and half-gates optimizations.

Implements: IGarbledCircuit

For Beginners

A garbled circuit lets two parties compute any function on their combined inputs without revealing those inputs to each other. The “garbler” takes a boolean circuit (made of AND, XOR, NOT gates) and “garbles” it — replacing each wire’s 0/1 values with random cryptographic labels. The “evaluator” can then process the circuit using only the labels for its inputs (obtained via oblivious transfer) without learning anything else.

How It Works

Optimizations implemented:

Reference:

Constructors

Constructor Summary
GarbledCircuitGenerator(bool enableFreeXor, bool enableHalfGates, int labelLengthBits) Initializes a new instance of GarbledCircuitGenerator.

Methods

Method Summary
GarbledCircuitData Garble(IReadOnlyList<CircuitGate> gates, int inputWireCount, int outputWireCount)
byte[][] Evaluate(GarbledCircuitData garbledData, byte[][] inputLabels)
int[] Decode(byte[][] outputLabels, byte[][] decodingTable)