Documentation

CslibFrontier.Crypto.Primitives.Garbling.BinaryToOneHotObliviousness

Per-instance CCR reduction step for the garbled binary-to-one-hot conversion #

This file proves the exact per-instance concrete circular correlation robustness (CCR) reduction identity behind obliviousness of the binary-to-one-hot conversion bin-to-hot of Heath [Hea24] (§4.1, p. 14), used for one-hot garbling in logrow [HKN24]. Asymptotic obliviousness in the sense of [BHR12b] or [HKN24] Theorem 3 is not proved here (#5293): the size n, index x, hash H, tweak map tw and distinguisher D are fixed, no CCR assumption is applied, no PPT efficiency witness is proved for reduction, and the gadget hashes all 2 ^ (n + 1) positions outside a full logrow scheme family.

The evaluator of bin-to-hot sees a OneHotView: one label on each of the n + 1 input wires and the n ciphertexts. Its index x is public. The simulator simulate samples all of these uniformly, from n alone. A simulator that sees neither the input nor an output corresponds to obliviousness in the sense of Bellare, Hoang and Rogaway [BHR12b], the notion of [HKN24], Theorem 3, whose proof simulates the one-hot rows (n here, the paper's n - 1) by uniform strings and refers to [HK21] for this. The argument of [HK21] is for its own GGM-tree construction, and [Hea24] obtains obliviousness from its general switch-system theorem (Theorem 4). The reduction below is original to this file: an exact finite reduction from the single-ciphertext construction to the tweaked circular correlation robustness game.

The reduction targets circular correlation robustness [CKKZ12], in the tweaked form of [HKN24], Definition 1, which follows [ZRE15] (see also [GKWY20] on tweakable variants). It is the instance Cslib.Crypto.Garbling.CCR with both offsets δ k: for an offset Δ drawn from a key, the oracle CCR.oracle H Δ Δ answers (X, τ, b) with H (X + Δ) τ + bitOffset Δ b; Definition 1 draws Δ with its least significant bit fixed to one, which a suitable key map δ expresses. The per-instance concrete reduction identity advantage_realGame_simGame_eq (a step, not an obliviousness theorem) states that for every distinguisher D, the advantage between the real view and the simulated view equals the circular correlation robustness advantage CCR.advantage H δ δ of an explicit reduction reduction H tw n x D. It needs only that different doubling steps use different tweaks.

The reduction samples the input labels uniformly and evaluates the gadget step by step. At step t it needs the hash of the zero-label at the hot position, which is its own label there plus Δ, so it makes one query, at its label, at the tweak of the hot position and the new input bit. With the keyed oracle the answer is that hash plus the new bit's offset, which gives the ciphertext exactly (realGame_reduction). With a uniformly random function every query is at a fresh tweak (isTweakUnique_reduction), so CCR.idealFreshGame_eq_prfIdealGame_of_isTweakUnique replaces the random function by fresh uniform answers per query, making every ciphertext uniform given what came before (idealGame_reduction).

The reduction makes n queries (isQueryBounded_reduction) at pairwise distinct tweaks (isTweakUnique_reduction). In particular it never asks the same (X, τ) with both bits, which Definition 1 forbids as illegal: against such a query pair the keyed oracle is trivially distinguishable, so the identity is useful for the reductions of this file and not for arbitrary adversaries of CCR.advantage. No assumption is applied and nothing is bounded: the size, index, hash, tweaks and distinguisher are fixed, running time is not tracked, and asymptotic obliviousness, privacy and authenticity of the full logrow gate are not formalized here (#5293).

Main definitions #

Main results #

References #

@[reducible, inline]

What the evaluator of the gadget with n doubling steps sees: one label on each input wire and the ciphertexts. Its index is public and is not part of the view.

def Cslib.Crypto.Garbling.BinaryToOneHot.oracleSteps {L T : Type} [AddCommGroup L] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (n : ℕ) :
(Fin (n + 1) → Bool) → (Fin (n + 1) → L) → ProbOracleComp (fun (x : CCR.Query L T) => L) ((Fin n → L) × ((Fin (n + 1) → Bool) → L))

The reduction's evaluation, against oracle O: the ciphertexts of the gadget whose evaluator holds the labels A, and the evaluator's one-hot labels. Step t asks O once, at the label at the hot position, the tweak of that position and the new input bit.

The simulator: uniform input labels and uniform ciphertexts. It sees only n.

noncomputable def Cslib.Crypto.Garbling.BinaryToOneHot.realGame {L T Key : Type} [AddCommGroup L] [Fintype L] [Fintype Key] [Nonempty Key] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (δ : Key → L) (n : ℕ) (x : Fin (n + 1) → Bool) (D : OneHotView L n → ProbComp Bool) :

The real obliviousness experiment: draw a key and uniform input zero-labels, garble, and run D on the labels of the bits of x and the ciphertexts.

The simulated obliviousness experiment: run D on a simulated view.

noncomputable def Cslib.Crypto.Garbling.BinaryToOneHot.reduction {L T : Type} [AddCommGroup L] [Fintype L] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (n : ℕ) (x : Fin (n + 1) → Bool) (D : OneHotView L n → ProbComp Bool) :
ProbOracleComp (fun (x : CCR.Query L T) => L) Bool

The circular correlation robustness adversary: sample the input labels uniformly, compute the ciphertexts with one oracle query per step, and run D on the labels and ciphertexts.

theorem Cslib.Crypto.Garbling.BinaryToOneHot.isQueryBounded_reduction {L T : Type} [AddCommGroup L] [Fintype L] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (n : ℕ) (x : Fin (n + 1) → Bool) (D : OneHotView L n → ProbComp Bool) :
(reduction H tw n x D).IsQueryBounded n

The reduction makes one oracle query per doubling step.

theorem Cslib.Crypto.Garbling.BinaryToOneHot.isTweakUnique_reduction {L T : Type} [AddCommGroup L] [Fintype L] [DecidableEq T] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (n : ℕ) (htw : ∀ (t t' : ℕ) (j : Fin (t + 1) → Bool) (j' : Fin (t' + 1) → Bool), t < n → t' < n → tw t j = tw t' j' → t = t') (x : Fin (n + 1) → Bool) (D : OneHotView L n → ProbComp Bool) :

When different steps use different tweaks, the reduction makes at most one query with each tweak.

theorem Cslib.Crypto.Garbling.BinaryToOneHot.realGame_reduction {L T Key : Type} [AddCommGroup L] [Fintype L] [Module (ZMod 2) L] [Fintype Key] [Nonempty Key] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (δ : Key → L) (n : ℕ) (x : Fin (n + 1) → Bool) (D : OneHotView L n → ProbComp Bool) :
(PRF.realExperiment (CCR.keyed H δ δ) (reduction H tw n x D)).eval = realGame H tw δ n x D

Real side: against the keyed oracle, the reduction plays the real experiment.

theorem Cslib.Crypto.Garbling.BinaryToOneHot.idealGame_reduction {L T : Type} [AddCommGroup L] [Fintype L] [DecidableEq L] [Fintype T] [DecidableEq T] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (n : ℕ) (htw : ∀ (t t' : ℕ) (j : Fin (t + 1) → Bool) (j' : Fin (t' + 1) → Bool), t < n → t' < n → tw t j = tw t' j' → t = t') (x : Fin (n + 1) → Bool) (D : OneHotView L n → ProbComp Bool) :

Ideal side: against a uniformly random function, the reduction plays the simulated experiment, when different doubling steps use different tweaks.

theorem Cslib.Crypto.Garbling.BinaryToOneHot.advantage_realGame_simGame_eq {L T Key : Type} [AddCommGroup L] [Fintype L] [DecidableEq L] [Fintype T] [DecidableEq T] [Module (ZMod 2) L] [Fintype Key] [Nonempty Key] (H : L → T → L) (tw : (t : ℕ) → (Fin (t + 1) → Bool) → T) (δ : Key → L) (n : ℕ) (htw : ∀ (t t' : ℕ) (j : Fin (t + 1) → Bool) (j' : Fin (t' + 1) → Bool), t < n → t' < n → tw t j = tw t' j' → t = t') (x : Fin (n + 1) → Bool) (D : OneHotView L n → ProbComp Bool) :
(realGame H tw δ n x D).advantage (simGame n D) = CCR.advantage H δ δ (reduction H tw n x D)

Per-instance concrete reduction identity behind obliviousness of the binary-to-one-hot gadget: a step, not an asymptotic obliviousness theorem in the sense of [BHR12b] or [HKN24] Theorem 3 (#5293). The size n, index x, hash H, tweak map tw and distinguisher D are fixed, no circular correlation robustness assumption is applied, and running time is not tracked. For every distinguisher D, the advantage between the real view of the garbled gadget on index x and the simulated view equals the advantage of reduction H tw n x D against the circular correlation robust oracle, when different doubling steps use different tweaks. The proof uses that each query is at a fresh tweak; only the tweaks at the hot positions need to differ across steps, so htw is stronger than necessary.