Documentation

CslibFrontier.Crypto.Primitives.Garbling.HalfGates.Simulator

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 #

Main results #

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 simulator S(1^k, y, f) of half-gates garbling with the side information Φ_circ: sample the coins and write the simulated view.

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.

theorem Cslib.Crypto.Garbling.HalfGates.decodeWord_evalWord_simViewWord (hash : List Bool → List Bool → List Bool) (k : ℕ) (f : XorAndCircuit) {y : List Bool} (hy : y.length = f.circuit.m) (coins : List Bool) :
PointPermute.decodeWord (simViewWord hash k y f.circuit coins).decInfo (evalWord hash (simViewWord hash k y f.circuit coins).fn (simViewWord hash k y f.circuit coins).input) = some y

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.