Eurocrypt 2024: Garbled Circuit Lookup Tables with Logarithmic Number of Ciphertexts

This blog post summarizes the talk by Lucien K. L. Ng about the paper “Garbled Circuit Lookup Tables with Logarithmic Number of Ciphertexts” at Eurocrypt 2024. The paper is co-authored by David Heath and Vladimir Kolesnikov.

The work presents a garbling gadget, useful for two-party secure computation via garbled circuits, that allows the computation of a secret table lookup with efficient communication cost.

While a naive approach to this gadget using Yao’s idea costs O(2n * κ * m) bits of communication for a n-bit to m-bit lookup table (for κ being the security parameter), the proposed approach only costs O(n * m * κ + 2n * m) bits. If you are familiar with garbled circuits, then note that the exponential cost that remains is no longer exponential in the size of the ciphertexts κ, and thus for typical parameters of κ=80 or κ=128, this is a sizable improvement.

While Lucien did not dive deep into the technical parts of the contribution, his talk provided a good overview of the main idea on how to achieve such a reduction in communication.

I like the AND/XOR circuit representation on the left 😃

We will start with a brief motivation. Why is it interesting to consider larger lookup tables for garbled circuits? First of all, the gate-by-gate paradigm of garbled circuits has historically split functions into gates, and considered the lookup table for each gate for the row-by-row encryption. The most natural size of these lookup tables was 4, to allow meaningful 2-ary operations on bit values. The resulting circuit constructions thus focused on costly AND or OR gates with cheap XOR and NOT gates. So a generalization of this paradigm already seems like a natural question.

Next, for certain applications that involve complicated, non-linear functions, representing this function as a lookup table instead of a formula of AND/XOR operations may give better metrics in practice. Such functions are non-linear activation functions that have been used in privacy-preserving machine learning. Further, it has been noted by this paper that functions like DES, SHA-2, floating point arithmetic or integer addition/multiplication can be compiled to smaller circuits if operations are 3 bit to 1 bit or 3 bit to 3 bit lookup tables compared to traditional AND/XOR circuits.
I want to stress however, that while the constants are small, a traditional AND/XOR circuit has still less communication than the work described here for small lookup tables.

The idea to achieve the reduction is composed of two steps.
From the one-hot vector evaluation gadget (from this paper, I highly recommend to read it), we know that computing a table lookup can be done with O(n*m*κ) communication with the caveat that the evaluator learns the index of the table lookup. The work presented at Eurocrypt can be viewed as fixing this issue by using the same technique but without leaking the table lookup index.

Without diving into the details, the one-hot vector gadget allows the evaluator to learn f(x) by evaluating the inner product of a one-hot encoded x and the truth-table of f. However, to allow for efficient communication, the evaluator must learn the position of the 1 in the one-hot vector, and thus learns x itself. Importantly, the evaluator also needs to learn the function’s truth-table.
Lucien first presents a masking attempt to hide the real index from the evaluator which he then shows how to make secure in a later part of the talk.
To mask the index, the garbler defines the function f’(x) = f(x + α) where α is a random fresh secret chosen by the garbler. Then, when the evaluator learns x+α during evaluation, it can evaluate f’(x+α) in the one-hot gadget to obtain the correct output and does not learn x, since it is masked by α. However, since f’ is now unknown to the evaluator, its description also needs to be communicated to it by the garbler. But unfortunately, the description of f’ inadvertently leaks α since the evaluator knows f! So this attempt is not secure.
As a fix and the main contribution of this work, the authors introduce half-hidden uniform functions. This gadget allows the garbler to mask the truth-table that needs to be sent in the approach described above in a way that the evaluator can no longer learn α.

More concretely, they set f’(x) = f(x + α) + r(x) where r is a uniform random function of appropriate size. Now learning a truth-table of f’, the evaluator can no longer recover α.
During evaluation, the evaluator learns x+α as above, the truth-table of f’ and also information to evaluate r(x). It then computes a one-hot gadget for the table lookup f’(x + α) to which it adds an evaluation of r(x).

Since f’(x+α) can be computed with O(n*m*κ) communication, the question becomes how to compute the random function r(x). To me, the technique feels similar to the one-hot gadget but instead of bits, the punctured tree is composed of truth-tables.
Holding the wire label of the first bit, the evaluator can compute the truth-table of the left or right half of the truth-table by hashing the label. The missing other half is received from the garbler in the form of two encrypted sums of labels that allow the evaluator to obtain exactly the missing half. This is a bit similar to the technique to obtain labels of nodes in the GGM tree that are close but not exactly on the punctured path used in the one-hot gadget.
While obtaining the other half of the truth-table poses no problem, the first half is leaked. The authors provide a way to mask the first half of the table with another half-hidden uniform function which is smaller (one bit less input). Therefore the procedure can be repeated recursively until the random function’s truth-table is just a single bit that can be hidden in the circuit at no cost by the garbler.

Of course, the above description and also the talk neglected many details that help reducing communication. For instance, the two encrypted sums per “level” in the recursion tree can be reduced to one by standard row reduction techniques. More techniques and details are found in the paper.

To conclude this blog, I want to remark that the table presented both in the slides and the paper that is shown below

provides a good overview over the gains. However, it is important to also consider a AND/XOR representation with the associated cost of said truth-table. For specific truth-tables, like the AES S-box this approach does not yield a better communication result (yet). While it may not be immediately practical for all kinds of table lookups, the result is a great big step into an exciting direction.