Documentation

CslibFrontier.Crypto.Primitives.Garbling.HalfGates.Reduction

The CCR reduction for the privacy of half-gates garbling #

The prv.sim advantage of an adversary B against the simulator simWord of HalfGates.scheme hash, with the side information Φ_circ, is exactly the circular correlation robustness advantage of an explicit, certified reduction prvSimReduction hash B, at every parameter k where every circuit B can choose has 2 q ≤ 2 ^ k (prvSimAdvantage_simWord_eq).

The reduction follows the hybrid G₁^O of the proof of Theorem 1 of Zahur, Rosulek and Evans [ZRE15] (Fig. 3, p. 13), on words and with this library's tweaks, and hands its view to B. It runs B's choice of a query (f, x). When x has f.n bits and 2 q ≤ 2 ^ k, it samples the labels the evaluator holds on the inputs and walks the gates in order, knowing the value v of every wire from x. An XOR gate adds its argument labels a and b. An AND gate asks its oracle (a, t, col(b) ⊕ v_b) and (b, t', v_a), at the tweaks t and t' of its two slots, and adds the parts of the two ciphertexts the evaluator can compute: TG = H(a, t) ⊕ O(a, t, col(b) ⊕ v_b) and TE = H(b, t') ⊕ a ⊕ O(b, t', v_a); its label is the evaluator's AND gate on them. Each query is asked once the labels it reads are known, so later queries depend on earlier answers. The reduction then runs B's guess on the view (F, X, d) with these ciphertexts, the input labels and, for each output, the colour of its label plus its value. Otherwise it runs B's guess on ⊥ without querying: on an invalid query, as the prv.sim game does, and when 2 q > 2 ^ k, where the k-bit tweaks of distinct slots could coincide.

Against every fixed oracle the reduction runs the typed reduction HalfGates.reduction of CslibFrontier.Crypto.Primitives.Garbling.HalfGates.Privacy on toCircuit f, with B's guess on the words of the view. So, averaged over B's choice, its circular game is the real prv.sim experiment by HalfGates.realGame_reduction, and its random-function game is the simulated one by HalfGates.simGame_reduction, since distinct slots have distinct tweaks while 2 q ≤ 2 ^ k. The reduction asks every tweak at most once on every run, at every level, which is the legality condition of CircularCorrelationRobust (isTweakUnique_prvSimReduction), and it is uniform strict oracle PPT for every adversary certified by TwoStage.IsPPT and every hash computed in polynomial time (isOraclePPT_prvSimReduction).

Main definitions #

Main results #

References #

The reduction #

The CCR reduction for a prv.sim adversary B against half-gates garbling, at parameter k: run B's choice of a query (f, x). When x has f.n bits and 2 q ≤ 2 ^ k, sample the input labels, build the ciphertexts gate by gate with the oracle and run B's guess on the resulting view; otherwise run B's guess on ⊥ without querying.

Legality #

The reduction is legal at every level. At every level k, the reduction for B, read through CCR.codec k, asks each tweak at most once on every run: it asks only when 2 q ≤ 2 ^ k, and then at the tweaks 2 g + s of distinct slots, which are distinct below 2 ^ k.

Against every oracle the reduction runs the typed reduction #

The exact equality #

theorem Cslib.Crypto.Garbling.HalfGates.prvSimAdvantage_simWord_eq (hash : List Bool → List Bool → List Bool) {σ : Type} (B : ℕ → PrvSimAdversary XorAndCircuit σ) (k : ℕ) (hq : ∀ (query : Query XorAndCircuit) (state : σ), (query, state) ∈ ((B k).choose ()).eval.support → query.input.length = query.fn.circuit.n → 2 * query.fn.circuit.q ≤ 2 ^ k) :

The prv.sim advantage against the simulator is the reduction's CCR advantage. At parameter k, if every valid query that B k can choose has a circuit with 2 q ≤ 2 ^ k, the prv.sim advantage of B k against simWord hash k, with the side information Φ_circ, equals the finite circular correlation robustness advantage CCR.advantage (CCR.atLevel hash k) CCR.offset CCR.offset of prvSimReduction hash B at level k, read through CCR.codec k.

Efficiency #

The records are written as the right-nested tuples of their fields.