Garbled circuits #
A point-and-permute garbling of Boolean circuits over an arbitrary signature, in the style of Yao [Yao86] with the point-and-permute technique of Beaver, Micali and Rogaway [BMR90], following the garbling-scheme syntax of Bellare, Hoang and Rogaway [BHR12b]: garble, encode, evaluate, decode.
Each wire w has two labels (key (w, c), c), one for each colour c : Bool. The colour of
the label carrying bit b is b + perm w, for a secret permutation bit perm w. Labels live in
K × Bool for a finite additive group K of keys, and a keyed function
F : K → T → K × Bool (a PRF in the security analysis) masks the table. Each gate g has one
table row for each colour vector ρ of its arguments; the row holds the label of the gate's
output for the bits those colours encode, masked by ∑ k, F (key (w_k, ρ k)) (tw (ρ, k)), where
w_k is the k-th argument wire and tw assigns a tweak to each argument slot of each row. For
binary gates this is a double encryption under the two argument keys. The evaluator holding one
label per argument wire selects the row named by their colours and removes the mask with their
keys; the decoding information is the permutation bit of each output wire.
Correctness (Garbled.run_garbleWith) holds for every keyed function F, tweak assignment tw,
choice of keys and permutation bits, and input. Evaluation follows every wire labelling that is a
fixed point of one evaluation round (evaluate_eq_of_evalStep), for every topology whose gates
read only earlier wires, since such a round is local (isLocal_evalStep); this also gives
correctness of the simulator. Garbling uses the circuit's
operations only through its truth tables; the table shape depends only on the topology.
Main definitions #
Cslib.Crypto.Garbling.Row,Cslib.Crypto.Garbling.Slot: table rows and their argument slots.Cslib.Crypto.Garbling.garbleTable: the garbled table.Cslib.Crypto.Garbling.Garbled: table, input encoding and output decoding.Cslib.Crypto.Garbling.garbleWith,Cslib.Crypto.Garbling.garble: garbling with given keys and permutation bits, and with uniform ones.Cslib.Crypto.Garbling.evaluate: the evaluator.
Main results #
Cslib.Crypto.Garbling.evaluate_eq_of_evalStep: evaluation follows any consistent labelling.Cslib.Crypto.Garbling.Garbled.run_garbleWith,Cslib.Crypto.Garbling.Garbled.run_of_mem_support: correctness.
References #
A row of a garbled table: a gate together with a colour for each of its arguments.
An argument slot of a table row; each slot has its own tweak.
The input encoding: bit b of input i is the label of colour b + perm (input i).
The output decoding information: the permutation bit of each output wire.
The plaintext of a row: the label of the gate's output for the input bits that the row's colours encode.
A garbled circuit: its table, input encoding and output decoding.
The garbled table.
The label of each bit of each input.
The permutation bit of each output wire.
The label of each wire that the evaluator holds on input x: the label of colour
trace w + perm w.
The row named by the active colours of a gate's arguments holds the gate's active label.
The mask of a row: the sum, over its arguments, of the keyed function at the argument's key of the row's colour and the slot's tweak.
The garbled table: each row's plaintext plus its mask.
Garble a circuit with the given keys and permutation bits.
Garble a circuit with uniform keys and permutation bits.
One round of evaluation: an input reads its label, and a gate reads the row named by the colours of its arguments' labels and removes the mask with their keys.
Evaluate a garbled table on input labels: n + s rounds from the zero labelling, which reach
every wire of an ordered topology, then read the output wires.
Evaluate a garbled circuit on an input and decode the result.
On an ordered topology, an evaluation round is local: a gate reads only the labels of its arguments, which have lower wire numbers.
On an ordered topology, evaluation follows every wire labelling A that one evaluation
round leaves unchanged: the evaluated output labels are those of A.
Removing the mask with the active labels of the arguments gives the gate's active label.
Correctness: evaluating a garbled circuit on an encoded input and decoding gives the circuit's output, for every keyed function, tweak assignment, keys and permutation bits.
Correctness of the randomized garbling: every garbled circuit it can output evaluates correctly on every input.