Friday, October 2, 2015

FAST GARBLING OF CIRCUITS UNDER STANDARD ASSUMPTIONS


Yao’s Garbled circuits provide a method to compute circuits based on double decryption where keys for double decryption are the random values assigned to the input of the gates. The output of double decryption is once again a random value assigned to one of the two possible outputs (0, 1) which may be further used as input to next gate. Many optimizations of Yao’s garbled circuits have then come up one of which is free XOR. Free XOR enables the computation of XOR gates for free and it involves no necessity of any cipher text corresponding to output.

Implementation of XOR gate [free XOR]

Lct Wi0 be a random value associated with input i
Wa0, Wb0R{0,1}n  Wc0 = Wa0 Wb0
Choose RR {0,1}n
Wa1= Wa0R, Wb1= Wb0R and  Wc1 = Wc0R

Correctness of “FREE XOR” by example

Let Wc1=Wa0Wb1
Wc1 = Wa0Wb0R
Wc1=Wc0R

Implementation of AND gates (Free - XOR)

We need a hash function to analyse the gates securely. Also we have to assign permutation bits Pa,Pb {0,1} for the inputs (a,b) associated with respect to AND gate.
Wa0 = <Ka0, Pa0> R {0,1} n+1
Wb0 = <Kb0, Pb0>R {0,1} n+1
Wc0 = <Kc0, Pc0> R {0,1} n+1
Choose R R {0,1}n
Wa1 = <Ka0R, Pa01>
Wb1 = <Kb0R, Pb01>
Wc1 = <Kc0R, Pc01>
The corresponding table entries T⊼(i,j)  Permutated over  Pai, Pbj,  i,j{0,1} will be
Tij   = H <Ka0 || Kb0 || g) Wc0
Tij   = H <Ka0 || Kb0 || g) Wc0
Tij   = H <Ka1 || Kb0 || g) Wc0
Tij   = H <Ka1 || Kb1 || g) Wc1
The above four entries pertain to garbled circuit K. The evaluator obtains Wcg(a,b) by   XORing the hash of the input keys given to him with corresponding  tuple in table  obtained by combination of Pai, Pbj .
This hash function is secure under circular secure correlation robustness or related key assumption

Garbled XOR with a single cipher text

The method is built using 4 PRF calls for garbling the circuit. Let the four inputs be Ki0, Ki1, Kj0, Kj1. Note that Ki1=Ki0+l  
Step 1 : Compute  ki0 = FKi(0,i)(g) and  kc1 = FK(1,i) (g)
Step 2 : Compute l=  ki0 ki1
Step 3 : Compute  kjj = FK(j,j)(g) and kj!j =  kjj + l
Step 4 : Compute output Kl0 =  ki0 kj0 and Kl1 = Kl0 ⊕△l
Step 5 : Consider if the input in Ki0 and Kj1. In such a case we cannot compute kj1 as it is function of K0j . This can be solved by providing a cipher text T= FK(!j,j)(g) kj!j . Now given Kj!j it is possible to compute kj!j as well. Not that (!j )is complement of   (j).

Reducing the number of PRF calls to Step 3

The output kj0 can be simply taken as Kj0 and the pseudo random function to compute  kj0 from Kj0 can be skipped. This reduces PRF calls from 4 to 3. Since  kj0= Kj0 , T0 entry of table T will be 0.

Algorithm to Implement XOR gates
1..  Set the output wire permutation bit for the ‘0’: l :=ij
2.  Compute translate keys for wire  i : Compute  ki0 = FKi(0,i)(g) and  kc1 = FK(1,i) (g)
3.  Compute new offset for the output wire l=   ki0 ki1
4 .  Compute translated keys for wire j and the ciphertext for this gate
          a.      If  j =0 , set  kj0 = FK(0,j)(g||0), kj1 = kj0 +l and T= FK(1,j)(g) kj1
           b.      If  j =1 , set  kj1 = FK(1,j)(g||0), kj0 = kj1 +l and T= FK(0,j)(g) kj0
      5.  Compute the keys for output wire l : Kl0 =  ki0 kj0 and Kl1 = Kl0 ⊕△l
      6.  Return (Kl0, Kl1,l,T)

Simple and Fast 4-2 garbled row reduction of non XOR gates

In previous section we removed one row of T representing garbled circuits, by setting one of the keys on the output wire to be actually K0, than using K0 to mask the output key. Here we improve by performing 4-2 reduction on cipher text for non-XOR gates. For case of understanding we explain the evaluation of gate first.
The gate evaluated, receives as input to gate, a table with two entries [T1, T2] and index I {0,1,2,3} and a value of Ki computed from the two garbled values of the input wire.
We compute Kout as follows
If i = 0 then Kout = K0
If i = 1 then   Kout = K1T1
If i = 2 then   Kout = K2T2
If i = 3 then   Kout =  K3T1T2
Let K[Ti] denote the output key with respect to ith row of table T. We have K[T0] = K0 because K0= K0T = K00. An AND gate has two possible outputs. If K0 is one output then we can consider K1K2K3 to be another possible output or vice versa.

Now we need to define K[T1], K[T2]  and K[T3]  and values of  T1, T2 and T3 correspondingly

If K[T1] = K0 then T1 = K0K1
                  else
If K[T1] = K1K2K3 then T1 = K2K3

If K[T2] = K0 then T2 = K0K2
                   else
If K[T2] = K1K2K3 then T2 = K1K3

K[T3] follow from values of T1 and T2 because T3 = T1T2 and K[T3] = K3T1T2
Since the evaluation can always compute T3 given T1 and T2, the table T can be reduced to two rows.

Following is the table for garbled circuit

S
Truth table
T1
T2
K0out
K1out
3
0001
K0 K1
K0 K2
K0
K1 K2 K3
2
0010
K0 K1
K1 K3
K0
K1 K2 K3
1
0100
K2 K3
K0 K2
K0
K1 K2 K3
0
1000
K2 K3
K1 K3
K1K2 K3
K0

Correctness

K[T3] = K3T1T2
               = K3(K1K[T1]) (K2K[T2])
               = K1K2K3 (K[T1])(K[T2])

If  K[T1] = K[T0] = Kor  K1 K2 Kthen  K[T3] is K1 K2 K3
If  K[T1] ≠ K[T0]  then surely K[T1] K[T2]  = K0 K1 K2 Kin which case            

K[T3]=K0

No comments:

Post a Comment