Multi-Party Boolean Circuit Evaluation in the Shared-Multiplication Hybrid Model #
This module formalizes the $m$-party Boolean circuit-evaluation protocol and its perfect semi-honest privacy reduction, adapted from Goldreich's Foundations of Cryptography, Volume 2: Basic Applications, Section 7.5.2.3 (Construction 7.5.10 and Proposition 7.5.11, print pp. 705–707; generalizing the 2-party protocol of Section 7.3.4, Construction 7.3.9 and Proposition 7.3.10, print pp. 645–648):
- Deterministic $m$-Party Circuit Functionality (
circuitFunctionality): packsmparty inputsx : (i : Fin m) → BitString nintoBitString (m * n)viaCslib.BitString.blocksEquiv.symm, evaluates a De Morgan circuitC : Cslib.Circuits.Circuit Boolean.signature (m * n) (m * k)underBoolean.interpretation, and unpacks them * koutput bits into(i : Fin m) → BitString kviaCslib.BitString.block. - GMW Circuit-Evaluation Protocol (
gmwCircuitSchedule,gmwCircuitProtocol): in thesharedMulSpec m-hybrid model (Section 7.5.2, Eqs. 7.44–7.45, print p. 701):- Step 1 (Input sharing): each party
s : Fin msamples private coinsc s : Fin n → Fin (m - 1) → Bool, formsmadditive shares of its inputx s : BitString nviaProbComp.completeShares(placing the completing share at partym - 1, i.e.,⊤ : Fin m, rather than at senders), and sends partyr's share over a pairwise private.message s r (BitString n)round acrossallPairs m(including(s, s)self-messages). - Step 2 (Gate-by-gate circuit emulation): evaluates
C.programgate by gate, preserving the invariant that the sum of allmparties' shares of every wire equals the true wire value inC.program.trace Boolean.interpretation (BitString.blocksEquiv.symm x). Whereas Construction 7.5.10 is stated for arithmetic circuits over $\mathrm{GF}(2)$ with addition and multiplication gates,Cslib.Circuits.Circuit Boolean.signatureuses the De Morgan basis (const,not,and,or): constant and negation gates are evaluated locally (with party0holding the constant offset viaconstShare), while conjunction (.and) and disjunction (.or, via $a \lor b = a + b + a \cdot b$ over $\mathrm{GF}(2)$) invokesharedMulSpec m. - Step 3 (Output share refresh and reconstruction — adaptation of Construction 7.5.10
Step 3): in Goldreich's Construction 7.5.10 Step 3 (print p. 706), parties exchange their
output-wire shares directly via
.messagerounds under the circuit convention (print p. 705) that the output wires are the last, distinct gate wires of the circuit. BecauseCslib.Circuits.Circuit.outputs : Fin (m * k) → Wire (m * n) C.sizeallows arbitrary wire references (including input wires, negated wires, or wires reused across multiple outputs),singleCoordSteps/outputStepsfirst refreshes the shares of each output coordinate(r, j) : Fin m × Fin kvia onesharedMulSpec mcall (multiplying byconstShare true) before sending allmrefreshed shares to recipient partyrvia.message s r Boolrounds (includings = r) so partyrreconstructscircuitFunctionality m n k C x r.
- Step 1 (Input sharing): each party
- Perfect Semi-Honest Privacy (
gmwCircuitSim,perfectSemiHonestPrivate_gmwCircuit): proves Proposition 7.5.11 (print pp. 706–707), adapted to include the Step 3 share refresh so thatgmwCircuitProtocol m n k Cperfectly and privately computesFunctionality.ofDeterministic (circuitFunctionality m n k C)insharedMulWorld magainst every static coalitionI : Finset (Fin m)for every circuitCwithout syntactic restrictions onC.outputs.
Main definitions #
Cslib.Crypto.Protocols.MPC.circuitFunctionality: deterministic $m$-party functionality computed by a Boolean circuitC.Cslib.Crypto.Protocols.MPC.gmwCircuitSchedule,Cslib.Crypto.Protocols.MPC.gmwCircuitProtocol: Construction 7.5.10 (print p. 706), adapted to De Morgan gates and arbitraryCircuit.outputsvia Step 3 share refresh.Cslib.Crypto.Protocols.MPC.gmwCircuitSim: coalition simulator forgmwCircuitProtocol.
Main results #
Cslib.Crypto.Protocols.MPC.snd_eq_circuitFunctionality_of_mem_support_evalWith: perfect output correctness ofgmwCircuitProtocol m n k CinsharedMulWorld m.Cslib.Crypto.Protocols.MPC.perfectSemiHonestPrivate_gmwCircuit: Proposition 7.5.11 (print pp. 706–707), perfect semi-honest privacy ofgmwCircuitProtocol m n k CinsharedMulWorld magainst every static coalitionI : Finset (Fin m).
References #
- O. Goldreich, Foundations of Cryptography, Volume 2: Basic Applications, Section 7.3.4 (Construction 7.3.9, Proposition 7.3.10, pp. 645–649), Section 7.5.1.2 (Definition 7.5.1, Eqs. 7.39–7.40, p. 696), Section 7.5.2 (Eqs. 7.44–7.45, p. 701), and Section 7.5.2.3 (Construction 7.5.10, Proposition 7.5.11, pp. 705–707).
Deterministic multi-party circuit functionality #
Deterministic m-party Boolean circuit functionality (Goldreich Section 7.5.2.3, p. 705;
cf. Section 7.3.4, pp. 645–646): packs the m party inputs x : (i : Fin m) → BitString n into
BitString (m * n) via BitString.blocksEquiv.symm, evaluates C under Boolean.interpretation,
and unpacks the m * k output bits into (i : Fin m) → BitString k via BitString.block.
Instances For
Step 1: Input sharing via all-to-all point-to-point messages #
Point-to-point message round from p.1 to p.2 carrying Msg.
Instances For
Schedule of all-to-all point-to-point messages of type Msg.
Instances For
Execute point-to-point message rounds along L, accumulating received messages into st.2
and applying finish at .done.
Instances For
All-to-all message exchange: party s sends toSend s r to party r, and party i applies
finish i to the vector fun s => toSend s i of received messages.
Instances For
Received record for party i in round p = (s, r) constructed from party i's inbox
inbox_i : Fin m → Msg.
Instances For
Received transcript for party i along msgSchedule Msg L constructed from inbox_i.
Instances For
Step 2: Gate-by-gate circuit evaluation #
Extend a wire valuation w : Wire inputCount g → Bool with value lastBit on the new gate
Wire.gate (Fin.last g).
Instances For
Schedule for evaluating a single gate line : Line Boolean.signature inputCount g.
Constant and negation gates require no communication ([]); conjunction and disjunction gates
invoke sharedMulSpec m once.
Instances For
Step-by-step protocol for evaluating a single gate line : Line Boolean.signature inputCount g,
extending each party's wire valuation from Wire inputCount g → Bool to
Wire inputCount (g + 1) → Bool.
Instances For
Schedule for evaluating a straight-line program prog : Program Boolean.signature inputCount g.
Instances For
Step-by-step evaluation of prog : Program Boolean.signature inputCount g (Construction 7.5.10,
Step 2, p. 706, adapted to the De Morgan basis Boolean.signature).
Instances For
Deliver a single sharedMulSpec m oracle answer tuple ans as a 1-round Schedule.Received
transcript.
Instances For
Exact received-transcript sampler for a single gate line when the true wire values of p are
p.trace Boolean.interpretation x_flat.
Instances For
Exact received-transcript sampler for prog : Program Boolean.signature inputCount g on
flattened input x_flat.
Instances For
Step 3: Output share refresh and reconstruction #
Schedule for gathering Bool shares from every sender s ∈ S at receiver r.
Instances For
Extract party i's received bit in .message s r Bool.
Instances For
Gather Bool shares at receiver r from senders S, preserving st.1 and st.2.1 and
applying finish at .done.
Instances For
Sum of party i's received bits along gatherSchedule m r S.
Instances For
Deterministic received transcript along gatherSchedule m r S when sender s sends ans s.
Instances For
Schedule for refreshing and reconstructing a single output bit belonging to party r:
one sharedMulSpec m oracle call (an adaptation of Goldreich Construction 7.5.10 Step 3, p. 706,
that refreshes the output wire's shares for arbitrary Circuit.outputs) followed by m
point-to-point .message s r Bool rounds (including s = r).
Instances For
Refresh and reconstruct a single output coordinate coord = (r, j) : Fin m × Fin k
(adaptation of Goldreich Construction 7.5.10 Step 3, p. 706): invokes sharedMulSpec m on
(st.1 r j, constShare true s) to obtain fresh independent additive shares ans before sending
ans s from each party s to party r, which adds Pi.single j (∑ s, ans s) to its output
accumulator st.2 : BitString k. The extra sharedMulSpec m refresh allows C.outputs to
reference arbitrary wires (including input wires, negated wires, or repeated wires).
Instances For
Received transcript for coordSchedule m r when the refresh oracle returns ans.
Instances For
Exact received-transcript sampler for outCoordsSteps m k L on output table y.
Instances For
Schedule for Step 3 (Output Share Refresh and Reconstruction).
Instances For
Step 3 of gmwCircuitProtocol (adapting Goldreich Construction 7.5.10 Step 3, p. 706, with a
per-coordinate sharedMulSpec m share refresh so C.outputs can reference arbitrary wires):
extracts each party's shares of the m * k designated output wires C.outputs and runs
outCoordsSteps m k (outCoords m k).
Instances For
Exact received-transcript sampler for outputSteps m n k C when the circuit output is y.
Instances For
Coalition restriction and simulation helpers #
Complete schedule for gmwCircuitProtocol m n k C (Construction 7.5.10, p. 706, with Step 3
share refresh): Step 1 (inputShareSchedule m n), followed by Step 2 (progSchedule m C.program)
and Step 3 (outputSchedule m k).
Instances For
Construction 7.5.10 (Goldreich Section 7.5.2.3, p. 706; cf. Construction 7.3.9, pp. 646–647),
adapted to De Morgan circuits (Boolean.signature) and arbitrary C.outputs:
m-party Boolean circuit evaluation protocol in the sharedMulSpec m-hybrid model.
In Step 1, party i samples Fin n → Fin (m - 1) → Bool from sampleCoins i, applies
ProbComp.completeShares m (x i j) to form the m shares of bit j, and sends share r via
.message rounds. Step 2 evaluates C.program gate by gate, and Step 3 refreshes each output
coordinate via one sharedMulSpec m call (multiplying by constShare true) before exchanging the
refreshed output shares via .message rounds.
Instances For
Joint view sampler for gmwCircuitProtocol m n k C given full input tuple x and output tuple
y: samples Step 1 coins c, Step 2 gate transcripts r_prog, and Step 3 output transcripts
r_out independently.
Instances For
Output correctness of gmwCircuitProtocol: every outcome in the support of
(gmwCircuitProtocol m n k C).evalWith (sharedMulWorld m) x produces output tuple
circuitFunctionality m n k C x.
Simulator for gmwCircuitProtocol m n k C (Proposition 7.5.11, pp. 706–707; cf.
Proposition 7.3.10, pp. 647–648): extends the coalition's inputs xI and outputs yI by padding
honest parties outside I with 0, runs gmwCircuitRealViews on the extended tuples, and
restricts the resulting party views to I.
Instances For
Proposition 7.5.11 (Goldreich Section 7.5.2.3, pp. 706–707; cf. Proposition 7.3.10,
pp. 647–648), adapted to De Morgan circuits (Boolean.signature) and arbitrary C.outputs via
Step 3 share refresh: gmwCircuitProtocol m n k C perfectly and privately computes
Functionality.ofDeterministic (circuitFunctionality m n k C) in sharedMulWorld m against every
static coalition I : Finset (Fin m).