Documentation

CslibFrontier.Crypto.Primitives.Garbling.HalfGates.Efficient

Half-gates garbling is efficient #

HalfGates.scheme hash of CslibFrontier.Crypto.Primitives.Garbling.HalfGates.Scheme is an efficient garbling scheme (Scheme.IsEfficient) for XOR–AND circuits encoded by encXorAndCircuit whenever the hash family hash is computed in polynomial time, as CircularCorrelationRobust.polyTime provides: HalfGates.scheme_isEfficient.

En and De are those of point-and-permute garbling and ev is the semantics of conventional circuits, so their certificates are projectiveEncode_polyTime, PointPermute.decodeWord_polyTime and evalCirc_polyTime. The garbler computes the zero labels by a fold over the gates of the encoded circuit whose state grows by one label per gate, writes the body of the garbled function with PointPermute.bodyWith, whose four rows per gate are here the AND bit, the two ciphertexts of an AND gate and an empty row, and reads the decoding bits from the zero labels. The evaluator is a fold over the gates whose state is the labels so far and the position of the next gate's block.

In both folds a new label is cut to k + 2 bits, which changes nothing since no label has more, and which bounds the growth of the state; and wire numbers read in binary are capped at one past the number of labels so far, which changes no lookup (List.getD_min_length_succ_sub_one).

A body whose rows read only the gate, its AND bit and the row number, as the bodies written by the simulator and by the privacy reduction do, is certified once from gate data (HalfGates.bodyWith_gateData_polyTime).

Main results #

Lengths of labels #

theorem Cslib.Crypto.Garbling.HalfGates.length_getD_le {k : ℕ} {ws : List (List Bool)} (hws : ∀ w ∈ ws, w.length ≤ k + 2) (i : ℕ) :
(ws.getD i []).length ≤ k + 2

A defaulted lookup in words of at most k + 2 bits has at most k + 2 bits.

theorem Cslib.Crypto.Garbling.HalfGates.length_andWord_le (hash : List Bool → List Bool → List Bool) (k g : ℕ) (TG TE a b : List Bool) :
(andWord hash k g TG TE a b).length ≤ k + 2

The evaluator's AND gate writes at most k + 2 bits.

The zero labels as a fold #

The evaluator as a fold with bounded growth #

The garbled function from gate data #

Certificates #

A label read at a wire number written in binary, capped by the number of labels.

Evaluation #

Bodies from gate data #

A garbled function body from gate data is computed in polynomial time when each row reads only the number of its gate, the gate's AND bit and its own number, and is computed in polynomial time from them.

Garbling #

Encoding information encInfoWord is computed in polynomial time from the security parameter, the input count f.n, and the coins.

Half-gates garbling is efficient for every hash family computed in polynomial time (CircularCorrelationRobust.polyTime supplies hf): the length readers n and m, the number of coins and the garbler on (1^k, f, r), and En, Ev, De and ev on their encoded arguments, run in polynomial time, for XOR–AND circuits encoded by encXorAndCircuit.