The BMR16 garbling scheme for mixed-modulus circuits #
The garbling scheme of Ball, Malkin and Rosulek [BallMalkinRosulek2016, Figure 1]
for mixed-modulus circuits (MixedModulus.MixedModulusCircuit), its correctness, and the exact
reduction identity behind its privacy for one hash, circuit, input and distinguisher. Privacy itself
is not proved here: the privacy part of [BMR16] Theorem 1 needs a family of schemes,
an assumption that bounds the adversary's efficiency and a certified reduction, and is tracked in
#6068.
Each sort i has a secret offset Δ_i = (δ_i, 1) and each wire w of sort i a zero label
W_w^0; the label of value x ∈ ℤ_{μ i} is W_w^x = W_w^0 + x Δ_i, whose colour is the colour of
W_w^0 plus x.
Add_mandMult_cgates are free: the output zero label is the sum of the input zero labels, orctimes the input zero label, and no ciphertext is sent.- A projection gate
gfrom a wireaof sortito sortjsends one ciphertext for each non-zero colour of its input. Withτthe colour ofW_a^0, the row of colourτ + xencryptsW_g^{φ x}asH(g, W_a^x) + W_g^{φ x}; the output zero labelW_g^0 = -H(g, W_a^{-τ}) - φ(-τ) Δ_jis chosen so that the row of colour0is zero and need not be sent (row reduction,reduceRows). The evaluator holdingW_areads the rowcnamed by its colour, taken to be zero forc = 0, and subtractsH(g, W_a).
The input encoding is (W^0, Δ), mapping x to W^0 + x Δ; the decoding information is the
colour of the zero label of each output wire, so an output label decodes to its colour minus
that colour. [BMR16] also sends output hashes, which add authenticity; they play no
role in privacy and are not modelled here. Mult_c is allowed for every c, not only for c
coprime to the modulus.
Correctness (Garbled.run_ofKeys) holds for every hash, tweak assignment, offsets and zero labels.
Privacy is simulation-based with the circuit's shape as side information: the simulator
(simulate) samples one uniform label per input wire and uniform ciphertexts, and sets the
decoding information so that the evaluated output labels decode to the output. It is polymorphic
in the projection payload, so it cannot read the projection functions (a parametricity argument
about its definition, not a theorem stated here), and it does not take the input. The reduction
identity advantage_realGame_simGame shows that the advantage of any distinguisher D between
the real and the simulated view is equal to the mixed-modulus CCR advantage
(MixedModulus.ccrAdvantage) of an explicit reduction reduction, provided the tweaks of the
gates are distinct. The reduction samples the active labels of the input wires, evaluates the
circuit gate by gate, and asks the oracle, at projection gate g reading a wire of value v and
active label A, the query (g, A, x - v, φ x - φ v) for each x ≠ v: against the real oracle
the answer is H(g, W^x) + (φ x - φ v) Δ_j, which yields the real ciphertexts and active labels,
and against a random function the ciphertexts are uniform. The reduction is legal in the sense of
MixedModulus.CCRAdversary.IsLegal (reduction_isLegal): along every run it never uses
multiplier 0, and its queries are determined by their tweak and multiplier. It asks several
queries under one tweak, so it is not legal for the literal Definition 1 of
[BMR16]; see MixedModulus. Running time is not tracked: there are no cost
bounds for garbling, evaluation, the simulator or the reduction. No assumption is applied, so no
privacy bound is concluded: that needs an asymptotic form of mixed-modulus circular correlation
robustness against efficient adversaries and a PPT certificate for a family version of the
reduction (#6068).
Main definitions #
Cslib.Crypto.Garbling.BMR16.garbleWith,.Garbled,.garble: garbling.Cslib.Crypto.Garbling.BMR16.evaluate,.decode,.Garbled.run: evaluation and decoding.Cslib.Crypto.Garbling.BMR16.simulateWith,.simulate,.realGame,.simGame: the simulator and the privacy experiments.Cslib.Crypto.Garbling.BMR16.reduction: the mixed-modulus CCR adversary.
Main results #
Cslib.Crypto.Garbling.BMR16.Garbled.run_ofKeys,.Garbled.run_of_mem_support: correctness.Cslib.Crypto.Garbling.BMR16.View.run_simulateWith: simulated views decode to the output.Cslib.Crypto.Garbling.BMR16.reduction_isLegal: the reduction is a legal adversary.Cslib.Crypto.Garbling.BMR16.advantage_realGame_simGame: the reduction identity, not a privacy theorem: the advantage of a distinguisher between the real and the simulated view equals the mixed-modulus CCR advantage of the reduction.
References #
Garbled tables and row reduction #
The garbled tables of a circuit: for a projection gate from sort i to sort j, one label of
sort j for each non-zero colour of its input; addition and multiplication gates have none.
Instances For
Row reduction. Given the value u x to be sent in the row of input value x, relative to a
zero label of colour τ, the rows u (c - τ) - u (-τ) of the non-zero colours c and the label
-u (-τ) added to every row, which makes the row of colour 0 zero.
Reading the row of the colour of the label of value v and subtracting the part h of
u v gives the reduced label plus the rest of u v.
Shifting every value by a constant z keeps the rows and shifts the reduced label by z.
Garbling, evaluation and decoding #
Garble a circuit, from its gate number k on, given the hash H, the tweak tw k of gate
k, the offsets δ and the zero labels E of the wires so far: the garbled tables and the zero
labels of the output wires.
Evaluate garbled tables, from gate number k on, given the active labels A of the wires so
far: the active labels of the output wires.
Encode residues V with zero labels E and offsets δ: E + V Δ.
Decode output labels Y with decoding information d: each colour minus its entry of d.
With d the colours of the output zero labels this recovers the output values.
The colours of a list of labels.
A garbled circuit: its tables, its input encoding information (zero labels and offsets), and its decoding information.
- tables : Tables ℓ C
The garbled tables.
- zeroLabels : MixedModulus.Env (MixedModulus.Label μ ℓ) Γ
The zero label of each input wire.
The key parts of the offsets.
- decoding : MixedModulus.Env (MixedModulus.Residue μ) Θ
The colour of the zero label of each output wire.
The garbled circuit with offsets δ and input zero labels E.
Encode an input with a garbled circuit's encoding information.
Evaluate a garbled circuit on an encoded input and decode the result.
Garble a circuit with uniform offsets and input zero labels.
Correctness #
The colour of W + x Δ_i is the colour of W plus x.
Decoding encoded output labels with the colours of their zero labels gives the values.
Decoding output labels Y with information decode y Y gives y.
Evaluation follows the labels of the actual wire values: with zero labels E, the active
labels E + V Δ evaluate to the encoded output values.
Correctness: evaluating a garbled circuit on an encoded input and decoding gives the circuit's output, for every hash, tweak assignment, offsets and zero labels.
Correctness of the randomized garbling: every garbled circuit it can output evaluates correctly on every input.
The privacy experiments #
What the evaluator of a garbled circuit sees: the garbled tables, one label per input wire and the decoding information. The circuit's shape is public, as an index of the type.
- tables : Tables ℓ C
The garbled tables.
- input : MixedModulus.Env (MixedModulus.Label μ ℓ) Γ
The label of each input wire.
- decoding : MixedModulus.Env (MixedModulus.Residue μ) Θ
The decoding information.
The view of a garbled circuit on an input.
Evaluate a view and decode the result.
Running the view of a garbled circuit on x is running the garbled circuit on x.
The simulated view with input labels A and tables R: the decoding information makes the
evaluated output labels decode to y.
Simulator correctness: every simulated view decodes to y.
The reduction #
Against a fixed oracle f, the value the reduction encrypts in the row of input value x of
a projection gate with tweak t reading a wire with active label W and value v: H(t, W)
for x = v, and otherwise the reply to the query (t, W, x - v, φ x - φ v).
The reduction's run against a fixed oracle f, from gate number k on, given the active
labels A and values V of the wires so far: the tables and the active labels of the output
wires that it builds.
The oracle queries of a projection gate, for the input values in xs: the table of the values
rowsWith encrypts, read from the oracle.
The simulator: uniform input labels and uniform tables. It sees the shape of the circuit, the
public hash and tweaks, and the output; being polymorphic in the projection payload P, it cannot
read the projection functions.
The real privacy experiment: garble C and run D on the view of the garbled circuit on
x.
The simulated privacy experiment: run D on a view simulated from the shape of C and its
output on x.
The reduction's adaptive run, from gate number k on: reduceWith with oracle queries.
The mixed-modulus CCR adversary built from a distinguisher D for the circuit C on input
x: sample active input labels, run the circuit gate by gate with oracle queries at the
projection gates, set the decoding information from the output, and run D.
The reduction against the real oracle #
Against the real oracle, the reduction builds the real tables and active output labels.
Decoding encoded output values with the outputs gives the colours of the zero labels.
Encoding uniform zero labels gives uniform active labels.
The reduction against a random function #
Interpreting the queries of a projection gate against a fixed oracle f reads rowsWith f
on the listed values.
Interpreting the adaptive reduction against a fixed oracle f is its run reduceWith f.
Locality: the reduction's run from gate k on reads the oracle only at the tweaks of the
remaining gates.
The ideal step: against a uniformly random function, the tables the reduction builds are uniform, and its active output labels are the evaluation of those tables, provided the remaining gates have distinct tweaks.
Privacy #
Against the real oracle, the reduction plays the real privacy experiment.
Against a random function, the reduction plays the simulated privacy experiment, provided the gates have distinct tweaks.
The reduction identity behind the privacy of BMR16, not the privacy part of
[BMR16] Theorem 1. For one hash H, mixed-modulus circuit C, input x and
distinguisher D, if the gates have distinct tweaks, the advantage of D between the real and
the simulated view equals the mixed-modulus CCR advantage of the explicit reduction
reduction H tw C x D against H, which is legal (reduction_isLegal). No assumption is applied
and nothing is bounded: privacy needs an asymptotic form of mixed-modulus circular correlation
robustness against efficient adversaries and a PPT certificate for a family version of the
reduction, which do not exist yet (#6068).
Legality of the reduction #
The reduction is legal: along every run, whatever its private coins and the oracle's
replies, it never uses multiplier 0, and its queries are determined by their tweak, source sort,
label and multiplier, provided the gates have distinct tweaks.