Rerandomizable garbling schemes #
A rerandomizable garbling scheme (RGS), adapting Acharya, Hazay, Kolesnikov and Prabhakaran
[AcharyaHazayKolesnikovPrabhakaran2024, Definition 3] (full version, ePrint 2024/383), is a
projective garbling scheme with an extra algorithm rerand that takes a garbled circuit gc and
returns a fresh-looking garbled circuit gc' together with one label permutation per input wire.
Applying the permutations to the input labels of gc gives the input labels of gc', so an
evaluator holding an encoding for gc can move to gc' without the garbler. All randomness is
explicit: garble f r garbles f with coins r, returning a Garbled record (the circuit and
its label pairs), and rerand gc r' rerandomizes with coins r', returning a Rerandomized
record (the new circuit and its wire permutations). Decoding is folded into evaluate.
Unlike Cslib.Crypto.Garbling.Scheme
(CslibFrontier/Crypto/Primitives/Garbling/Scheme.lean), which is typed by List Bool,
indexed by a security parameter, and intentionally omits projective structure,
RerandomizableGarbling exposes per-wire label pairs so per-wire permutations can act directly
on encodings.
Randomness composition (RandomnessComposition) says that a rerandomized garbling
(rerandGarbled) is itself an honest garbling, with coins explainGb r r' computed from the
garbling coins and the rerandomization coins, and that two rerandomizations (rerandTwice)
compose into one with coins explainRerand r₁ r₂. The garbling half adapts the
randomness-composition property of Definition 3, while explainRerand is an explicit two-step
rerandomization-composition axiom of this formalization. With garble_explainGb, correctness of
fresh garblings implies correctness of rerandomized ones (rerandCorrect_of_correct).
Two security notions are compared. Each has a view record handed to the distinguisher, a real
and an ideal sampler of that view, the two experiments running a distinguisher on the sampled
view, and an advantage; the projective encoding is encode, and permEncoding and permInput
apply wire permutations.
- Rerandomization privacy (
RerandView,rerandRealView,rerandIdealView; adapting Definition 3): given the garbling coinsr, the rerandomized circuit and the rerandomized encoding ofxlook like a fresh garbling offwith an honest encoding ofx. - Explainability (adapting Definition 9, p. 33 of ePrint 2024/383). Explainable garbling
(
ExplainGbView,explainGbRealView,explainGbIdealView): given an encoding ofxforgcand a rerandomization ofgcover uniformly sampled garbling and rerandomization coins, the coinsexplainGb r r'look like the coins of a fresh garbling. Explainable rerandomization (ExplainRerandView,explainRerandRealView,explainRerandIdealView): given a rerandomizationgc₁ofgcand a rerandomizationgc₂ofgc₁over uniformly sampled coins, the coinsexplainRerand r₁ r₂look like coins that rerandomizegcdirectly.
This development proves two generic single-instance reductions relating sampled-coin
explainability to rerandomization privacy under explicit algebraic invertibility hypotheses
(RandomnessComposition.Invertible). The advantage of any distinguisher against explainable
garbling equals the rerandomization-privacy advantage of explainGbReduction
(explainGbAdvantage_eq). The advantage against explainable rerandomization is at most the sum of
the rerandomization-privacy advantages of two reductions (explainRerandAdvantage_le), through one
intermediate hybrid: the right reduction run on the ideal rerandomization-privacy view, which has
the same law as the left reduction on that view. Running the right reduction on the real view is
the ideal explainable-rerandomization experiment, by definition
(rerandRealExperiment_explainRerandReductionRight). Both reductions use the inverse data of
RandomnessComposition.Invertible (introduced for this development): the garbling explanation is
a bijection in the garbling coins with an explicit inverse, the rerandomization explanation is a
bijection in its first argument, and some rerandomization coins undo each rerandomization step.
The rerandomization bound also assumes that the label action respects composition of permutations.
When the explanation maps are bijective in their second argument, rerandomization privacy and the
stronger fixed-coin explainability variants (explainGbFixedRealView,
explainRerandFixedRealView, which hold the base coins r and r₁ fixed rather than sampling
them) hold with zero error, as equalities of view laws (eval_explainGbFixedRealView,
eval_explainRerandFixedRealView, eval_rerandRealView).
Scope #
In explainGbRealView/explainGbIdealView and explainRerandRealView/explainRerandIdealView,
the garbling and rerandomization coins are sampled uniformly (matching the sampled-coin experiment
structure of Definition 9 in ePrint 2024/383, p. 33): each samples the base coins and runs its
fixed-coin variant explainGbFixed*View or explainRerandFixed*View, which appear in the
zero-error bijectivity lemmas. On the hypothesis side, rerandRealView samples r uniformly
whereas Definition 3 quantifies over fixed r; because privacy at every fixed r implies privacy
for uniformly sampled r, the sampled-r assumption used by the reductions is weaker. The generic
reductions explainGbAdvantage_eq and explainRerandAdvantage_le, together with the two-step
composition field explainRerand and the inverse structure RandomnessComposition.Invertible, are
results and hypotheses of this development rather than transcriptions of a numbered theorem in the
paper. All statements are single-instance: the function, input and distinguisher are fixed, and
running time is not tracked, so no asymptotic security or efficiency of the reductions is claimed.
Main definitions #
Cslib.Crypto.Garbling.RerandomizableGarbling: an RGS with explicit coins, with outputsCslib.Crypto.Garbling.RerandomizableGarbling.GarbledandCslib.Crypto.Garbling.RerandomizableGarbling.Rerandomized.Cslib.Crypto.Garbling.RerandomizableGarbling.encode,Cslib.Crypto.Garbling.RerandomizableGarbling.permEncoding,Cslib.Crypto.Garbling.RerandomizableGarbling.permInput: projective encoding and permutations.Cslib.Crypto.Garbling.RerandomizableGarbling.evalGarbled,Cslib.Crypto.Garbling.RerandomizableGarbling.rerandGarbled,Cslib.Crypto.Garbling.RerandomizableGarbling.rerandTwice: evaluating a garbling, and rerandomizing it once or twice.Cslib.Crypto.Garbling.RerandomizableGarbling.Correct,Cslib.Crypto.Garbling.RerandomizableGarbling.RerandCorrect: correctness.Cslib.Crypto.Garbling.RerandomizableGarbling.RandomnessComposition: randomness composition.Cslib.Crypto.Garbling.RerandomizableGarbling.RandomnessComposition.Invertible: the inverse data used by the reductions.Cslib.Crypto.Garbling.RerandomizableGarbling.RerandView,Cslib.Crypto.Garbling.RerandomizableGarbling.ExplainGbView,Cslib.Crypto.Garbling.RerandomizableGarbling.ExplainRerandView: what the distinguisher sees.Cslib.Crypto.Garbling.RerandomizableGarbling.rerandRealView,Cslib.Crypto.Garbling.RerandomizableGarbling.rerandIdealView,Cslib.Crypto.Garbling.RerandomizableGarbling.explainGbRealView,Cslib.Crypto.Garbling.RerandomizableGarbling.explainGbIdealView,Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandRealView,Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandIdealView, and the fixed-coin variantsexplainGbFixedRealView,explainGbFixedIdealView,explainRerandFixedRealView,explainRerandFixedIdealView: the view samplers.Cslib.Crypto.Garbling.RerandomizableGarbling.rerandRealExperiment,Cslib.Crypto.Garbling.RerandomizableGarbling.rerandIdealExperiment,Cslib.Crypto.Garbling.RerandomizableGarbling.explainGbRealExperiment,Cslib.Crypto.Garbling.RerandomizableGarbling.explainGbIdealExperiment,Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandRealExperiment,Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandIdealExperiment: the experiments.Cslib.Crypto.Garbling.RerandomizableGarbling.explainGbReduction,Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandReductionLeft,Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandReductionRight: the reductions.Cslib.Crypto.Garbling.RerandomizableGarbling.rerandAdvantage,Cslib.Crypto.Garbling.RerandomizableGarbling.explainGbAdvantage,Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandAdvantage: distinguishing advantages.
Main results #
Cslib.Crypto.Garbling.RerandomizableGarbling.encode_permEncoding,Cslib.Crypto.Garbling.RerandomizableGarbling.permInput_comp,RerandomizableGarbling.RandomnessComposition.Invertible.permInput_invRerand,RerandomizableGarbling.RandomnessComposition.Invertible.explainGb_bijective: algebraic lemmas.Cslib.Crypto.Garbling.RerandomizableGarbling.rerandCorrect_of_correct.Cslib.Crypto.Garbling.RerandomizableGarbling.explainGbAdvantage_eq.Cslib.Crypto.Garbling.RerandomizableGarbling.explainRerandAdvantage_le, withCslib.Crypto.Garbling.RerandomizableGarbling.rerandRealExperiment_explainRerandReductionRight.Cslib.Crypto.Garbling.RerandomizableGarbling.eval_rerandRealView,Cslib.Crypto.Garbling.RerandomizableGarbling.eval_explainGbFixedRealView,Cslib.Crypto.Garbling.RerandomizableGarbling.eval_explainRerandFixedRealView: zero error under bijectivity in the second argument.
References #
- A. Acharya, C. Hazay, V. Kolesnikov, M. Prabhakaran, Malicious Security for SCALES: Outsourced Computation with Ephemeral Servers; definition and theorem numbers refer to the full version, ePrint 2024/383.
The output of garbling: a garbled circuit and, for each of the m input wires, its pair of
labels for the bits false and true.
- circuit : GC
The garbled circuit.
The labels of each input wire, for the bits
falseandtrue.
The output of rerandomization: a rerandomized circuit and one label permutation per input wire, carrying the labels of the old circuit to those of the new one.
- circuit : GC
The rerandomized circuit.
- perm : Fin m → Perm
The label permutation of each input wire.
A projective rerandomizable garbling scheme for functions F on m input bits, with explicit
garbling coins Coins and rerandomization coins RerandCoins. garble f r returns a garbled
circuit and one pair of labels per input wire (for bits false and true); rerand gc r'
returns a rerandomized circuit and one label permutation per input wire, acting on labels by
act; comp p q is meant as the permutation p followed by q, a property that is not part of
the structure and is assumed where needed (explainRerandAdvantage_le).
- GC : Type
Garbled circuits.
- Label : Type
Wire labels.
- Perm : Type
Label permutations.
- Coins : Type
Garbling coins.
- RerandCoins : Type
Rerandomization coins.
- Out : Type
Outputs.
- fintypeRerandCoins : Fintype self.RerandCoins
- nonemptyRerandCoins : Nonempty self.RerandCoins
The function computed by a description.
Garbling with given coins.
Rerandomization with given coins.
The action of permutations on labels.
Composition of permutations, meant as
pfollowed byq.Evaluation of a garbled circuit on one label per input wire.
Encodings and correctness #
Rerandomize a garbling with coins r': the rerandomized circuit, with the labels permuted by
the rerandomization's wire permutations.
Rerandomize gc with coins r₁ and then r₂: the final circuit, with each wire's two
permutations composed.
Correctness of fresh garblings: evaluating garble f r on x gives f x.
Correctness of rerandomized garblings: evaluating the rerandomization of garble f r on x
gives f x.
Randomness composition. A rerandomization of garble f r with coins r', with its permuted
encoding table, is the honest garbling of f with coins explainGb r r'; and rerandomizing
garble f r with coins r₁ and then r₂ gives the rerandomization with coins
explainRerand r₁ r₂, with the composed permutations.
The garbling coins that explain a rerandomized garbling.
The rerandomization coins that explain two rerandomization steps.
- garble_explainGb (f : F) (r : G.Coins) (r' : G.RerandCoins) : G.garble f (self.explainGb r r') = G.rerandGarbled (G.garble f r) r'
- rerand_explainRerand (f : F) (r : G.Coins) (r₁ r₂ : G.RerandCoins) : G.rerand (G.garble f r).circuit (self.explainRerand r₁ r₂) = G.rerandTwice (G.garble f r).circuit r₁ r₂
Under randomness composition, correctness of fresh garblings gives correctness of rerandomized ones.
Inverse data for randomness composition, used by the reductions from rerandomization privacy
to explainability: unexplainGb · r' inverts explainGb · r', explainRerand is a bijection in
its first argument, and the coins invRerand r' undo a rerandomization step with coins r', on
the circuit and on every label.
The inverse of
explainGb · r'.- unexplainGb_explainGb (r : G.Coins) (r' : G.RerandCoins) : self.unexplainGb (rc.explainGb r r') r' = r
- explainGb_unexplainGb (r : G.Coins) (r' : G.RerandCoins) : rc.explainGb (self.unexplainGb r r') r' = r
- explainRerand_bijective (r₂ : G.RerandCoins) : Function.Bijective fun (x : G.RerandCoins) => rc.explainRerand x r₂
Coins that undo a rerandomization step.
Views #
What a rerandomization-privacy distinguisher sees.
What an explainable-garbling distinguisher sees.
What an explainable-rerandomization distinguisher sees.
- base : G.GC
The base circuit.
The evaluator's input labels for the first rerandomization.
- rerandomized : G.GC
The first rerandomization of the base circuit.
- candidate : G.GC
The challenge circuit.
- coins : G.RerandCoins
The rerandomization coins claimed to carry the base circuit to the challenge circuit.
View samplers #
Rerandomization privacy, real view: garble with uniform coins r, rerandomize with uniform
coins, and show r, the rerandomized circuit and the permuted encoding of x.
Rerandomization privacy, ideal view: uniform coins r together with an independent fresh
garbling and the encoding of x.
Explainable garbling with fixed garbling coins r, real view: the encoding of x and the
circuit of garble f r, a rerandomization of that circuit with uniform coins r', and the
explanation explainGb r r'.
Explainable garbling with fixed garbling coins r, ideal view: the challenge is a fresh
garbled circuit and its coins.
Explainable garbling, real view (sampled garbling coins).
Explainable garbling, ideal view (sampled garbling coins).
Explainable rerandomization with fixed coins r and r₁, real view: garble with coins r,
rerandomize with r₁ and then uniform r₂, and show the base circuit, the encoding of x for
the first rerandomization, both rerandomized circuits and the explanation explainRerand r₁ r₂.
Explainable rerandomization with fixed coins r and r₁, ideal view: the challenge is a
direct rerandomization of the base circuit and its coins.
Explainable rerandomization, real view (sampled coins).
Explainable rerandomization, ideal view (sampled coins).
Experiments and advantages #
The real rerandomization-privacy experiment: D guesses on the real view.
The ideal rerandomization-privacy experiment: D guesses on the ideal view.
The real explainable-garbling experiment: D guesses on the real view.
The ideal explainable-garbling experiment: D guesses on the ideal view.
The real explainable-rerandomization experiment: D guesses on the real view.
The ideal explainable-rerandomization experiment: D guesses on the ideal view.
The advantage of D in telling the real rerandomization-privacy view from the ideal one.
The advantage of D in telling the real explainable-garbling view from the ideal one.
The advantage of D in telling the real explainable-rerandomization view from the ideal
one.
Reductions #
The rerandomization-privacy distinguisher built from an explainable-garbling distinguisher:
it shows D the challenge input labels and circuit as the base, and the circuit of
garble f v.coins with those coins as the challenge.
The first rerandomization-privacy distinguisher built from an explainable-rerandomization
distinguisher: it samples s, takes the base circuit garbled with coins unexplainGb v.coins s,
and shows D that base, the challenge input labels and circuit, the base's rerandomization with
coins s, and s.
The second rerandomization-privacy distinguisher built from an explainable-rerandomization
distinguisher: it samples s, takes the base circuit garbled with coins v.coins, and shows D
that base, the challenge input labels and circuit, the base's rerandomization with coins s, and
s.
Permutation lemmas #
Permuting by composed permutations is permuting twice, when the action respects composition.
The permutations of the undoing rerandomization step invert those of the original step.
explainGb · r' is a bijection.
Reindexing uniform samples #
Explainability from rerandomization privacy #
Explainable garbling from rerandomization privacy. For every distinguisher D, the
explainable-garbling advantage of D equals the rerandomization-privacy advantage of
explainGbReduction f D.
Running the right reduction on the real rerandomization-privacy view is the ideal explainable-rerandomization experiment.
Explainable rerandomization from rerandomization privacy. If the label action respects
composition of permutations, then for every distinguisher D the explainable-rerandomization
advantage of D is at most the sum of the rerandomization-privacy advantages of
explainRerandReductionLeft hinv f D and explainRerandReductionRight f D. The intermediate
hybrid is the right reduction on the ideal view, which equals the left reduction on the ideal
view.
Zero error under bijectivity in the second argument #
If explainGb r is a bijection for every r, rerandomization privacy holds with zero
error: the real and ideal views have the same law.
If explainGb r is a bijection, explainable garbling with fixed coins r holds with zero
error.
If explainRerand r₁ is a bijection, explainable rerandomization with fixed coins r and
r₁ holds with zero error.