Instructor: Daniele Micciancio (UCSD)

Randomized Encodings

A Randomized Encoding for a class of functions F = {f:X -> Y} is defined by three efficient algorithms (encode,decode,simulate) such that

decode(encode(f,x,r)) = f(x)
simulate(f,f(x)) ~ {encode(f,x,r) | r <- R}

The last condition in the definition may be interpreted as equality, statistical closeness or computational indistinguishability of probability distributions.

Intuitively, encode maps a function f to a randomized function f'(x;r) = encode(f,x,r) that is equivalent to f in the sense that f(x) can be computed from f'(x;r), and the distribution f'(x;R) can be computer from f(x). Usually randomized encodings are used to turn an arbitrary function f into an easier to compute one f'.

Note: The first condition decode(encode(f,x,r)) = f(x) is usually interpreted as a correctness property, while the second one as a security property. We used a simulation based definition of security. One may also formulate the weaker indistinguishability requirement that for all f(x0) = f(x1), we have {encode(f,x0,r) | r <- R} ~ {encode(f,x1,r) | r <- R}.

Bootstrapping Functional Encryption

Randomized encodings can be used to expand the set of functions to which a functional encryption scheme (or other cryptographic primitive) can be applied to. Here we consider the application of randomized encoding to functional encryption.

Let (Setup',KDer',Enc',Dec') be a functional encryption scheme for a class of functions F', and (encode,decode,simulate) a randomized encoding mapping function f (in some set F) to a function f'(.,.) in F'. We define a new functional encryption scheme (Setup,KDer,Enc,Dec) as follows:

Setup() = Setup'()
KDer(sk,f) = KDer'(sk,encode(f,.,.))
Enc(pk,x) = { Enc'(pk,(x,r)) | r <- R }
Dec(fk,c) = decode(Dec'(fk,c))

Correctness is easy to check: for any keys (pk,sk) <- Setup() = Setup'(), we have

Dec(KDer(sk,f),Enc(pk,x)) = decode(Dec'(KDer'(sk,encode(f,.,.)),Enc'(pk,(x,r))))
                          = decode(encode(f,x,r)) = f(x)

What about security? We prove that if FE' is NA-SIM secure, then FE is also NA-SIM secure (using the standard, simulation-based, definition of randomized encoding.)

Questions:

Yao Garbled Circtuits

Building blocks:

Garbled circuits can be implemented using just a pseudorandom generator, but, conceptually, it is best to think of them as using the following two primitives:

Circuits

In order to define garbled circuits, and the associated randomized encoding, we need first to provide a formal definition of (boolean) circuit. We consider circuits with labeled wires W and gates G. For simplicity, we fix the set Y of output wire labels, and write In(C) for the input wires of a circuit C. Each circuit C computes a function from {0, 1}In(C) to {0, 1}Y. Circuits, their input wires and evaluation functions, are defined as follows:

Circuit Garbling

The garbling of a circuit C consists of

Garbled circuits are defined by induction on the circuit size as follows. For the base case, Garble(Id)=[(0, 0, 0)]w, i.e., rw = 0 and sw[0, 1][0, 1]=0 for all output wires w ∈ In(Id)=Y. (The value of sw is irrelevant, and may be defined arbitrarily.) For the inductive case, Garble(g/W/C) is computed as follows:

Randomized Encoding

The randomized encoding of C on input X[In(C)] is obtained by garbling the circuit (r, s, T)←Garble(C), computing aw = X[w]+rw for all w ∈ In(C), and producing the encoding encode(C)=({aw, zw}w ∈ In(C), T) where zw = sw[aw].

The decoding function uses the tables T to compute aw and zw = sw[aw] for all wires, and outputs the value decode(a, z, T)=[aw]w ∈ Y of the output wires. More specifically, in the base case C = Id, decode(a, z, []) = [aw]w ∈ Y can extract the output values directly from the input. In the inductive case (g/W/C), decode(a, z, T)

It can be easily verified by substitution and induction that the randomized encoding is correct, i.e., decode(encode(C, X)) = C(X) for any circuit C and input X.

Security

In order to prove security, we need to give a simulator such that for any circuit C and input X, simulate(C, C(X)) is computationally indistinguishable from encode(C, X). The simulator works similarly to the garbling/encoding procedure, but encrypting the same message in each entry of the tables. The base case C = Id is trivial: on input X[Y], the simulator outputs (X[i],0, 0) for all i ∈ In(C)=Y. In the inductive case, simulate(g/W/C, X[Y])

Notice that the main difference between the simulation procedure and encode(C, X) is that the four entries of the table Tg[x0][x1] encrypt the same message as Tg[ag0][ag1]. Since the keys kg[x0][x1] with (x0, x1)≠(ag0, ag1) are used only for encryption, and each is used only once, we may use the indistinguishability property of the one-time encryption scheme to let the simulator encrypt the same messages as the encoding procedure. Once that is done, by the security properties of the secret sharing scheme, one may replace the definition of zg0[¬ag1] and zg1[¬ag0] with (zg0[¬ag1],__)←Share(kg[ag0][¬ag1]) and (__, zg1[¬ag0]) ← Share(kg[¬ag0][ag1]). The output of the resulting program is identically to the encoding procedure. Formally, the proof of security consists of a hybrid argument that performs the above operations for the first n levels of recursion.