Documentation

CslibFrontier.Crypto.Primitives.Garbling.FreeXOR.Reduction

The CCR reduction for the privacy of Free-XOR garbling #

Library infrastructure (no cited result): the run equality and exact advantage equality connecting FreeXOR.prvSimReduction to FreeXOR.scheme, completing the reduction whose program, legality, and efficiency were certified in Part 3a.

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

The reduction runs B's choice of a query (f, x). When x has f.n bits and 8 q ≤ 2 ^ k, it samples one (k + 2)-bit active label per input and non-XOR gate, propagates active labels across XOR gates, evaluates the circuit on x to obtain all plaintext wire bits, and issues the 8 oracle queries of every non-XOR gate (allReqs) non-adaptively at level k ((key, true), tweak, bit), whose requests all carry distinct k-bit tweaks while 8 q ≤ 2 ^ k. It then builds the garbled view (F, X, d) from the oracle replies and hands it to B's guess. Otherwise (on an invalid input length or when 8 q > 2 ^ k), it makes no oracle queries and runs B's guess on ⊥.

Key-only queries H'(x, t) = CCR.atLevel hash k (x, false) t transfer to full-label queries via CCR.advantage_keyOnly in CslibFrontier.Crypto.Primitives.Garbling.CircularCorrelationRobust, since (x, true) + (R, true) = (x + R, false). Against every fixed full-label oracle O, the word reduction runs the typed reduction FreeXOR.reduction of CslibFrontier.Crypto.Primitives.Garbling.FreeXOR on toCircuit f (eval_run_prvSimReduction). Thus, by FreeXOR.realGame_reduction and FreeXOR.idealGame_reduction, its CCR advantage equals the prv.sim advantage (prvSimAdvantage_simWord_eq). The reduction asks every tweak at most once on every execution path (isTweakUnique_prvSimReduction), issues 8 requests per non-XOR gate on valid bounded inputs (exists_of_mem_support_runWith_prvSimReduction), and is uniform strict oracle PPT (isOraclePPT_prvSimReduction).

Main definitions #

Main results #

The word-level reduction #

Library construction (no cited definition): The CCR reduction for a prv.sim adversary B against Free-XOR garbling, at parameter k. Runs B's choice of (f, x). When x has f.n bits and 8 q ≤ 2 ^ k, it samples (n + q) active (k + 2)-bit labels, propagates across XOR gates, issues 8 CCR queries per non-XOR gate non-adaptively, assembles the view (F, X, d) from the replies, and runs B's guess. Otherwise it makes no queries and runs B's guess on ⊥.

Active label lengths and request structure #

Legality #

Library infrastructure (no cited result): Legality of the reduction. At every level k and for every prv.sim adversary B, the adapted reduction asks each k-bit tweak at most once on every execution path.

theorem Cslib.Crypto.Garbling.FreeXOR.exists_of_mem_support_runWith_prvSimReduction (hash : List Bool → List Bool → List Bool) {σ State : Type} (B : ℕ → PrvSimAdversary ValidCircuit σ) (k : ℕ) (oracle : Unit × List Bool → StateT State PMF (List Bool)) {s s' : State} {result : Bool} {transcript : OracleComp.Transcript fun (x : Unit × List Bool) => List Bool} (hmem : (result, s', transcript) ∈ (ProbOracleComp.runWith (OracleComp.withTranscript oracle) (prvSimReduction hash B k []) (s, [])).support) :
∃ (q : Query ValidCircuit) (st : σ), (q, st) ∈ ((B k).choose ()).eval.support ∧ List.length transcript = if q.input.length = (↑q.fn).n ∧ 8 * (↑q.fn).q ≤ 2 ^ k then 8 * List.count false (phiXor.phi q.fn).free else 0

Library infrastructure (no cited result): on any logged execution of prvSimReduction hash B k [] against a stateful word oracle, the adversary's choice (q, st) determines the request trace length: 8 requests per non-XOR gate of q.fn when q is valid and 8 * q.fn.1.q ≤ 2 ^ k, and 0 otherwise.

Against a fixed oracle #

theorem Cslib.Crypto.Garbling.FreeXOR.eval_run_prvSimReduction (hash : List Bool → List Bool → List Bool) {σ : Type} (B : ℕ → PrvSimAdversary ValidCircuit σ) (k : ℕ) (O : CCR.Query (BitString (k + 1) × Bool) (BitString k) → BitString (k + 1) × Bool) :
(((CCR.codec k).adapt (prvSimReduction hash B k [])).run fun (q : CCR.Query (BitString (k + 1) × Bool) (BitString k)) => pure (O q)).eval = ((B k).choose ()).eval.bind fun (x : Query ValidCircuit × σ) => match x with | (query, state) => if query.input.length = (↑query.fn).n ∧ 8 * (↑query.fn).q ≤ 2 ^ k then ((reduction (ConventionalCircuit.toCircuit query.fn) Circuits.fullInterpretation (fun (key : BitString (k + 1)) (t : BitString k) => CCR.atLevel hash k (key, false) t) (slotTweak (ConventionalCircuit.toCircuit query.fn).topology (freeCircuit query.fn) k) (BitString.ofList (↑query.fn).n query.input) fun (V : View (ConventionalCircuit.toCircuit query.fn).topology (freeCircuit query.fn) (BitString (k + 1))) => (B k).guess state (some (viewWord k (ConventionalCircuit.toCircuit query.fn).topology (freeCircuit query.fn) V))).run fun (q : CCR.Query (BitString (k + 1)) (BitString k)) => pure (O ((CCR.keyOnlyEmbed (BitString (k + 1)) (BitString k)) q))).eval else ((B k).guess state none).eval

Library infrastructure (no cited result): The word reduction runs the typed reduction. Against every fixed full-label oracle O, the reduction for B at parameter k runs B's choice of (f, x). When x has f.n bits and 8 q ≤ 2 ^ k, it runs the typed reduction FreeXOR.reduction on toCircuit f with key-only queries lifted via CCR.keyOnlyEmbed and B's guess on the view words; otherwise it runs B's guess on ⊥.

The exact equality #

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

Library infrastructure (no cited result): 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 8 q ≤ 2 ^ k, the prv.sim advantage of B k against simWord hash k, with side information phiXor, equals the finite CCR advantage CCR.advantage (CCR.atLevel hash k) CCR.offset CCR.offset of prvSimReduction hash B at level k, read through CCR.codec k.

Efficiency #

Library infrastructure (no cited result): Efficiency of the reduction. For every hash family computed in polynomial time and every uniform strict PPT prv.sim adversary B, prvSimReduction hash B is uniform strict oracle PPT.