Half-gates garbling #
The half-gates garbling scheme of Zahur, Rosulek and Evans [ZRE15] for Boolean
circuits over the basis of binary XOR and AND gates. Labels live in K × Bool for a finite
additive group K in which every element is its own negative; the Bool component is the
label's colour (the least significant bit in [ZRE15]). A global offset
Δ = (R, true) has colour true, and every wire w has the labels W w (bit 0) and
W w + Δ (bit 1).
- XOR gates are free [KS08]: the zero label of the output is the sum of the zero labels of the arguments, and no ciphertext is sent.
- An AND gate with argument zero labels
a,band tweakst,t'sends two ciphertexts, the generator halfH(a, t) + H(a + Δ, t) + p_b Δand the evaluator halfH(b, t') + H(b + Δ, t') + a, wherep_bis the colour ofbandHis a tweakable hash. Its zero label is what the evaluator computes from the zero labels (andEval).
The garbled table therefore has exactly two entries per AND gate and none per XOR gate: it is
indexed by Slot C (card_slot). The zero labels and the evaluator's labels are computed by
one evaluation round iterated n + size times; on the ordered topology of a circuit the result
is the unique labelling fixed by one round, since the round is local
(Cslib.Circuits.IsLocal.iterate_eq_of_isFixed, Cslib.Circuits.IsLocal.isFixed_iterate).
Correctness (Garbled.run_garbleWith) holds for every hash and tweak assignment, every offset
key and every choice of input zero labels, provided x + x = 0 in K: the evaluator holding
the labels of an input holds, on every wire, the label of the bit that wire carries
(evalStep_activeLabel).
Main definitions #
Cslib.Crypto.Garbling.HalfGates.signature,Cslib.Crypto.Garbling.HalfGates.interpretation: the XOR–AND basis.Cslib.Crypto.Garbling.HalfGates.Slot: the two ciphertext slots of each AND gate, withSlot.gateits gate.Cslib.Crypto.Garbling.HalfGates.garbleWith,Cslib.Crypto.Garbling.HalfGates.garble: half-gates garbling with given and with uniform randomness.Cslib.Crypto.Garbling.HalfGates.evaluate,Cslib.Crypto.Garbling.HalfGates.Garbled.run: the evaluator.
Main results #
Cslib.Crypto.Garbling.HalfGates.card_slot: two ciphertexts per AND gate.Cslib.Crypto.Garbling.HalfGates.andEval_active: the half-gates identity for one AND gate.Cslib.Crypto.Garbling.HalfGates.Garbled.run_garbleWith,Cslib.Crypto.Garbling.HalfGates.Garbled.run_of_mem_support: correctness.
References #
The XOR–AND basis #
The operations of the half-gates basis.
The XOR–AND signature: both operations are binary.
XOR is addition and AND is multiplication in the Boolean ring Bool.
Instances For
The operation of a gate.
The first argument wire of a gate.
The second argument wire of a gate.
The value of a gate on an input, from the values of its arguments.
A ciphertext slot: an AND gate and one of its halves, false for the generator half and
true for the evaluator half. XOR gates have no slots.
The AND gate of a slot.
Two ciphertexts per AND gate: the garbled table has 2 * #AND entries.
Garbling and evaluation #
The evaluator's AND gate: from argument labels a, b and ciphertexts TG, TE, the label
(H(a, t) + s_a TG) + (H(b, t') + s_b (TE + a)), where s_a, s_b are the colours of a, b.
One evaluation round with table ct and input labels X: an input reads its label, an XOR
gate adds its argument labels, and an AND gate applies andEval to its argument labels and its
two ciphertexts.
A gate's round reads only its ciphertexts and its argument labels.
A round whose table is computed from the labelling by a rule that reads, for each slot, only the labels of its gate's arguments, is local.
The garbled table for zero labels W: the generator and evaluator halves of each AND gate.
The zero labels: input zero labels Z, free XOR, and at each AND gate the evaluator's label on
the zero labels of its arguments.
The zero labels are fixed by one garbling round.
A half-gates garbled circuit: the ciphertexts, the input encoding and the output decoding.
The two ciphertexts of each AND gate.
The label of each bit of each input.
The colour of the zero label of each output wire.
Evaluate a garbled circuit on an input and decode: colour plus decoding bit.
Correctness #
The half-gates identity. With the two ciphertexts of an AND gate built from zero labels
a, b, the evaluator holding the labels a + v_a Δ and b + v_b Δ obtains
andEval … a b + (v_a v_b) Δ: the generator half contributes v_a p_b Δ, the evaluator half
v_a (v_b + p_b) Δ.
The label of the bit that wire w carries on input x.
One round of evaluation on the garbled table, from the labels of the bits every wire
carries, gives them back, for zero labels W fixed by one garbling round.
Correctness: evaluating a garbled circuit on an encoded input and decoding gives the circuit's output, for every hash, tweak assignment, offset key and input zero labels.
Correctness of the randomized garbling.