Point-and-permute garbling as a garbling scheme #
The point-and-permute garbling of CslibFrontier.Crypto.Primitives.Garbling.Basic as a garbling
scheme in the sense of Bellare, Hoang and Rogaway [BHR12b] (Garbling.Scheme),
over valid conventional circuits (ValidCircuit): PointPermute.scheme family, whose masks are
keyed by a word family family. This module gives the definitions and their correctness only.
Polynomial running times are proved in
CslibFrontier.Crypto.Primitives.Garbling.PointPermute.Efficient. Privacy (prv.sim with the
topology as side information) for every pseudorandom family is
PseudorandomFunction.prvSim_pointPermute in
CslibFrontier.Crypto.Primitives.Garbling.PointPermute.Privacy.
The scheme is a variant of Garble1 of [BHR12b] (§5.1, Fig. 7) with the
PRF-based dual-key cipher of §5.5, not Garble1 itself. In Garble1 the type of an output wire's
token is its semantics and d is empty, and both keys of a row are used at the one tweak
g ‖ a ‖ b. Here output wires are permuted too, d holds their permutation bits, and each
argument slot of a row has its own tweak.
At security parameter k, a wire key has k + 1 bits and a label is the (k + 2)-bit word of a
key followed by its colour bit. The masks come from the keyed function
PRF.label (PRF.atLevel family (k + 1)), which sends a key and a k-bit tweak to a label
(PointPermute.labelWord on words). Argument slot a of row i of gate g has the tweak
8 g + 2 i + a, reduced modulo 2 ^ k (PointPermute.tweak); rows are numbered by the colours of
the two arguments, the first argument most significant. Correctness holds for every family and
every tweak.
The coins are the n + q permutation bits followed by two keys for each wire, colour 0 first.
Gb writes the garbled function F as the header (k, n, m, q), in unary, followed for each gate
by its two argument wires A g and B g as w-bit numbers, w the bit length of n + q, and
its four rows. So F carries the topology, which the evaluator Ev(F, X) reads, and its length
depends only on k and (n, m, q), as the length condition requires. The encoding information
e lists the two labels of each input wire, for bit 0 and bit 1; the decoding information d
lists the permutation bits of the m output wires. De(d, Y) reads the colour bit of each of the
m labels of Y and adds the decoding bit; it fails only when |Y| is not a multiple of m.
The garbler and the evaluator are list programs. The garbler writes the typed garbling garbleWith
of ConventionalCircuit.toCircuit f (PointPermute.gb_eq_encodeGarbled), and the evaluator
follows every fixed point of the typed evaluation round (PointPermute.evalWord_encodeFn), so
correctness follows from Garbled.run_garbleWith and ConventionalCircuit.eval_toCircuit.
Main definitions #
Cslib.Crypto.Garbling.PointPermute.scheme: point-and-permute garbling as a garbling scheme.Cslib.Crypto.Garbling.PointPermute.encodeFn,Cslib.Crypto.Garbling.PointPermute.encodeGarbled: the words of a typed garbled table and of a typed garbled circuit.
Main results #
Cslib.Crypto.Garbling.PointPermute.gb_eq_encodeGarbled: the garbler computesgarbleWith.Cslib.Crypto.Garbling.PointPermute.evalWord_encodeFn: the evaluator computes the typed evaluation.Cslib.Crypto.Garbling.PointPermute.scheme_isValid: it is a valid garbling scheme.
References #
Words #
The tweak of argument slot a of row i of gate g at parameter k: the k low bits of
8 g + 2 i + a, least significant first.
The keyed function on words at parameter k: the label of the key word key at the tweak
word t is the first k + 1 bits of family key (0 ‖ t), padded with false, followed by the
first bit of family key (1 ‖ t). On a (k + 1)-bit key and a k-bit tweak it is the label of
PRF.label (PRF.atLevel family (k + 1)) (labelWord_ofFn).
The bit length of the wire numbers of a circuit with n inputs and q gates.
Row i of gate g of the garbling of f at parameter k with coins coins: the label of
the gate's output for the bits that the row's colours encode, masked by the keyed function at the
two argument keys of those colours.
The decoder of garbled functions.
The encoding information of f: for each input wire, the labels encoding 0 and 1; label
j encodes bit j mod 2 of input j / 2.
The decoding information of f: the permutation bits of its last m wires.
One gate of Ev: read the gate's argument wires and their labels, select the row named by
their colours, and remove the masks with their keys.
Its length readers are (n, m, q) and its semantics is ConventionalCircuit.evalCirc.
The typed garbling #
The row of gate g whose colours are the binary digits of i, the first argument most
significant.
The tweak of an argument slot at parameter k: slot a of row ρ of gate g gets
tweak k g (rowIndex ρ) a.
The permutation bits read from the coins.
The body of a garbled function over the topology τ: for each gate the numbers of its
argument wires, from 1, as w-bit numbers, and its rows in the order of rowOf.
The garbled function of a table over the topology τ at parameter k: the header
(k, n, m, s), then for each gate the numbers of its argument wires, from 1, as w-bit numbers,
and its rows in the order of rowOf.
The words (F, e, d) of a typed garbling of toCircuit f at parameter k.
The garbler computes the typed garbling #
A tweak word has k bits.
Gate g of the garbled function of a table T over toCircuit f, as a word: the numbers of
its argument wires A g and B g and its four rows.
The garbler computes the typed garbling. At parameter k, Gb on any coins writes the
words of the typed point-and-permute garbling garbleWith of toCircuit f, with the keyed
function PRF.label (PRF.atLevel family (k + 1)), the tweaks slotTweak and the keys and
permutation bits read from the coins.
Encoding, evaluation and decoding on words #
Evaluation #
The argument wires of gate g of toCircuit f, one at a time: A g - 1, then B g - 1.
Ev follows a fixed point of an evaluation round. If the labelling A of the wires of
toCircuit f is left unchanged by one round of the typed evaluation of table on the input
labels X, then Ev on the garbled function of table and the words of X returns the labels
A of the output wires.
Validity #
The encoding information has 2 n labels.