2. MARCO TEORICO
2.1 ANTECEDENTES DE LA INVESTIGACIÓN
In this section, we describe an algorithm that computes a proof, which is just composed of Groth-Sahai proofs, to verify whether a given garbled circuit is as computed by the garbled circuit generation algorithm from Section B.2.1.
Building over the tools built in the previous section, we will now express the garbled circuit construc- tion as a system of bilinear equations. Before that, we will describe the main variables used in the equations.
1. For every i ∈ {1, . . . , m}, b ∈ {0,1}, we have XLwi,b denote a vector of variables of length l. We
denote byXpkwi,b, a matrix of variables of sizel×l.
2. For every gateG,i, j∈ {0,1}andk= 1,2, we have matrices of variables namelyXcG,k (i,j) of dimension (l+ 1)×l,XctG,k (i,j) of dimension (l+ 1)×l,X∆G,k (i,j) of dimension 1×land XrG,k i,j of dimensionl ×l. 3. For every gate G, i, j ∈ {0,1} and k = 1,2, we have matrices of variables namely XctreRand,G,k
(i,j)
of dimension (l+1)×landXrreRand,G,k
i,j of dimensionl
×land a vector of variablesX∆reRand,G,k
i,j of dimension
1×l.
4. For every gate G and i, j ∈ {0,1}, we have XδG
i,j and XµGi,j, where XδGi,j and XµGi,j are vectors of
variables of length 2l.
We now describe the system of bilinear equations that captures the garbled circuit construction by Gentry et. al. We denote the system of equations byGCktEq(C).
GCktEq(C):
For every i∈ {1, . . . , m}, b∈ {0,1}:
PKEq(XLpkwi,b, XLwi,b) VecBitEq(XLwi,b)
For every gateGwith input wires w1, w2 and output wire w3, for all i, j∈ {0,1}:
VecCTEq(XcG,1 (i,j) , XL w1,i2, XrG,1i,j , XδG i,j),VecCTEq XcG,2 i,j , XL2 w2,j, XrG,2i,j ,(XµG i,j, XL2w3,G(i,j)) VecreRandCTEq(XctG,1 i,j , XctreRand,G,1 i,j , X∆reRand,G,1 i,j , XrreRand,G,1 i,j ) VecreRandCTEq(XctG,2 i,j , Xct reRand,G,2 i,j , X∆ reRand,G,2 i,j , Xr reRand,G,2 i,j ), VecBitEq(Xδi,j), VecBitEq(XµG i,j) VecBitEq(X∆reRand,G,1 i,j ) , VecBitEq(X∆reRand,G,2 i,j ), For every gateG:
PermEq(XctG
1, XctG2, XctG3, XctG4,(XcG1, XcG2, XcG3, XcG4)),
wherectG1 = (ctG,10,0,ct0,0G,2),. . . , ctG4 = (ctG,11,1,ct1,1G,2)) andcG1 = (cG,10,0, cG,20,0),. . . ,ctG4 = (cG,11,1, cG,21,1)). Letmbe the index of the output wire, we have
We now describe the procedure ProverMalGCwhich takes as input a garbled circuit along with the wire
keys and the randomness (used to generate the ciphertexts) and produces a proof that the garbled circuit is correctly computed. Additionally it also takes as input a CRS produced from theGSSetupphase, Before we describeProverMalGC, we describe the garbled circuit generation phase mainly to fix the notation to be
used inProverMalGC algorithm.
The garbled circuit generation phase, which we term asInpGen, takes as input a circuitC, an input to the circuit wand then does the following. It computes a garbled circuit corresponding to C according to the construction given in Section B.2.1. It first picks wire keysLwi,b for alli= 1, . . . , mandb= 0,1. Con-
struct the table of ciphertexts as follows as given in Section B.2. Each entry of the table, denoted by cG(i,j) corresponding to the gateG consists of two ciphertexts cG,1(i,j) =EncL(w1,i)(δ
G i,j) andc G,2 (i,j) =EncL(w2,j)(µ G i,j)
fori, j∈ {0,1} whereµGi,j = (L(w3,G(i,j))|0
l)⊕δG
i,j. Letc G,1 (i,j) andc
G,2
(i,j) be encrypted using randomness r G,1 i,j
andrG,2i,j respectively. For each gate in the circuit, the table of ciphertexts constructed need to be permuted. Consider a table corresponding to gateG. After permuting the table, we denote the entries in the table, in order, by
(ctG,10,0,ctG,20,0),(ctG,10,1,ctG,20,1),(ctG,11,0,ctG,21,0),(ctG,11,1,ctG,21,1)
. ForctG,ki,j , fori, j ∈ {0,1}, compute the following. For everya, bthciphertext inctG,ji , denoted byca,b, compute ∆(ca,b+ri,jG,kΦ)+(1−∆)(r
G,k
i,j Φ+ca,b)
to obtainc0a,b, which is (a, b)thciphertext inctreRandi,j ,G,k, by settingrGi,j,k = 0 (here 0 is interpreted as a vec- tor of zeroes of length 2l) and ∆(ctG,ki,j to be 1. For every gateG, we represent the table of ciphertexts, by TG, the vector
(ctreRand(0,0) ,G,1,ctreRand(0,0) ,G,2), . . . ,(ctreRand(1,1) ,G,1,ctreRand(1,1) ,G,2)
. Now, this completes the execution of the garbled circuit construction. Denote byGC, the set of the tablesTG, for every gate Gin the circuit.
Further, denote byinw, the input wires corresponding tow. More precisely, ifwis represented asb1· · ·bn,
wherebiis a bit, theninwis (Lw1,b1, . . . , Lwn,bn). We denote the garbled circuit byGC, with the wire keysinw
embedded into it, and the wire keys along with the randomness used to generate the ciphertexts to bewGC0 .
Procedure ProverMalGC((C,GC), w0GC, CRS):
1. It computes a system of bilinear equations GCktEq(C). It then assigns values to the variables in the equations so as to satisfy all the equations in GCktEq(C). Whenever we say that a tuple of elements A is assigned to a vector of variables XA, we mean that theith element in A is assigned to the ith
variable inXA 17.
(a) For every i ∈ {1, . . . , m}, b ∈ {0,1}, we assign pk0wi,b to XLpkwi,b, where pk 0
wi,b is the matrix pkwi,b, without the last column. Similarly, we assign Lwi,b to the variable XLwi,b.
(b) For everyi∈ {1, . . . , m}, b∈ {0,1}, we assign the lastl2+lbits ofL2w
i,bto the variable XL2wi,b.
(c) For every gate G, i, j ∈ {0,1} and k = 1,2, we assign cG,1(i,j),ctG,1(i,j) and rki,j to the variables XcG,1 (i,j) , XctG,1 (i,j) and Xrk i,j respectively.
(d) For every gate G, i, j∈ {0,1} and k= 1,2, we assign ct(i,j)reRand,G,k,∆reRand(i,j) ,G,k and ri,jreRand,G,k to the variablesXctreRand,G,k
(i,j) , X∆reRand,G,k (i,j) andXrreRand,G,k i,j respectively.
(e) For every gate G and i, j ∈ {0,1}, we assign δi,jG and µGi,j to the variables XδG
i,j and XµGi,j
respectively.
ProverMalGC then generates a proof Π by executing GSProveron input GCktEq(C), CRS and assign-
ment to the variables as described before.
17
We sometimes abuse the notation and assign a matrix of values to a vector of variables in the following way, where that the size of the matrix and the length of the vector is the same. LetAbe a matrix of sizem×n(mis the number of columns andnis the number of rows) and letXAbe a tuple of variables of sizeN, whereN =m×n. When we sayAis assigned to XA we mean that the (i, j)thvalue inAis assigned to (ni+j)thvariable inXA.
The procedure ProverMalGC finally outputs (comm,ΠGC).