Created by Beaver, Micali, and Rogaway in 1990, the BMR protocol is an multi-party computation (MPC) for boolean circuits for greater than 2 parties. It extends upon the core concept of Yao’s Garbled Circuits with its garbled tables and also carries a constant communication cost similar to Yao’s. Note that explanations online on the specifics of the protocol vary due to the more conceptual nature of the , so we will focus mostly on the explanation outlined . It is heavily recommended you read as a prerequisite.
Definitions
Let’s start with the basics: the definitions.
A wire sublabel for a given value, gate, and party:
wi,jb=(ki,jb,pi,jb)∈R{0,1}κ+1 w = the wire
b = the true value of the wire (0 or 1)
i = the unique wire ID
j = the unique party ID
k = the key to a given value of the wire (length κ)
p = the pointer bit of the given value of the wire (length 1)
Thus, the wire sublabel for a gate by a given party is a set of κ+1 random bits, κ of which are the key bits corresponding to a value and 1 of which is the pointer bit used later for shuffling the encrypted tables. Additionally note that the final wire label wib= wi,1b∣∣ wi,2b∣∣⋯∣∣ wi,n−1b∣∣ wi,nb, where 1 to n denote the parties.
More on Pointer Bits
Let’s expand some more on pointer bits. Each party holds a pointer bit share for a wire’s input value. Additionally, all parties’ pointer bit shares are XOR-ed together should create the final desired pointer bit for that wire input value. AKA pa0=pa,10⊕pa,20⊕pa,30⊕⋯⊕pa,n0 where pa0 is the pointer bit for input value 0 on wire a and 1 to n are the parties. Subsequently, the pointer bit for the opposite input value should be the opposite bit (AKA pa1=1−pa0 or pa1⊕pa0=1)
The pointer bits for a given gate with 3 wires a, b, and c Ii,j=(F(i,wi,j0),F(i,wi,j1),pi,j0,fi,j) I = the gate input
F = A pseudo-random function (PRF) defined as the following:
F:id,{0,1}κ+1↦{0,1}n⋅(κ+1) f = the flip bit
For each gate, the input for each party will be the two PRFs of the gate index with the sublabels corresponding to input of 0 or 1, the pointer bit of the true input value, and the flip bit (more on this later).
Naively encrypted row of table:
eva,vb=wcvcj=1..n⨁(F(i,wa,jva)⊕F(i,wb,jvb)) eva,vb = encrypted row on input values va and vb
va = value of input wire a
vb = value of input wire b
vc = value of output wire c
Note that the first subscript of the wires w also indicate the wire ID, where a and b refer to the input wires of a given gate and c refers to the output wire. Therefore, wcvc is the output label of wire c of true output value vc, while wa,jva is the sublabel for party j of input wire a with the true value va. This encrypted row is a naive implementation not including the use of flip bits to further secure the encryption.
Creating the Garbled Table Naively
Let’s take another look at the formula to naively creating the encrypted rows of our gate tables from the previous section:
eva,vb=wcvcj=1..n⨁(F(i,wa,jva)⊕F(i,wb,jvb)) With the 4 possible permutations of va and vb , we get the 4 rows as follows for an AND gate:
e0,0e0,1e1,0e1,1=wc0⊕[F(i,wa,10)⊕F(i,wb,10)]⊕⋯⊕[F(i,wa,n0)⊕F(i,wb,n0)]=wc0⊕[F(i,wa,10)⊕F(i,wb,11)]⊕⋯⊕[F(i,wa,n0)⊕F(i,wb,n1)]=wc0⊕[F(i,wa,11)⊕F(i,wb,10)]⊕⋯⊕[F(i,wa,n1)⊕F(i,wb,n0)]=wc1⊕[F(i,wa,11)⊕F(i,wb,11)]⊕⋯⊕[F(i,wa,n1)⊕F(i,wb,n1)] Note that the output labels are defined as such as well:
wc0wc1=wc,10∥⋯∥wc,n0∥pc0=wc,11∥⋯∥wc,n1∥pc1 Similar to Yao’s, we now “garble” the table. For example, if pa0=1, pb1=0 meaning pa1=0, pb0=1, our table is shuffled as so:
Now, this is the naive way to create a garbled encrypted table; however, a major flaw that exposes the input values to the evaluator can occur. To prevent this information from being leaked, we use “flip bits.”
TODO(ashjeong): Add explanation of a possible attack for this naive case.
Creating the Garbled Table Securely with Flip Bits
Flip bits obscure the true input values for the evaluator. Similar to pointer bits, each party creates their own flip bit share for each wire such that for a given wire, the total flip bit is or all flip bit shares XOR-ed together. Since wire labels and PRF functions result in random strings that are consistent across a binary value, switching the correlations of said labels to their opposite value is fine. Therefore, we instead encrypt rows of the encrypted table while obscuring input values with flip bits as shown below:
eva,vb=wcvc⊕fcj=1..n⨁(F(i,wa,jva⊕fa)⊕F(i,wb,jvb⊕fb)) Ex. fa=0, fb=1, fc=1 for an AND gate:
e0,0e0,1e1,0e1,1=wc0⊕1⊕[F(i,wa,10⊕0)⊕F(i,wb,10⊕1)]⊕⋯⊕[F(i,wa,n0⊕0)⊕F(i,wb,n0⊕1)]=wc0⊕1⊕[F(i,wa,10⊕0)⊕F(i,wb,11⊕1)]⊕⋯⊕[F(i,wa,n0⊕0)⊕F(i,wb,n1⊕1)]=wc0⊕1⊕[F(i,wa,11⊕0)⊕F(i,wb,10⊕1)]⊕⋯⊕[F(i,wa,n1⊕0)⊕F(i,wb,n0⊕1)]=wc1⊕1⊕[F(i,wa,11⊕0)⊕F(i,wb,11⊕1)]⊕⋯⊕[F(i,wa,n1⊕0)⊕F(i,wb,n1⊕1)] If the flip bit of a wire is 0 such as for wire a shown above, the wire sublabels refer to their corresponding input value (e.g. wa,11 refers to input value 1). Else, if the flip bit is 1 as in wire b above, the wire sublabel refers to the opposite input value (e.g. wb,10 refers to input value 1).
Flip bits introduce more constrained chaos to prevent values from being exposed. Only 4 possible label permutations of each wire a, b, and c for its 4 possibilities of input values exist when not using flip bits, yet with its inclusion, the total number of label permutations jumps to 32. Take a look below showing off all possible label permutations for a single input case of a AND gate where the inputs are 1.
BMR Protocol Summary
All Parties:
Create their own keys for all possible wires values
Create their own pointer bit shares for each wire value (1 for each wire since the other can be simply calculated)
Create their own flip bit shares for each wire
For n-MPC:
Receive parties’s private input bits
Receive MPC inputs of each party Ii,j
For each gate
Compute total flip bits f for each wire
Compute total pointer bits p for each wire value
One party who is set to be the evaluator:
Receive the garbled tables and active wire labels
Evaluate garbled circuit re-creating the garbled inputs themselves
References