The simulator of half-gates garbling #
The privacy simulator HalfGates.simulate of
CslibFrontier.Crypto.Primitives.Garbling.HalfGates.Privacy, written on words, for the scheme
HalfGates.scheme hash with the side information Φ_circ, which reveals the circuit itself
(SideInfo.circ). The simulator simWord hash k y f sees the parameter k, the output y and
the XOR–AND circuit f. It samples a uniform (k + 2)-bit label for each of the n input wires
and two for each AND gate, and writes the view (F, X, d) (simViewWord): F has the layout of
the real garbled function, with the two labels of each AND gate as its ciphertexts; X lists the
input labels; and d makes the evaluated output labels decode to y, by running Ev on (F, X).
The labels of AND gate g are those numbered n + 2 a and n + 2 a + 1, where a is the number
of AND gates before g (andRank), so the coins are used without gaps.
The words written are those of the typed simulated view simulateWith of toCircuit f, with the
input labels and the table read from the coins, and the coins give uniform input labels and a
uniform table. So the simulator's output law is the typed simulator's (eval_simWord). Every view
it writes for an output of m bits decodes to that output
(decodeWord_evalWord_simViewWord), and the simulator is PPT whenever the hash is computed in
polynomial time (isPPTOn_simWord).
Main definitions #
Cslib.Crypto.Garbling.HalfGates.viewWord: the words(F, X, d)of a typed view.Cslib.Crypto.Garbling.HalfGates.simViewWord,Cslib.Crypto.Garbling.HalfGates.simWord: the simulated view on given coins, and the simulator.
Main results #
Cslib.Crypto.Garbling.HalfGates.eval_simWord: the simulator samples the words of the typed simulator's view.Cslib.Crypto.Garbling.HalfGates.decodeWord_evalWord_simViewWord: simulated views decode to the output.Cslib.Crypto.Garbling.HalfGates.isPPTOn_simWord: the simulator is PPT.
References #
The simulated view #
The number of AND gates among the first g gates of f.
The number of coins of the simulator at parameter k for f: one label for each input, then
two for each AND gate.
The block of gate g of the simulated garbled function: the numbers of its argument wires as
w-bit numbers, its AND bit, and for an AND gate the labels n + 2 a and n + 2 a + 1 of the
coins, a the number of AND gates before it.
The simulated view (F, X, d) at parameter k for the output y and the circuit f, on the
simulator's coins: the garbled function with the header and gates of f and the ciphertexts read
from the coins, the input labels read from the coins, and the decoding bits that make the colours
of the output labels that Ev computes from F and X decode to y when y has m bits.
The words (F, X, d) of a typed view at parameter k: the garbled function of its table, the
words of its input labels in order, and its decoding bits.
The simulator's coins #
The simulated view is the typed simulator's #
The simulator samples the typed simulator's view. For every XOR–AND circuit f and output
y, the simulator on f samples the words of the typed simulator's view of toCircuit f.
Simulated views decode to the output. For every XOR–AND circuit f, every output y of
m bits and all coins, decoding the evaluation of the simulated garbled input gives y.
Efficiency #
The simulator is PPT. For every hash family computed in polynomial time
(CircularCorrelationRobust.polyTime supplies hf), the simulator runs in uniform strict
probabilistic polynomial time on the parameter in unary, the output and the encoded circuit.