# Patent

## Title
Bootstrappable homomorphic encryption method, computer program and apparatus

## Abstract

Embodiments of the present invention describe a fully homomorphic encryption scheme using a “bootstrapable” homomorphic encryption scheme that evaluate a function ƒ when ƒ is the encryption schemes own decryption function. Specifically, the fully homomorphic encryption scheme uses the “bootstrapable” homomorphic encryption scheme to determine the decryption function to decrypt data encrypted under the fully homomorphic encryption scheme.

## Background
CROSS REFERENCE TO RELATED APPLICATIONS
This application claims the benefit of PPA Ser. No. 61/259,796, filed Nov. 10, 2009 by the present inventor, which is incorporated by reference.
This application is related to “A Fully Homomorphic Encryption Method Based on a Bootstrappable Encryption Scheme, Computer Program and Apparatus”, Ser. No. 12/590,584. That application, also filed on Nov. 10, 2009 by the present inventor, describes and claims a method to transform a bootstrappable encryption scheme into a fully homomorphic encryption scheme, but it does not claim a bootstrappable encryption scheme or a fully encryption scheme. Roughly speaking, the present application claims and describes (among other things) a bootstrappable encryption scheme, and also claims a fully homomorphic encryption scheme (which became possible once a bootstrappable encryption scheme was constructed). These comments are meant only to sketch how the subject matters of the two applications differ, and are not meant to be limiting.


STATEMENT OF GOVERNMENTAL SUPPORT
This invention was made with Government support under contract CNS-0715739 awarded by the National Science Foundation. The Government has certain rights in this invention.


FIELD OF THE INVENTION
This invention relates generally to encryption and decryption algorithms and apparatus and, more specifically, to homomorphic encryption algorithms and apparatus.
BACKGROUND OF THE INVENTION
A fully homomorphic encryption scheme allows the computation of arbitrary functions over encrypted data without requiring the use of a decryption key. However, actually constructing a fully homomorphic encryption scheme was a major open problem in cryptography for over 30 years, since 1978. This application will describe (among other things) a bootstrappable homomorphic encryption scheme, which can be used to construct (the first) fully homomorphic encryption scheme. However, first we provide some background.
A (regular) (public-key) encryption scheme allows for the encryption and decryption of data. More formally, a public-key encryption scheme has three procedures: KeyGen, Encrypt and Decrypt. A user uses the KeyGen procedure to generate its secret and public keys sk and pk, and it publishes its public key pk so that other parties can easily obtain it. Later, when a sender wants to send an encrypted message m to the user, the sender computes a ciphertext using the Encrypt procedure with the user's public key: c←Encrypt(pk, m). The user uses its secret key to recover the message from the ciphertext m←Decrypt(sk, c).
A homomorphic encryption scheme has all of the properties of a regular encryption scheme. However, it also allows anyone to modify what it is encrypted, even without the secret key. For example, an additively homomorphic encryption scheme allows anyone to do the following. Suppose ciphertext c1 encrypts the message m1 under public key pk, and ciphertext c2 encrypts the message m2 under pk. Then, given c1, c2, and pk, anyone can compute a ciphertext c that encrypts m1+m2 under pk. When we say “anyone” can do this, we mean in particular that the new ciphertext c can be computed efficiently without knowing sk. (Of course, computing c with sk is easy: using sk, one can use Decrypt to recover m1 and m2 from c1 and c2, and then one can set c←Encrypt(pk, m1+m2).) A multiplicatively homomorphic encryption scheme allows anyone to use c1, c2, and pk to compute a ciphertext c that encrypts m1×m2 under pk.
The essence of a fully homomorphic encryption (FHE) scheme is that it allows any function of the data or messages to be evaluated, while this data remains encrypted—not merely the addition function or the multiplication function. More formally, given ciphertexts that encrypt π1, . . . , πt, fully homomorphic encryption should allow anyone (not just the key-holder) to output a ciphertext that encrypts ƒ(π1, . . . , πt) for any desired function ƒ, as long as that function can be efficiently computed. No information about π1, . . . , πt or ƒ(π1, . . . , πt), or any intermediate plaintext values, should leak; the inputs, output and intermediate values are always encrypted. More specifically, in addition to the usual algorithms KeyGen, Encrypt, and Decrypt of an encryption scheme, a fully homomorphic encryption scheme ε also has an efficient algorithm Evaluateε that, for any valid public key pk, any circuit C (which represents the function ƒ that you want to be computed), and any ciphertexts ψi←Encryptε(pk, πi), outputs

ψ←Evaluateε(pk,C,ψ1, . . . ,ψt),

a valid encryption of C(π1, . . . , πt) under pk. By a valid encryption of C(π1, . . . , πt) under pk, we mean that Decrypt(sk, ψ)=C(π1, . . . , πt). We say that an encryption scheme is fully homomorphic if Evaluate works correctly for any circuit C. That is, for any function ƒ that can be performed efficiently on unencrypted data (and it was already well-known that such a function can be computed efficiently via a boolean circuit C), that function can be performed efficiently on encrypted data, as long as the data is encrypted with an encryption scheme that is fully homomorphic.

One might say that a homomorphic encryption scheme is “malleable”, in the sense that the plaintext data can be modified while it is encrypted, while it is “inside the encryption box”. A useful, readable reference on homomorphic encryption is the article by Craig Gentry, “Computing Arbitrary Functions of Encrypted Data”, in the March 2010 issue of Communications of the ACM, available online here: http://crypto.stanford.edu/craig/easy-fhe.pdf. This article uses a physical analogy to describe homomorphic encryption. Encryption is like a lockbox: the sender puts his data inside a box for which only the user has a key, and then he sends the lockbox to the user; the user “decrypts” by unlocking the box. Homomorphic encryption is like a locked glovebox. It is like a lockbox in the sense that once something is locked inside, only the user with the secret key can remove it. However, the gloves allow anyone to manipulate or “process” objects while they remain securely inside a box.
Why is homomorphic encryption desirable, why would you want to let ciphertexts be malleable so that anyone can modify what is encrypted? Essentially, the answer is that there are many settings where you might want to let someone else process your data, but you don't want to give away access to your data—i.e., you want to keep your data private. Consider a search engine query (e.g., a Google search). You might like to get a response from Google, without revealing to Google exactly what your query is. If you have a fully homomorphic encryption scheme, this actually becomes possible. Suppose (the bits of) your query is π1, . . . , πt. You run KeyGen to get a key-pair (sk, pk) and you encrypt these bits under pk using the encryption scheme to get some ciphertexts ψ1, . . . , ψt that you send to Google. Now suppose that Google agrees to use fully homomorphic encryption to process encrypted queries. Google has some function ƒ, which can be represented as a boolean circuit C, that it uses to respond to queries. (This function ƒ depends on the bits of the query, on the bits of the (huge amount of) data that Google has on its servers, and on the particular algorithm that Google uses to respond to searches.) Google simply runs ψ←Evaluateε(pk, C, ψ1, . . . , ψt), and sends c to the user. (In practice, the response may consist of more than one ciphertext; in particular, it will if C has more than one output wire.) Finally, the user obtains C(π1, . . . , πt)←Decrypt(sk, ψ), which is exactly the response that it wanted from Google. But, due to the encryption, Google never learns any information about the query that it answered! Fully homomorphic encryption is also very useful in many cloud computing settings.
The notion of fully homomorphic encryption has been known for a long time. In 1978, Rivest, Adleman and Dertouzous suggested that such a scheme may be possible, referring to the notion as a privacy homomorphism, and they suggested some possible schemes, but these schemes were quickly found to be insecure—i.e., the ciphertexts did not actually hide the message well. (See R. Rivest, L. Adleman, and M. Dertouzos, “On data banks and privacy homomorphisms”, in Foundations of Secure Computation, pages 169-180, 1978.) Since that time, it has been a major open problem in cryptography to find a secure fully homomorphic encryption scheme.
(The notion of a “provably secure” encryption scheme will be known to those well-versed in the art, but may be a bit mysterious to outsiders. Roughly speaking, in modern cryptography, one is expected to prove that the security of a proposed cryptosystem is based on an established problem that is believed to be hard. For example, one might prove a statement like the following: if there is an attacker that can efficiently break this cryptosystem, then this attacker can be used as a subroutine to make an efficient algorithm that factors very large integers into their prime factors. Since it is widely assumed that no efficient algorithm for factoring large numbers exists, the above statement proves that the scheme is secure, under the assumption that factoring is “hard”. There are, of course, many other problems that are assumed to be hard, besides factoring.)
In the prior art, there have been provably secure encryption schemes that are partially homomorphic. For example, there are encryption schemes that are additively homomorphic. There are also schemes that are multiplicatively homomorphic. However, there are no schemes that are fully homomorphic. Unfortunately, if you have an encryption scheme that is only (say) additively homomorphic, it cannot be used (for example) to enable an encrypted Google search as described above, because Google's search function will be quite complicated, certainly not (even close to being) expressible by a sequence of addition operations. The same is true of encryption schemes that are only multiplicatively homomorphic (and not homomorphic over addition).
The cryptographic literature on homomorphic encryption is quite extensive, and indicative of how important the open problem of fully homomorphic encryption was. In fact, the first public-key encryption scheme, called RSA for its authors (R. Rivest, A. Shamir, and L. Adleman. A method for obtaining digital signatures and public-key cryptosystems. In Comm. of the ACM, 21:2, pages 120-126, 1978), was multiplicatively homomorphic: given an RSA public key (N, e) and ciphertexts c1=me1 mod N, . . . , ct=mte mod N, one can compute c=Πi=1t ci mod N=(Πi=1i mi)e mod N, a ciphertext that encrypts the product of the original plaintexts. (Possibly, this multiplicative homomorphism of RSA awakened Rivest, Adleman and Dertouzous to the notion of fully homomorphic encryption.) The first partially (additively in this case) homomorphic encryption scheme with a desirable property called “semantic security” against chosen plaintext attacks was by Goldwasser and Micali, “Probabilistic encryption and how to play mental poker keeping secret all partial information”, Proc. 14th Symposium on Theory of Computing: 365-377.
It is known that one can construct additively homomorphic encryption schemes from lattices or linear codes. The lattice-based scheme and the Reed-Solomon-code-based scheme allow multiplications, though with exponential expansion in ciphertext size. Ciphertexts implicitly contain an “error” that grows as ciphertexts are added together. Thus, ciphertexts output by Evaluate do not have the same distribution as ciphertexts output by Encrypt, and at some point the error may become large enough to cause incorrect decryption. For this reason, the homomorphism is sometimes referred to as a “pseudohomomorphism” or a “bounded homomorphism”.
There are schemes that use a singly homomorphic encryption scheme to construct a scheme that can perform more complicated homomorphic operations (T. Sander, A. Young, and M. Yung. Non-interactive cryptocomputing for NC1. In Proc. of FOCS '99, pages 554-567, 1999, and Y. Ishai and A. Paskin. Evaluating Branching Programs on Encrypted Data. In Proc. of TCC '07. Sanders, Young and Yung (SYY) show that one can use a circuit-private additively homomorphic encryption scheme to construct a circuit-private scheme that can handle arbitrary circuits, where the ciphertext size increases exponentially with the depth of the circuit. Their scheme may, therefore, feasibly evaluate NC1 circuits. Ishai and Paskin show how to evaluate branching programs, and with much smaller ciphertexts than SYY. In their scheme Evaluate outputs a ciphertext whose length is proportional to the length of the branching program. This remains true even if the size of the branching program is very large, e.g., super-polynomial. However, the computational complexity of their scheme is proportional to the size.
In more detail, Ishai and Paskin use a “leveled” approach to evaluate a branching program. A (deterministic) branching program (BP) P is defined by a DAG from a distinguished initial node in which each nonterminal node has two outgoing edges labeled 0 and 1, and where the terminal nodes also have labels.
Cryptographers have accumulated an assortment of applications for fully homomorphic encryption since then. However, until now, there was no viable construction of a fully homomorphic encryption scheme. In fact, previous homomorphic encryption schemes could compute only very simple functions.
SUMMARY
The foregoing and other problems are overcome by the use of the exemplary embodiments of this invention.
This specification describes in part the first fully homomorphic encryption scheme, solving a central open problem in cryptography proposed by Rivest et al. in 1978. To construct a fully homomorphic encryption scheme, we use a steppingstone: we construct a “somewhat homomorphic” (i.e., not “fully homomorphic”) encryption scheme that has a special property called bootstrappability. This bootstrappable somewhat homomorphic encryption scheme cannot immediately, by itself, correctly evaluate any circuit homomorphically (as a fully homomorphic scheme could), but it can evaluate a very important circuit—namely, the circuit corresponding to the decryption algorithm of the bootstrappable encryption scheme itself. (Strictly speaking, the bootstrappable encryption scheme can evaluate a function that is slightly more complex than its own decryption function.) This self-referential property of the bootstrappable encryption scheme turns out to be very useful—in particularly, by using a recursive self-embedding of the bootstrappable encryption scheme, we can obtain a fully homomorphic encryption scheme. The above description is just a sketch of the idea; more precise details are given in the Detailed Description.
So, a bootstrappable encryption scheme is very useful; it can be used to construct a fully homomorphic encryption scheme. Our somewhat homomorphic encryption scheme is also useful “on its own”. As mentioned above, previous homomorphic encryption schemes could evaluate only very simple functions homomorphically. However, our somewhat homomorphic scheme is able to compute (multivariate) polynomials of fairly high degree homomorphically.
In one embodiment, our somewhat homomorphic encryption scheme uses ideal lattices. However, other embodiments are possible.
In a first aspect thereof the exemplary embodiments of this invention provide a method that comprises receiving a plurality of ciphertexts that encrypt information under a public key of a bootstrappable homomorphic encryption scheme; and applying the Evaluate function of the bootstrappable homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.
In a further aspect thereof the exemplary embodiments of this invention provide a method that comprises receiving a plurality of ciphertexts that encrypt information under a public key of a homomorphic encryption scheme, where the homomorphic encryption scheme is operable to compactly evaluate the addition of two values and also operable to compactly evaluate a multiplication of two values, where the homomorphic encryption scheme uses public key information and secret key information, and includes an encryption function, a decryption function and an evaluation function, where the secret key information in the homomorphic encryption scheme comprises a secret representation of an algebraic ideal in a ring, where the encryption function takes input comprising first information and outputs second information comprising an element of the ring that is in a coset of the algebraic ideal, where the distribution of coset conditioned on the first information has high min-entropy, where the decryption function operates to decrypt data encrypted under the certain public key by using at least the secret representation of the algebraic ideal in the secret key information; and applying the Evaluate function of the homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.
In a further aspect thereof the exemplary embodiments of this invention provide a program storage device readable by a machine and tangibly embodying a program of instructions executable by the machine for performing operations that comprise receiving a plurality of ciphertexts that encrypt information under a public key of a bootstrappable homomorphic encryption scheme; and applying the Evaluate function of the bootstrappable homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.
In a further aspect thereof the exemplary embodiments of this invention provide a program storage device readable by a machine and tangibly embodying a program of instructions executable by the machine for performing operations that comprise receiving a plurality of ciphertexts that encrypt information under a public key of a homomorphic encryption scheme, where the homomorphic encryption scheme is operable to compactly evaluate the addition of two values and also operable to compactly evaluate a multiplication of two values, where the homomorphic encryption scheme uses public key information and secret key information, and includes an encryption function, a decryption function and an evaluation function, where the secret key information in the homomorphic encryption scheme comprises a secret representation of an algebraic ideal in a ring, where the encryption function takes input comprising first information and outputs second information comprising an element of the ring that is in a coset of the algebraic ideal, where the distribution of coset conditioned on the first information has high min-entropy, where the decryption function operates to decrypt data encrypted under the certain public key by using at least the secret representation of the algebraic ideal in the secret key information; and applying the Evaluate function of the homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.
Follow-on Work
Since the present inventor's announcement of the first fully homomorphic encryption scheme (Craig Gentry, “Fully homomorphic encryption using ideal lattices”, in ACM Symposium on Theory of Computing (STOC) 2009, pages 169-178), there has been considerable follow-on work. Most notably the scheme has been implemented by different teams of researchers. See Nigel P. Smart and Frederik Vercauteren, “Fully Homomorphic Encryption with Relatively Small Key and Ciphertext Sizes”, in 13th International Conference on Practice and Theory in Public Key Cryptography (PKC), pages 420-443. See also Craig Gentry and Shai Halevi, “Implementing Gentry's Fully Homomorphic Encryption Scheme”, available at http://eprint.iacr.org/2010/520.


DETAILED DESCRIPTION
1 Introduction
We propose a solution to the old open problem of constructing a fully homomorphic encryption scheme. This notion, originally called a privacy homomorphism, was introduced by Rivest, Adleman and Dertouzous (R. Rivest, L. Adleman, and M. Dertouzos, “On data banks and privacy homomorphisms”, in Foundations of Secure Computation, pages 169-180, 1978) shortly after the invention of RSA by Rivest, Shamir, and Adleman (R. Rivest, A. Shamir, and L. Adleman, “A method for obtaining digital signatures and public-key cryptosystems”, in Comm. of the ACM, 21:2, pages 120-126, 1978). Basic RSA is a multiplicatively homomorphic encryption scheme—i.e., given RSA public key pk=(N, e) and ciphertexts {ψi←πie mod N}, one can efficiently compute Πi ψi=(Πi πi)e mod N, a ciphertext that encrypts the product of the original plaintexts. One imagines that it was RSA's multiplicative homomorphism, an accidental but useful property, that led Rivest, Adleman and Dertouzos to ask a natural question: What can one do with an encryption scheme that is fully homomorphic: a scheme ε with an efficient algorithm Evaluateε that, for any valid public key pk, any circuit C (not just a circuit consisting of multiplication gates as in RSA), and any ciphertexts ψi←Encryptε(pk, πi), outputs

ψ←Evaluateε(pk,C,ψ1, . . . ,ψt)

a valid encryption of C(π1, . . . , πt) under pk? Their answer: one can arbitrarily compute on encrypted data—i.e., one can process encrypted data (query it, write into it, do anything to it that can be efficiently expressed as a circuit) without the decryption key. As an application, they suggested private data banks. A user can store its data on an untrusted server in encrypted form. Later, it can send a query on the data to the server, whereupon the server can express this query as a circuit to be applied to the data, and use the Evaluateε algorithm to construct an encrypted response to the user's query, which the user then decrypts. We obviously want the server's response here to be more concise than the trivial solution, in which the server just sends all of the encrypted data back to the user to process on its own.

Cryptographers have accumulated a long assortment of “killer” applications for fully homomorphic encryption since then. (See Subsection 1.8.) However, until now, we did not have a viable construction.
1.1 A Very Brief and Informal Overview of Our Construction
Imagine you have an encryption scheme with a “noise parameter” attached to each ciphertext, where encryption outputs a ciphertext with small noise—say, less than n—but decryption works as long as the noise is less than some threshold Nn. Furthermore, imagine you have algorithms Add and Mult that can take ciphertexts E(a) and E(b) and compute E(a+b) and E(a*b), but at the cost of adding or multiplying the noise parameters. This immediately gives a “somewhat homomorphic” encryption scheme that can handle circuits of depth roughly log log N−log log n.
Now suppose that you have an algorithm Recrypt that takes a ciphertext E(a) with noise N′<N and outputs a “fresh” ciphertext E(a) that also encrypts a, but which has noise parameter smaller than √{square root over (N)}. This Recrypt algorithm is enough to construct a fully homomorphic scheme out of the somewhat homomorphic one! In particular, before we Add or Mult E(a) and E(b), we can apply Recrypt to E(a) and E(b) to ensure that their noise parameters are small enough so that the noise parameter of E(a*b) is less than N, and so on recursively.
In our construction, we give a somewhat homomorphic encryption scheme. We then show how to modify it so that its decryption circuit has multiplicative depth at most log log N−log log n−1—i.e., less depth than what the scheme can handle. It turns out that a somewhat homomorphic encryption scheme that has this self-referential property of being able to handle circuits that are deeper than its own decryption circuit—in which case we say the somewhat homomorphic encryption scheme is “bootstrappable”—is enough to obtain the Recrypt algorithm, and thereby fully homomorphic encryption! In Section 1.3 and Section 4, we give more details on why bootstrappability is enough.
Our embodiment of our somewhat homomorphic encryption scheme, described in Sections 5 and 7, uses “ideal lattices”. However, in our exposition, we try to defer the need for technical details about lattices for as long as possible and we first describe it abstractly to clarify the high-level idea and show that other embodiments are possible. For now, we mention that we looked to ideal lattices as a way to construct a bootstrappable encryption scheme for two reasons. First, the circuit complexity of the decryption algorithms in typical lattice based encryption schemes is very low, especially compared to schemes like RSA or ElGamal, which rely on exponentiation, an operation that we do not know how to parallelize well. Second, since ideal lattices correspond to ideals in polynomial rings, they inherit natural Add and Mult operations from the ring. (Additionally, ideal lattices are also appealing since we can base security on standard “hard” problems over ideal lattices, which, as far as we know, are typically just as hard as problems over general lattices.)
However, it takes some work to make our somewhat homomorphic scheme bootstrappable—i.e., to make the depth of decryption circuit shallower than what the scheme can handle. In Sections 8 and 10, we describe how to modify the scheme to make the decryption circuit sufficiently shallow. Conceptually, our techniques here are similar to those used in server-aided cryptography, where (for example) a user with a slow device wants to delegate most of the decryption work to a server without allowing the server to completely decrypt on its own. In our modification, we place a “hint” about the secret key inside the public key. This hint is not enough to decrypt a ciphertext output by the original scheme, but it can be used to “process” the ciphertext—i.e., construct a new ciphertext (that encrypts the same thing) that can be decrypted by a very shallow circuit. To prove that this hint is not too revealing, we require a second computational hardness assumption, similar to ones that have been studied in the context of server-aided cryptography.
Just to leave you with a flavor of what our somewhat homomorphic encryption scheme looks like, consider the following secret key encryption scheme which merely uses integers. The key is an odd integer p>2N. An encryption of a bit b is simply a random multiple of p, plus a random integer B with the same parity as b—i.e., B is even if b=0 and is odd if b=1. A bit more concretely, the ciphertext is c=b+2x+kp, where x is a random integer in (−n/2, n/2), and k is an integer chosen from some range. You decrypt by setting b←(c mod p) mod 2, where (c mod p) is the number in (−p/2,p/2) that equals c modulo p. Actually, (c mod p), which is the “noise parameter” in this scheme, will be in [−n, n], since b+2x is in that range. However, decryption would have worked correctly as long as b+2x ∈[−N, N]⊂(−p/2,p/2). (As an aside relevant to bootstrapping, we mention that computing c mod p can be done by a very shallow circuit, with depth logarithmic in the bit-lengths of c and p.)
Now consider what happens when you add two ciphertexts. You get a ciphertext that has a similar format to the original ones. Specifically,

c←c1+c2=b1+b2+2(x1+x2)+(k1+k2)p=b1⊕b2+2x+kp 

for some integers x and k. Decryption recovers b1⊕b2 as long as (b1+2x1)+(b2+2x2)∈[−N, N]. Multiplication also gives ciphertexts with a similar format.

c←c1*c2=b1*b2+2(b1x2+b2x1+2x1x2)+kp=b1*b2+2x+kp 

for some integers x and k. Decryption works whenever (b1+2x1)*(b2+2x2)∈[−N, N].

A crucial advantage of replacing integers in the scheme above with ideal lattices is that an ideal lattice has many representations or “bases”. Some bases are “good” and can be used as the secret key, while some are “bad” and can be used as the public key—i.e., they are good enough to be used for encryption, but not decryption. So, ideal lattices give us a public key scheme. On the other hand, it is unclear whether the integer p in the toy scheme above can be represented in a way that is useful for encryption but not decryption (nor is security clear even for the secret key version of the scheme).
But, for a moment, imagine that there are good and bad representations of p, such the bad representation can be used in encryption but cannot be used to distinguish whether an integer is close to a multiple of p or is uniform modulo p. How would we prove security? If there is an adversary  that can break semantic security,  uses  to decide which distribution an integer m comes from as follows: give  the challenge ciphertext c=b+2m+kp for random k. If m is close to a multiple of p, then so is 2m, and the closest p-multiple is an even distance away; in particular, b+2m∈[−N, N] mod p and b+2m mod p=b, the challenge ciphertext decrypts correctly to b, and  should guess b with non-negligible advantage. But if m is uniform modulo p, then so is 2m (since p is odd), c is independent of b, and  has no advantage. Basically,  can distinguish the distribution that m came from by observing whether  guesses correctly with non-negligible advantage. In Section 5, we provide a conceptually similar proof of our ideal lattice scheme based on the ideal coset problem (ICP).
Over the next few Subsections, we provide more details about our construction, its security and applications, but still somewhat informally.
1.2 What is Fully Homomorphic Encryption?
Our ultimate goal is to construct a fully homomorphic encryption scheme ε. First, let us discuss what it means to be fully homomorphic.
At a high-level, the essence of fully homomorphic encryption is simple: given ciphertexts that encrypt π1, . . . , πt, fully homomorphic encryption should allow anyone (not just the key-holder) to output a ciphertext that encrypts ƒ(π1, . . . , πt) for any desired function ƒ, as long as that function can be efficiently computed. No information about π1, . . . , πt or ƒ(π1, . . . , πt), or any intermediate plaintext values, should leak; the inputs, output and intermediate values are always encrypted.
Formally, there are different ways of defining what it means for the final ciphertext to “encrypt” ƒ(π1, . . . , πt). The minimal requirement is correctness. A fully homomorphic encryption scheme ε should have an efficient algorithm Evaluateε that, for any valid ε key pair (sk, pk), any circuit C, and any ciphertexts ψi←Encryptε(pk, πi), outputs

ψ←Evaluateε(pk,C,ψ1, . . . ,ψt)such that Decryptε(sk,ψ)=C(π1, . . . ,πt)

This minimal requirement does not seem to be sufficient, however, since it permits the trivial solution, where ψ simply consists of (C, ψ1, . . . , ψt)—i.e., where the Evaluateε algorithm does not “process” the input ciphertexts at all.

There are a couple of different ways of excluding the trivial solution. One way is to require circuit privacy—i.e., (roughly) that the output of Evaluateε reveals nothing (at least computationally) about the circuit C that it took as input. If circuit privacy is the only additional requirement, then fully homomorphic encryption (under this definition) can easily be achieved by using a two-flow oblivious transfer (OT) protocol in combination with Yao's garbled circuit (A. C. Yao, “Protocols for secure computations (extended abstract)”, FOCS '82, pages 80-91). Typically two-flow OT protocols use an additively homomorphic encryption scheme, and the OT query consists of a ciphertext ψ in this encryption scheme. In the fully homomorphic scheme, Evaluate(pk, C, ψ1, . . . , ψt) constructs a Yao garbling C† of C, uses the OT queries ψ1, . . . , ψt to construct OT responses ψ*1, . . . , ψ*t designed to obliviously transfer Yao keys associated to the t input wires in C†, and outputs (C†, ψ*1, . . . , ψ*t). To decrypt this ciphertext, the key holder “decrypts” the OT responses ψ*1, . . . , ψ*t to recover Yao keys for the input wires, and then evaluates the garbled circuit. Sanders, Young and Yung (T. Sander, A. Young, and M. Yung, “Non-interactive cryptocomputing for NC1”, in Proc. of FOCS '99, pages 554-567, 1999) and Beaver (D. Beaver, “Minimal-latency secure function evaluation”, in Proc. of Eurocrypt '00, pages 335350, Springer, 2000) show how to achieve statistical circuit privacy, but only for limited classes of circuits—namely, NC1 and NLOGSPACE.
The more interesting way of excluding the trivial solution is to require (roughly) that the ciphertext encrypting C(π1, . . . , πt) should “look like” an “ordinary” ciphertext, as long as C(π1, . . . , πt) is a single bit (or element of the same plaintext space that contains {πi}). For example, the size of the ciphertext output by Evaluate(pk, C, π1, . . . , πt) should not depend on C. We focus on this definition. Actually, we use a stronger requirement: that Decryptε be expressible by a circuit Dε, which takes a (formatted) secret key and (formatted) ciphertext as input, and whose size is (a fixed) polynomial in the security parameter. Of course, this implies that there is an upper bound on the ciphertext size that depends only on the security parameter, and is independent of C. After describing a scheme that meets this definition, we will also describe how to achieve (statistical) circuit privacy (Section 13).
To some, it is surprising that such a thing as fully homomorphic encryption is possible even in principle. To see that it is possible, it may be helpful to understand fully homomorphic encryption in terms of a physical analogy—e.g., a photograph developer's darkroom. The developer applies a particular function ƒ to Alice's film when he develops it—i.e., the sequence of steps to develop the film. In principle, he does not need to see anything to apply this procedure, though in practice darkrooms are typically not completely dark. Of course, this analogy is inadequate in that one may ask: why can't the developer walk out of the darkroom and look at the finished product? Imagine that the developer is blind. Then, one may ask: why can't someone else look at the finished product? Imagine that everyone in the world besides Alice is blind. “Sight” is Alice's secret key, and (in this world) it is impossible for anyone else to simulate vision. Although imagining physical analogies should convince you that the notion of fully homomorphic encryption is not a logical fallacy, it seems difficult to construct a perfect physical analogue of fully homomorphic encryption that is not rather far-fetched.
To try another physical analogy, suppose that the owner of a jewelry store (Alice) wants her employees to assemble raw precious materials (diamonds, gold, etc.) into finished products, but she is worried about theft. She addresses the problem by constructing glove boxes for which only she has the key, and she puts the raw materials inside. Using the gloves, an employee can manipulate the items inside the box. Moreover, an employee can put things inside the box—e.g., a soldering iron to use on the raw materials—even though he cannot take anything out. Also, the box is transparent, so that an employee can see what he is doing. (In this analogy, encryption means that the employee is unable to take something out of the box, not that he is unable to see it.) After the employee is done, Alice can recover the finished product at her leisure by using her key. This analogy is inadequate in the sense that the glove box might become quite cluttered, whereas in the fully homomorphic encryption scheme only the final product need remain. In other words, to improve the analogy, imagine that the employee has some way to make any item in the glove box (of his choosing) disappear (even though he still cannot extract the item).
1.3 Bootstrapping a Scheme that can Evaluate its Own Decryption Circuit
Now that we have clarified our goal (fully homomorphic encryption), let us try to find a stepping-stone. Suppose that, a priori, we have a scheme ε that is only guaranteed to be correct for some subset ε of circuits—i.e.,

Decryptε(sk,Evaluateε(pk,C,ψ1, . . . ,ψt))=C(π1, . . . ,πt)

is guaranteed to hold only if C∈ε(and, as before, ψi←Encryptε(pk, πi)). Can we use ε to construct a scheme ε* that is fully homomorphic?

In Section 4, we show that the answer is yes. Suppose that ε contains just two circuits: Dε and the augmentation of Dε by NAND (i.e., a NAND gate connecting two copies of Dε), where Dε is the circuit associated to the decryption algorithm.1 If ε has this self-referential property of 1We use NAND because any circuit can be expressed in terms of NAND gates. We could instead augment the decryption circuit by a different set of universal gates. being able to evaluate its own (augmented) decryption circuit, we say that ε bootstrappable. We show that bootstrappable encryption implies leveled fully homomorphic encryption—i.e., that Dε plus the NAND-augmentation of Dε constitute a “complete” set of circuits:
Theorem 1.1 (Informal). If ε is bootstrappable, then, for any integer d, one can construct a scheme ε(d) that can evaluate any circuit (consisting of NAND gates) of depth d. The decryption circuit for ε(d) is the same as for ε, and the complexity of encryption is also the same. ε(d)'s public key size is O(d) times that of ε's. The complexity of Evaluateε(d) is polynomial in the security parameter and linear in the circuit size. If ε is semantically secure against chosen plaintext attacks, then so is Evaluateε(d).
One drawback of ε(d) is that its public key is O(d) times that of ε's public key. Since ε(d) has this unwanted dependence on d, we say that it is merely leveled fully homomorphic. Under certain assumptions, we can make the ε(d) public key size be independent of d, in which case we say the derived scheme is fully homomorphic.
Why should the fact that ε can evaluate (augmentations of) Dε be so powerful? Suppose that the distributions of Evaluateε(pk, C, ψ1, . . . , ψt) and Encryptε(Pk, C(π1, . . . , πt)) are different. In particular, suppose that there is an “error” associated with each ciphertext, that ciphertexts output by Encryptε have small error, that ciphertexts output by Evaluateε have larger error that increases with the depth of the circuit being evaluated, and that eventually (as the depth of the circuit being evaluated increases) the “error” becomes so large that applying Decryptε to the ciphertext results in a decryption error. (In fact, this is the case in our initial ideal lattice construction.) Intuitively, as we are evaluating a circuit and the implicit “error” becomes large, we would like to “refresh” the ciphertext so that the error becomes small again. Obviously, we could refresh a ciphertext if we could completely decrypt it, simply by generating an entirely new and fresh ciphertext that encrypts the same thing, but we want a way to refresh that does not require the secret key. This is the idea behind bootstrapping: we do decrypt the ciphertext, but homomorphically!
Specifically, suppose ε is bootstrappable, with plaintext space ={0, 1}, and that circuits are boolean. Suppose we have a ciphertext ψ1 that encrypts π under pk1, which we want to refresh. So that we can decrypt it homomorphically, suppose we also have sk1, the secret key for pk1, encrypted under a second public key pk2: let sk1j be the encryption of the jth bit of sk1. Consider the following algorithm.

Recryptε(pk2,Dε, sk1j,ψ1).

    
    
        Set
    
    






  
    
      ψ
      
        1
        ⁢
        
          
        
        ⁢
        j
      
    
    _
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Encrypt
      ɛ
    
    ⁡
    
      (
      
        
          pk
          2
        
        ,
        
          ψ
          
            1
            ⁢
            j
          
        
      
      )
    
  




Outputψ2←Evaluateε(pk2,Dε, sk1j, ψ1j)

Above, Evaluate takes in the bits of sk1 and ψ1, each encrypted under pk2. Then, ε is used to evaluate the decryption circuit homomorphically. The output ψ2 is thus an encryption under pk2 of Decryptε(sk1, ψ1)=π.2 In other words, Recrypt decrypts homomorphically using the encrypted secret key, thus obtaining a new ciphertext that encrypts the same thing as the original one. 2Recrypt implies a one-way multi-use proxy re-encryption scheme. (See M. Blaze, G. Bleumer, and M. Strauss, “Divertible protocols and atomic proxy cryptography”, in Eurocrypt '98, LNCS 1403, pages 127-144.) We discuss this in more detail in Subsection 1.8.
Notice how π is doubly encrypted at one point, and we use Evaluateε to remove the inner encryption. Applying the decryption circuit Dε removes the “error” associated to the first ciphertext under pk1, but Evaluateε simultaneously introduces a new “error” while evaluating the ciphertexts under pk2. Intuitively, we have made progress as long as the second error is shorter. Note that revealing the encrypted secret key bits  sk1j does not compromise semantic security; these encrypted secret key bits are indistinguishable from encryptions of 0 as long as ε is semantically secure by a standard hybrid argument. This hybrid argument breaks down if pk1=pk2. However, if ε securely encrypts key-dependent messages (is KDM-secure)—i.e., roughly, if providing a ciphertext that encrypts a function of the secret key does not hurt security—then Recrypt can have a “self-loop” of encrypted secret keys. (See D. Boneh, S. Halevi, M. Hamburg, and R. Ostrovsky, “Circular-Secure Encryption from Decision Diffie-Hellman”, in Proc. of Crypto '08, LNCS 5157, pages 108-125, and references therein, for more information on KDM security.)
Of course, our goal is to perform nontrivial homomorphic operations on underlying plaintexts, not merely to obtain refreshed encryptions of the same plaintext. If we can also evaluate a NAND augmentation of the decryption circuit, then we can generate an encryption of (π1 NAND π2) under pk2 using the encrypted secret key (sk1 under pk2) together with the two ciphertexts encrypting π1 and π2, respectively, under pk1. By recursively performing this type of operation on all ciphertexts at a given level in the circuit, we can evaluate a d-depth circuit of NANDs. If ε is KDM-secure, the derived scheme is fully homomorphic (rather than leveled fully homomorphic). In the random oracle model, we show that a bootstrappable encryption scheme implies a scheme that is both bootstrappable and KDM-secure, and thus implies a fully homomorphic encryption scheme.
Again, it may be helpful to view bootstrapping in terms of a physical analogy, although it will, of course, be even more far-fetched. Recall Alice, our jewelry store owner. Imagine that Alice's glove boxes are defective; after an employee uses the gloves for 1 minute, the gloves stiffen and become unusable. Unfortunately for Alice, even her fastest employee cannot assemble some of the more intricate designs in under a minute. But Alice is not only paranoid, but also smart. To an employee that is assembling an intricate design, she gives him (like before) a glove box containing the raw materials, but also several additional glove boxes. Each of these additional glove boxes holds a copy of her master key. To assemble the intricate design, the employee manipulates the materials in box #1 until the gloves stiffen. Then, he places box #1 inside box #2, where the latter box already contains a master key. Using the gloves for box #2, he opens box #1 with the master key, extracts the partially assembled trinket, and continues the assembly within box #2 until its gloves stiffen. He then places box #2 inside box #3, and so on. When the employee finally finishes his assembly inside box #n, he hands the box to Alice. Of course, this trick will not work unless the employee can open box #i within box #(i+1), and have time to make a little bit of progress on the assembly, all before the gloves of box #(i+1) stiffen. This is analogous to the requirement for a bootstrappable encryption scheme ε—that the complexity of ε's (augmented) decryption circuit is less than what ε can homomorphically evaluate.
We assumed that it was safe to use a single master key that opens all boxes. But maybe it is not safe; maybe an employee could use the gloves for box #2, together with master key inside that box, to open the box from the inside, extract the key, and use it to open box #1 and steal the jewels. However, Alice can avoid this circumstance by using distinct keys for the boxes, and placing the key for box #1 inside box #2, the key for box #2 inside box #3, and so on. This is analogous to the question of whether the encryption scheme is KDM-secure.
As before, the physical analogy only goes so far. In the physical case, box #i would grow as i increases, and consequently the extraction time would also grow, but our encryption scheme does not have analogous deficiencies. And, again, in our physical analogy, encryption corresponds to being unable to physically access the contents of the box. So, it is not a valid attack for the employee to copy the master key based on what he can see through the transparent box. Accordingly, it might be helpful to think of each key as having a certain secret chemical composition which cannot be readily ascertained while the key is inside the box, and that a key opens its associated box through a chemical reaction.
1.4 Ideal Lattices: Ideally Suited to Construct Bootstrappable Encryption
The notion of bootstrappability gives us a new angle on constructing fully homomorphic encryption: it suggests we should look at encryption schemes whose decryption algorithms have low circuit complexity. Within the bootstrappability framework, it does not make much sense to look at exponentiation-based schemes, since exponentiation (as used in RSA, for example) is not even known to be in NC. On the other hand, encryption schemes using lattices or linear codes have very simple decryption algorithms typically dominated by a matrix-vector multiplication, an operation in NC1. In this paper, we focus on constructing a lattice-based scheme (though we view, say, a code-based construction as an interesting possibility).
Of course, it is not enough to minimize the circuit complexity of decryption; we also must maximize the evaluative capacity of the scheme, so that the scheme can evaluate its own (augmented) decryption circuit. While one can easily construct an additively homomorphic scheme from ordinary lattices, we need a scheme with both additive and multiplicative homomorphisms to evaluate general circuits. This consideration leads us to focus on ideal lattices.
In Section 7, we describe an initial homomorphic encryption scheme based on ideal lattices. However, one can understand the scheme reasonably well just in terms of rings and ideals (no lattices). Rings and ideals are simple algebraic objects. Examples of rings are  (the integers) and the polynomial ring [x]/(ƒ(x)), consisting of the residues of integer polynomials modulo a monic polynomial ƒ(x). Rings are closed under addition ‘+’, multiplication ‘×,’ and additive inverse, and have an additive identity ‘0’ and multiplicative identity ‘1.’ An ideal I of a ring R is a subset I⊂R such that Σj=1t ij×rj∈I for any i1, . . . , it∈I and r1, . . . , rt∈R. For example, (2) is an ideal of  consisting of the set of even numbers. An example ideal in [x]/(ƒ(x)) is (a(x)), the set of multiples of a(x) (reduced modulo ƒ(x)). However, by these examples, we do not mean to imply that ideals are necessarily principal; they may not be generated by a single element. If I is a proper subset of R, we can talk about a coset of I within R; e.g., 1+(2) is a coset consisting of the odd numbers. The element x∈R is in the coset y+I if x−y∈I. Many of the previous constructions of (partially) homomorphic encryption use rings and ideals, at least implicitly; see Section 3.
As a first approximation, here is how a fully homomorphic encryption scheme based on rings and ideals might work. The public key pk contains an ideal I and a plaintext space , where the latter basically consists of a set of “distinguished representatives” of the cosets of I; the secret key sk consists of some “secret knowledge” concerning I. To encrypt π∈, the encrypter sends




  
    ψ
    ⁢
    
      ←
      R
    
    ⁢
    
      π
      +
      I
    
  
  ,




a “random” member of the coset π+I. The decrypter uses its secret knowledge to recover the “distinguished representative” π (distinguished with respect to ) of the coset π+I. To add and multiply ciphertexts, we simply use the ring operations ‘+’ and ‘×’:

Add(pk,ψ1,ψ2)=ψ1+ψ2∈(π1+π2)+I 

Mult(pk,ψ1,ψ2)=ψ1×ψ2∈(ψ1×ψ2)+I 

Ring operations on ciphertexts induce mod-I operations on the underlying plaintexts. In general, for an arithmetized mod-I circuit C, we would have

Evaluateε(pk,C,ψ1, . . . ,ψt)∈C(π1, . . . ,π1)+I 

The semantic security of this scheme relies on the hardness of an ideal membership problem—i.e., given π′ and ψ, is ψ−π′∈I? This is the approach of the Polly Cracker scheme by Fellows and Koblitz, described in Section 3.

The first approximation above does not work for ideal lattices, unfortunately, since the ideal membership problem is not hard. An ideal lattice, as used in this paper, is simply an ideal in [x]/(ƒ(x)), ƒ(x) of degree n; each such ideal I can be represented by a lattice generated by the columns of a lattice basis BI, an n×n matrix. It so happens that, for any basis BI of any lattice (not just an ideal lattice) I and any v∈n, there is a unique, efficiently-computable distinguished representative v mod BI. In particular, it holds that v mod BI=v−BI·└BI−1·v┐, where BI−1 is the matrix inverse of BI and └·┐ rounds to the nearest integer vector. To find the distinguished representative for r∈R modulo BI, one computes r mod BI where r is the coefficient vector of r. To test whether r is a member of I, one simply tests whether r mod BI=0 mod BI. Thus, the ideal membership problem is easy.
So, we use a different approach that involves two ideals. Everybody can use a common ideal I, represented by basis BI. Then, each user generates their own ideal J, with secret and public bases BJsk and BJpk, that is relatively prime to I (i.e., I+J=R). As before, the plaintext space  consists of distinguished representatives of the cosets of I. The public key pk also includes the description of a distribution D. To encrypt π∈, the encrypter sets




  
    
      π
      *
    
    ⁢
    
      ←
      D
    
    ⁢
    
      π
      +
      I
    
  
  ,




and sends ψ←π*mod BJpk. In other words, the ciphertext has the form ψ=π+i+j for i∈I and j∈J, where π+i comes from the specified distribution D. The decrypter sets

π←(ψ mod BJsk)mod BI.

For decryption to work, the secret key BJsk should be chosen so as to be compatible with the distribution D, so that π+i is always the distinguished representative of π+i+J with respect to BJsk. In this case, the mod-BJsk operation returns π+i, after which π is recovered easily. This decryption criterion becomes more complicated as we add and multiply ciphertexts using the basic ring operations. For arithmetized circuit C that uses addition and multiplication modulo I (w.r.t. basis BI), we have:

Evaluateε(pk,C,ψ1, . . . ,ψt)=C(ψ1, . . . ,ψt)∈C(π1+i1, . . . ,πt+it)+J 

where i1, . . . , it∈I. (The above is an abuse of notation, since on the left C consists of gates that add and multiply the underlying plaintexts modulo I, while in the middle and on the right C uses the ring operations ‘+’ and ‘×’, but we will use this for now.) In this case, for decryption to work, we need C(π1+i1, . . . , πt+it) to be the distinguished representative of C(π1+i1, . . . , πt+it)+J w.r.t. BJsk. We can reverse this statement, and say that the set  of circuits that the scheme ε evaluates correctly consists of those circuits for which C(π1+i1, . . . , πt+it) is always the distinguished representative of C(π1+i1, . . . , πt+it)+J w.r.t. BJsk when BJsk is generated according to KeyGenε and πk and ik are chosen according to Encryptε. In this case, the mod-BJsk operation recovers C(π1+i1, . . . , πt+it), after which the decrypter easily recovers C(π1, . . . , πt) by reducing modulo BI.

This characterization of ε becomes less nebulous when, in the context of lattices, we give a geometric interpretation to C(π1+i1, . . . , πt+it) as a vector indicating the ciphertext vector's “error” or “offset” from the lattice J. In this setting, the distinguished representatives of the cosets of J w.r.t. the basis BJsk are precisely the points in n that are contained inside the parallelepiped (BJsk)={x∈n: x=Σxi·bi, xi∈[−1⁄2, 1⁄2)} associated to the basis BJsk={bi}. Decryption works as long as the “error vector” is never so long that it falls outside of (BJsk).3 Once we specify 3If the error vector does fall outside (BJsk), the mod-BJsk operation in decryption returns C(π1+i1, . . . , πt+it)+j for some nonzero j∈J, and the subsequent reduction modulo I is unlikely to return C(π1, . . . , πt), since J is relatively prime to I. We note that the NTRU encryption scheme employs relatively prime ideals in a somewhat similar way, but of course without the homomorphisms). See J. Hoffstein, J. Pipher and J. Silverman, “NTRU: A Ring Based Public Key Cryptosystem”, in Proc. of ANTS '98, LNCS 1423, pages 267-288. some radius rDec such that the parallelepiped (BJsk) always contains a ball of radius rDec inside it (for any J generated according to KeyGen), and also specify a radius rEnc such that (in Encryptε) the
vector




  
    π
    *
  
  ⁢
  
    ←
    D
  
  ⁢
  
    π
    +
    I
  




always fall within a ball of radius rEnc, the bootstrappability question becomes: is C(x1, . . . , xt)∈(rDec) whenever xi∈(rEnc) for all i and C is an (augmented) decryption circuit?

We can upper-bound the length of C(x1, . . . , xt) for arithmetic circuit C recursively by upperbounding the “expansion” caused by additions and multiplications. Roughly speaking, we can say that Add operations do not increase the length of the error vector much: if ψ1∈x1+J and ψ2∈x2+J, then Add(pk, ψ1, ψ2)∈(x1+x2)+J, where ∥x1+x2∥≦∥x1∥+∥x2∥ by the triangle inequality. Mult operations are more expensive; we can show that, for any polynomial ring R, there is a parameter γMult(R) such that ∥x1×x2∥≦γMult(R)·∥x1∥·∥x2∥; γMult(R) may be, e.g., polynomial in n. (For the Mult operation, vector xi is interpreted as the polynomial in R whose coefficient vector is xi.) Essentially, constant-fan-in Mult gates cause at least as much expansion as polynomial-fan-in Add gates. In the worst case, Mult gates cause the length of the error vector essentially to square with each additional level of the circuit, limiting the circuit depth that the scheme can evaluate to (roughly) log log rDec.
Theorem 1.2 (Informal). Suppose X⊂(rx) and Y⊃(rY), rX≧1. Then, C(x1, . . . , xt)∈Y for all x1, . . . , xt∈X and all arithmetic (over R) circuits with multiplicative fan-in of 2, additive fan-in of up to γMult(R), and depth up to

log log rY−log log(γMult(R)·rX)

I.e., ε correctly evaluates all such circuits of depth up to log log rDec−log log(γMult(R)·rEnc).

So, can we express the (augmented) decryption circuit with depth at most (roughly) log log rDec? Unfortunately, the answer appears to be ‘no,’ though it is a close call. Specifically, the dominant computation in decryption is └(BJsk)−1·ψ┐, which occurs within the computation of ψ mod BJsk. Roughly speaking, to ensure that the rounding is correct, one must use a sufficient number of bits of precision. Then, the high precision of each number-number multiplication that occurs within the matrix-vector multiplication forces us to use a high-depth circuit. Specifically, two k-bit numbers can be multiplied together using a O(log k)-depth circuit (with constant fan-in). The precision we seem to need is roughly log det(J)>n·log rDec bits, and therefore we need about a O(log n+log log rDec)-depth circuit.
Unfortunately, for this initial scheme, it seems that no matter how the parameters are set, the decryption circuit is always slightly too complex for the scheme to evaluate.4 This problem is 4However, we do not prove this. It remains possible that the decryption circuit of this initial scheme can be expressed in a way that makes the scheme bootstrappable. difficult to fix post hoc, in part due to the self-referential nature of the bootstrapability property: intuitively, if one expands the set of circuits that ε can “handle” in an effort to include Dε, one seemingly must increase the complexity of Decryptε to accommodate, thereby making the circuit Dε more complex, possibly such that Dε always elusively falls outside of the expanded set. To obtain a bootstrappable encryption scheme, it seems necessary to change the decryption algorithm fundamentally.
1.5 Squashing the Decryption Circuit: The Encrypter Starts Decryption!
To reduce the decryption complexity without affecting the “evaluative capacity” of the scheme at all, our approach, given in Section 10, is to enable the encrypter to start decryption, thereby easing the burden on the decrypter. Interestingly, the setting is similar to server-aided cryptography, where a user offloads some portion of a computationally intensive cryptographic task, such as decryption, onto an untrusted server; in our case, the encrypter itself plays the server's role.
Abstractly, if ε* is our original homomorphic encryption scheme, with public and secret keys (pk*, sk*), the modified scheme ε uses an algorithm that we call SplitKey to generate a “hint” τ about sk*, which it puts in the ε public key. Also, ε uses a new algorithm ExpandCT. The encrypter uses this algorithm, in combination with the hint τ, to transform a preliminary ciphertext ψ* output by ε* into an “expanded ciphertext” that can be decrypted by a shallower circuit. Here is the abstract transformation in detail; since it is abstract, it is obviously not explained at this point why the expanded ciphertext is easier to decrypt.
KeyGenε(λ). Runs




  
    (
    
      
        pk
        *
      
      ,
      
        sk
        *
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      KeyGen
      
        ɛ
        *
      
    
    ⁡
    
      (
      λ
      )
    
  




and





  
    (
    
      sk
      ,
      τ
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        SplitKey
        ɛ
      
      ⁡
      
        (
        
          
            sk
            *
          
          ,
          
            pk
            *
          
        
        )
      
    
    .
  




The secret key is sk. The public key pk is (pk*, τ).

Encryptε(pk, π). Runs ψ*←Encryptε *(pk*, π). It then set ψ to include ψ* and the output of ExpandCTε(pk, ψ*). (ExpandCTε makes heavy use of τ.)

Decryptε(sk, ψ). Uses sk and expanded ciphertext to decrypt more efficiently. Decryptε(sk, ψ) should work whenever Decryptε *(sk*, ψ*) works.

Addε(pk, ψ1, ψ2). Extracts (ψ*1, ψ*2) from (ψ1, ψ2), computes ψ*←Addε*(pk*, ψ*1, ψ*2), and sets ψ to include ψ* and the output of ExpandCTε(pk, ψ*). Multε(pk, ψ1, ψ2) is analogous.

We (half facetiously) say that the “encrypter starts decryption” because it uses the secret-key-related value τ to expand the ciphertext in a way that helps reduce the decrypter's circuit complexity. The introduction of τ into the public key provides a “hint” about the secret key sk of the original scheme ε*. However, it is easy to see that ε is semantically secure as long as ε* is, as long as the following SplitKey distinguishing problem is hard: given (pk*, sk*, τ), distinguish whether τ was generated as the output of SplitKeyε(sk*, pk*) (as it should be), or as the output of SplitKeyε(⊥, pk*), where ⊥ is some distinguished symbol that is independent of sk*. In the latter case, τ gives no additional information about sk* that could weaken security.

Theorem 1.3 (Informal). If there is an algorithm  that breaks the squashed scheme with non-negligible probability, then there is either an algorithm 1 that breaks the original scheme or an algorithm 2 that solves the SplitKey distinguishing problem with non-negligible advantage.

Concretely, we actually apply a couple of technical “tweaks” to our original ideal-lattice-based construction before we apply the above transformation. In one tweak, we show how to simplify the decryption equation in the original scheme from (ψ* mod BJsk) mod BI=(ψ*−BJsk·└(BJsk)−1·ψ*┐)mod BI to (ψ*−└vJsk×ψ*┐) mod BI where ‘x’ is ring multiplication and vJsk∈n. The new secret key vJsk is slightly weaker than the original one, which forces us to reduce rDec by a polynomial factor (which is insignificant if rDec is super-polynomial anyway, as it is required to be to obtain our fully homomorphic scheme). Other than that, the modification has no effect on the correctness or security of the scheme. The purpose of the tweak is merely to reduce the size of the tag τ introduced by the above transformation. (We will discuss what τ is in concrete terms momentarily.) The second tweak is to limit the set of “permitted circuits” to those for which the length of the “error” vector never exceeds rDec/2, rather than rDec. The purpose of this tweak is to ensure that the coefficients of the vector vJsk×ψ* are bounded away from half-integers when ψ* is a valid ciphertext. In particular, all of the coefficients will be within 1⁄4 of an integer; this allows us to simplify the decryption circuit while still ensuring that the rounding operation └vJsk×ψ*┐ yields the correct answer. Aside from very slightly reducing the evaluative capacity of the scheme, this tweak also has no negative effect.
Now, in our concrete instantiation of SplitKeyε, τ is a random set S (with w(n), but poly(n), members) of vectors {ui} that has a sparse subset T (with w(1), but o(n), members) whose sum is vJsk modulo I; the new secret key sk is the subset T, encoded as a 0/1-vector in {0, 1}|S|. Distinguishing whether or not the vectors in S are completely uniform and independent of sk* is a lattice-related problem, whose search version (actually finding the subset) has been studied in the context of server-aided cryptography. We discuss this problem a bit more in the next Subsection.
In the modified scheme, ExpandCTε outputs {ci←ui×ψ* mod BI:ui∈S}. To oversimplify, Decryptε sums up the values ci that correspond to elements of T, thereby obtaining vJsk×ψ* mod BI, and then rounds to the nearest integer vector. This summation can be performed in depth (roughly) log |T|, regardless of what n is. By choosing |T| small enough, smaller than the depth of the circuits that the scheme can evaluate (which is unaffected by this transformation), the scheme becomes bootstrappable.
The previous paragraph oversimplifies some details. First, the summation of the |T| vectors and the rounding are performed together; the fact that the ultimate result is rounded and taken modulo I allows us to maintain fewer bits of precision in the intermediate computations. The fact that we are promised that the final result is close to an integer vector (due to one of our tweaks), ensures that the rounded result is correct despite the limited precision. Also, we actually still add |S| vectors together, but with the promise that only |T| of them are nonzero. (We have this promise because, after when we multiply in the secret key sk∈{0, 1}|S|, which has Hamming weight |T|, it zeroizes all but |T| of the ciphertext components). Why can we add |T| vectors in only (roughly) log |T| depth, regardless of the size of when we have the promise that only |T| of the |S| vectors are nonzero (and the other promises, like the fact that we only need the result rounded, and then modulo I)? Essentially, the reason is that summing |S| numbers basically reduces (in terms of circuit depth) to computing the Hamming weight of a vector in x∈{0, 1}|S| and expressing the final result in binary—i.e., in {0, 1}s+1 for s=└log |S|┐. The binary expression of the Hamming weight of x turns out to be simply (e2s (x1, . . . , x|S|) mod 2, e2s−1(x1, . . . , x|S|) mod 2, . . . , e20(x1, . . . , x|S|) mod 2), where ei is the ith elementary symmetric polynomial. If the Hamming weight is guaranteed to be at most |T|, we need not bother computing the polynomials of degree higher than 2└log |T|┐, and consequently need less depth.
Theorem 1.4 (Informal). The decryption circuit of ε with the tweaks followed by the above trans-formation can be expressed as a circuit of depth c·(log |T|)1+o(1) for some constant c. The scheme becomes bootstrappable when this value is less than log log(rDec/2)−log log(γMult(R)·rEnc).
For example, suppose rDec=2nc′ for some c′<1 and γMult(R)·rEnc=poly(n). In this case, the scheme becomes bootstrappable when |T|≦n(c′/c)−o(1).
Devising a physical analogy for our technique for squashing the decryption circuit is rather difficult, but suppose that, in Alice's jewelry store, a key opens a glove box through a chemical reaction. To unlock a box, the employee uses the gloves to rub the key against the inner box until the box dissolves. However, the reaction is too slow; the gloves stiffen before the box dissolves. To address this situation, Alice gives the employee some accelerants, a different one for each box, that the employee can apply to the outside of box #i right before placing it inside box #(i+1). The accelerants speed up the chemical reaction between the key and the box, so that the reaction finishes before the gloves stiffen. The chemical composition of the accelerant provides some information about the chemical composition of her key, but not enough information for an employee to construct a key on his own. Notice that the employee should apply the accelerant to box #i while it is still outside of box #(i+1); to apply it while box #i is inside box #(i+1) would pointlessly waste the usability of the gloves for box #(i+1).
1.6 Security
The semantic security of our scheme against chosen plaintext attacks relies on the hardness of two problems; the first underlies the original somewhat homomorphic scheme (before the squashing), and the second arises from the addition of the secret key “hint” τ to the public key. CCA1 security for fully homomorphic encryption remains an open problem, while CCA2 security is impossible due to the extreme malleability of ciphertexts.
We prove the security of our somewhat homomorphic construction via a simple reduction. Specifically, in Section 5 (and more concretely in Section 7), we provide a succinct reduction to a fairly natural problem that may be viewed as a decisional version of the closest vector problem (CVP) or bounded distance decoding problem (BDDP). Roughly, the problem is as follows: given an ideal lattice J and a vector t, decide whether (1) t is unusually close to the lattice or (2) t is in a uniformly random coset of the lattice, given the promise that one of these is the case. The idea is that if t is in the first category, the simulator can use t to construct a valid ciphertext vector (which is also quite close to the lattice, but a little bit further away than t), but if t is in the second category, the ciphertext will be completely independent of the challenge plaintext; the latter case makes use of the fact that I and J are relatively prime.
The introduction of τ into the public key induces a second problem that we must assume is hard, an instance of the SplitKey distinguishing problem: roughly, given vJsk, distinguish whether S is entirely random, or has a sparse |T|-member subset of vectors that sums to vJsk. We will refer to this as a sparse vector subset sum problem (SVSSP). If |T| is too small, there are obvious brute force attacks on the SVSSP, along with some more sophisticated time-space tradeoffs, that take time essentially exponential in |T|. Also, if |S| is so small that the subset sum solution is unique, then one can apply lattice reduction attacks similar to those used against low-density knapsacks. However, if |T|=w(1) and |S| is sufficiently large (but still polynomial in n), the brute force attacks take super-polynomial time; also, the lattice reduction attacks break down, since there will be an exponential number of subset sum solutions, and lattice reduction has trouble extracting the sparse solution from the non-sparse ones.
Interestingly, our two assumptions counterbalance each other: basically, if one adjusts the scheme's parameters to make one problem harder, the other problem becomes easier. Using a crude analysis, the breaking time for the second problem using known attacks is roughly 2|T|. (Here we ignore constants and logarithmic factors in the exponent.) Also, to enable the somewhat homomorphic ideal lattice scheme to evaluate circuits of depth O(log |T|) as needed to permit bootstrappability, we need the approximation factor for the first problem to be roughly 2|T|. Using the rule of thumb that a lattice problem for approximation factor 2k takes time about 2n/k, the breaking time for the first problem is roughly 2n/|T|. Setting |T|←√{square root over (n)} ensures that it takes time at least 2√{square root over (n)} to break either problem using known attacks. To make this breaking time truly exponential in the security parameter λ, we need the lattice dimension to be n≈λ2. Of course, this analysis does not apply to the somewhat homomorphic scheme, which does not use bootstrapping and relies only on the first assumption, and therefore can use lattices of smaller dimension.
Even this counterbalancing of our assumptions can be viewed through the prism of our physical analogy (Alice's jewelry store) if one squints sufficiently hard. One way that Alice's employees might try to extract a key from a box is simply by cutting through the gloves. To prevent this attack, one would like the gloves to be stiffer. On the other hand, making the gloves stiffer reduces their usability, and so we need a faster chemical reaction between keys and boxes. This forces Alice to give her employees a better accelerant, which provides more precise information about the chemical composition of her keys, and therefore makes it easier for her employees to duplicate a key chemically. By making one attack more difficult, she is forced to make the other easier.
1.7 Performance
When we run Evaluate(pk, C, Ψ) over a circuit C and ciphertexts Ψ, the computational complexity of this algorithm is exactly the complexity of computing C non-homomorphically times a factor that is polynomial in the security parameter λ. The degree of this polynomial is rather high. If one wants 2λ security against known attacks on the two problems that underlie the security of our scheme, the required computation per gate is quasi-linear in λ6. While high, this does not seem entirely unreasonable when one considers that, to get 2λ security against the number field sieve, one should use an RSA modulus whose bit-length is quasi-linear in λ3, in which case a full exponentiation takes time quasi-linear in λ6, even when one uses fast FFT multiplication. See Section 12 for more details.
The story is very different if we only require super-polynomial security: in this case, n can be quasi-linear in the security parameter λ, |T| can be polylogarithmic in n, S quasi-linear in n, and ciphertexts can be represented by a quasi-linear (in n) number of bits. In this case, the complexity of Recrypt (and hence the computation per gate) can be quasi-linear in λ3.
Also, for relatively shallow circuits, where bootstrapping (and hence homomorphically evaluating the decryption circuit is unnecessary), the scheme is very practical: one obtains exponential security and, there is a constant c such that one can evaluate circuits of multiplicative depth c·log λ with computation per gate that is quasi-linear in λ1+c. The computation is quasi-linear in λ for constant depth circuits.
1.8 Applications
The most natural applications of fully homomorphic encryption are in the two-party setting. A simple example is making encrypted queries to search engines. To perform an encrypted search, Alice generates a public key pk for the fully homomorphic encryption scheme, and generates ciphertexts ψ1, . . . , ψt that encrypt her query π1, . . . ,πt under pk. (For example, each πi could be a bit of her query.) Now, let the circuit C express the server's search function. The server sets ψ*i←Evaluate(pk, Ci, ψ1, . . . , ψt), where Ci is the sub-circuit of C that computes the ith bit of the output. (We note that, in practice, the evaluation of C*i and C*j may share intermediate results, in which case it would be needlessly inefficient to run independent instances of the Evaluate algorithm.) The server sends these ciphertexts to Alice. We know, by the correctness requirement, that Decrypt(sk, ψ*i)=Ci(π1, . . . , πt). These latter values constitute precisely the answer to Alice's query, which she recovers through decryption.
Another natural application is searching over encrypted data. In this scenario, Alice stores her files on a server (e.g., on the Internet), so that she can conveniently access her files without needing her own computer. However, she encrypts her files, because otherwise the server could read or leak her private data. Let bits π1, . . . , πt represent the files, which are encrypted in the ciphertexts ψ1, . . . , πt. Suppose that later Alice wants to download all of her encrypted files that satisfy a query—e.g., all files containing the ‘homomorphic’ within 5 words of ‘encryption’, but not the word ‘evoting’. She sends her query to the server, which expresses it as a circuit C. The server sets ψ*t←Evaluate(pk, Ci, ψ1, . . . , ψt) and sends these ciphertexts to Alice. Alice decrypts them to recover C(π1, . . . , πt), the (bits of the) files that satisfy her query. (In this application, as in the encrypted search application, Alice needs to provide an upper bound on the number of bits that the response should have, and the server's encrypted response will be padded or truncated to that upper bound.)
Let us compare fully homomorphic encryption to a previous general solution for secure two-party computation—namely, “Yao's garbled circuit”. The problem with Yao's protocol is that the communication complexity is proportional to the size of the circuit C. This makes the protocol rather unattractive in both of the scenarios discussed above (encrypted search and searching encrypted data). In the encrypted search scenario, the search engine would need to send Alice a huge garbled circuit whose size is proportional to the data being searched. In the scenario of searching on encrypted data, Alice would need to send a circuit whose size is proportional to the size of her data; if such communication complexity could be tolerated, then the server might as well just transmit all of Alice's encrypted files to her without “processing” those files at all, and let Alice figure out which files she wants. With fully homomorphic encryption, the communication complexity is much less. In particular, the communication needed, other than pk, is simply the number of bits need to express Alice's (cleartext) query and the server's (cleartext) response, each multiplied by the size of the security parameter, since each cleartext bit becomes a ciphertext. Actually, for the inputs to the circuit—e.g., Alice's query—we can do even better; the scheme's communication overhead here can be only additive, rather than multiplicative. Yao's protocol has the advantage of hiding the circuit, but it easy to tweak our fully homomorphic encryption scheme so that it provides unconditional circuit privacy.
Despite nearly minimal communication efficiency, our fully homomorphic encryption scheme does add a fair amount of computational overhead, so asynchronous application scenarios may be more appropriate in practice. An asynchronous example is spam filtering of encrypted emails: given an email encrypted using our scheme under Alice's public key, Alice's email server can homomorphically apply its spam filter to the email to obtain an encryption of ‘0’ (indicating the email is not spam) or ‘1’ (indicating that it is). Later, Alice decrypts this single ciphertext to recover a bit b, and only decrypts the rest of the email if b=0.
Regarding multiparty computation, we already know that we can securely compute any function. More specifically, one can construct efficient secure protocols for any multiparty computation in which there is an honest majority, assuming only the existence of trapdoor permutations (see O. Goldreich, S. Micali, and A. Wigderson, “How to play any mental game—a completeness theorem for protocols with honest majority”, J. of the ACM, vol. 38, no. 1, pp. 691-729, 1991). By “efficient,” we do not mean that these protocols are necessarily practical. We mean only that the communication and computational complexity of the secure protocol equals the computational complexity of the insecure protocol times some factor that is polynomial in the security parameter and number of parties.
But why should the communication complexity of secure multiparty computation depend at all on computational complexity of the function being computed? Naor and Nissim (see M. Naor and K. Nissim, “Communication preserving protocols for secure function evaluation”, in Proc. of STOC '01, pages 590-599, 2001) showed that, as one would expect, it is possible to construct a secure protocol whose communication complexity is polynomial in the security parameter and the communication complexity of the insecure protocol, but their method has a severe shortcoming: the computational complexity of their scheme is exponential (in the worst case) in the communication complexity. In eliminating one type of unwanted dependence, it introduces another.
Previous work leaves a fundamental question unanswered: can we make a protocol secure while leaving both the communication and the computational complexity unchanged, up to a factor polynomial in the security parameter? With fully homomorphic encryption, the answer is essentially ‘yes.’ More precisely, the answer is ‘yes’ if we relax the definition of communication complexity to include the bit-lengths of the output functions (which normally would not necessarily be included, since they are not communicated).
Extending our application of fully homomorphic encryption from the two-party setting to the multiparty setting is not entirely trivial, since, in the two-party setting, Bob prevented Alice from seeing any intermediate values encrypted under Alice's key simply by finishing the computation himself, and sending back the final encrypted value to Alice; in the multiparty setting, it is less clear how one prevents Alice from seeing intermediate value encrypted under her key. So, we use an approach initially proposed by Franklin and Haber (see M. Franklin and S. Haber, “Joint encryption and message-efficient secure computation”, Journal of Cryptology, 9(4):217-232, 1996), and further developed by Cramer, Damgard and Nielsen (see R. Cramer, I. Damgaard, and J. B. Nielsen, “Multiparty computation from threshold homomorphic encryption”, in Proc. of Crypto '01, LNCS 2045, pages 280-300)—namely, basing secure multiparty computation on threshold homomorphic encryption. The idea is simple. The parties must use some (other) scheme for secure computation to set up a public key for the fully homomorphic encryption scheme and distribute shares of the secret key; this introduces additive communication and computational overhead that is independent of the insecure protocol. After setup, they perform exactly the communications and computations that they would in the insecure protocol, except on encrypted data; fully homomorphic encryption ensures that, if a party was able to perform computations locally in the insecure protocol, it is also able to in the secure protocol. Afterwards, they use some scheme for secure computation to perform threshold decryption on the encrypted outputs; again, this overhead is independent of the insecure protocol, except insofar as it depends on the bit-lengths of the function outputs. Cramer et al.'s scheme is dependent on the number of multiplication gates in the circuit because these could not be performed homomorphically. With a fully homomorphic encryption scheme, we avoid this problem, and fully realize their high-level concept of an “arithmetic black box.”
To handle malicious parties, we can use Naor and Nissim's transformation from a protocol for multiparty SFE with semi-honest parties to a protocol for malicious ones via a compiler that is communication-preserving—i.e., the transformation adds communication polynomial in the security parameter and polylogarithmic in the inputs. (The security parameter should be at least logarithmic in the size of the inputs anyway; otherwise, the work needed to break the scheme would be less than the work needed to process the inputs.) The essential ideas of this transformation come from Kilian's construction of zero-knowledge arguments. See J. Kilian, “A Note on Efficient Zero-Knowledge Proofs and Arguments”, in Proc. of STOC '92, pages 723-732, and J. Kilian, “Improved Efficient Arguments”, in Proc. of Crypto '95, LNCS 963, pages 311-324, and S. Arora, C. Lund, R. Motwani, M. Sudan, and M. Szegedy, “Proof verification and the hardness of approximation problems”, J. of the ACM, vol. 45, no. 3, 1998, pages 501-555.
The literature mentions numerous other applications where fully homomorphic encryption would be useful. For example, Goldreich and Ostrovsky (O. Goldreich and R. Ostrovsky, “Software protection and simulation by oblivious RAMs”, JACM, 1996) consider software protection, show that any program can be converted to a pair consisting of an encrypted program and a CPU with A bits of “shielded” memory, where λ is the security parameter, which defeats “experiments” by an adversary that might either attempt the determine the values that are stored and retrieved from memory, or try to determine the program's “access pattern”—i.e., its attempts to change the values. In their scheme, there is only a logarithmic blow-up in the computation time; however, the shielded CPU needs to be accessed for any nontrivial computation. With a fully homomorphic encryption scheme, the program and values can remain encrypted throughout the computation until the end. The shielded CPU only needs to be accessed to perform the decryption of the final output.
Goldwasser, Kalai and Rothblum (S. Goldwasser, Y. T. Kalai, and G. Rothblum, “One-Time Programs”, in Proc. of Crypto '08, LNCS 5157, pages 39-56, Springer, 2008) introduce the concept of one-time programs, in which they make minimal use of hardware to ensure that a program is used only once. Their approach is essentially to encrypt the program using Yao's garbled circuit, and have a secure device perform the decryption (a toggle bit is used to ensure that this decryption happens only once). One shortcoming of their approach is that the size of the encrypted program is proportional to the maximal running time of the program. With a fully homomorphic encryption scheme, one can construct an (encrypted) one-time program whose size is proportional to the original program. Essentially, one simply encrypts the program using the fully homomorphic encryption scheme, and runs it homomorphically, using the device to perform the final decryption. The party running the program also needs to generate a NIZK, verifiable by the device, that proves that the final ciphertext was validly constructed by running the encrypted program P on permitted inputs; again, we can use Kilian's communication-efficient zero-knowledge arguments here (see above).
Ostrovsky and Skeith (R. Ostrovsky and W. E. Skeith, “Private Searching on Streaming Data”, in Proc. of Crypto '05, LNCS 3621, pp. 223-240) propose the notion of public-key obfuscation—i.e., where a sort of obfuscation is achieved simply by encrypting the program; somehow, one then runs the encrypted program, and afterwards decrypts the output. With a fully homomorphic encryption scheme, running the encrypted program is straightforward. Currently, there is a lot of excitement about applications such as web services and cloud computing, where fully homomorphic encryption would permit remote computations on encrypted data with complete privacy.
We have already mentioned the notion of proxy re-encryption in Section 1.3. In a proxy reencryption scheme, the idea is that Alice wants to publish a tag τ that will permit anyone to convert a ciphertext encrypted under her public key pkA into an encryption of the same message under Bob's public key pkB. Previous proxy re-encryption schemes have some shortcomings. They either are not unidirectional (i.e., Alice's tag can also be used to convert ciphertexts under pkB to ciphertexts under pkA, and Alice and Bob must cooperate to produce τ), or they are not multi-use (i.e., it is impossible to construct a sequence of tags τ1, T2, . . . that allows anyone to convert ciphertexts under pkA to pkB, pkB to pkC, and so on indefinitely, without the ciphertexts growing in size). Recursive application of our Recrypt algorithm gives the first unidirectional multi-use proxy re-encryption scheme.
With fully homomorphic encryption, one can construct non-interactive zero knowledge proofs (NIZKs) of small size. For example, suppose that Alice wants to prove that π1, . . . , πt is a satisfying assignment of a boolean circuit C. Alice generates a public key pk for the fully homomorphic encryption scheme, the input ciphertexts {ψi←Encrypt(pk, πi)}, and the output ciphertext ψ*←Evaluate(pk, C, ψ1, . . . , ψt). The NIZK that her assignment is satisfying consists of NIZK proofs, under any NIZK scheme, that pk, {ψi} and ψ* are well-formed, where well-formedness for the ciphertexts means that each ψi is a valid encryption of ‘0’ or ‘1’, and ψ* is a valid encryption of ‘1’. The verifier checks the NIZKs for well-formedness, and confirms that ψ*=Evaluate(pk, C, ψ1, . . . , ψt). Intuitively, the NIZK proof works because, if the verifier believes that pk and the input ciphertexts are well-formed, then the correctness of the encryption scheme implies that the output ciphertext can encrypt ‘1’ only if C(π1, . . . , πt)=1. The size of this NIZK proof is proportional to the number of inputs to the circuit, but is otherwise independent of the size of the circuit.
For many interesting applications, we do not need the full power of our scheme; rather, a simpler, more efficient version of our scheme that evaluates circuits of logarithmic multiplicative depth suffices. For example, consider private information retrieval from an m-bit database. The querier can simply encrypt the index that it wants using log m ciphertexts. The database's response corresponds to a (log m)-degree formula evaluated over these ciphertexts, which (essentially) can be computed using a (log log m)-depth circuit. We can evaluate such shallow circuits using the somewhat homomorphic scheme that we sketched in Section 1.4, without requiring either bootstrapping or “squashing the decryption circuit.” This basic scheme compares well with the pairing-based scheme of Boneh-Goh-Nissim, which can essentially evaluate quadratic formulas; our basic scheme can also do essentially an arbitrary number of additions, but with greater multiplicative depth. In general, when the function to be evaluated is highly parallel, the bootstrapping step may be unnecessary, permitting better efficiency.
Clearly, several of these applications relate to obfuscation, but the precise relationship between fully homomorphic encryption and obfuscation is unclear. We know that general obfuscation is impossible under a certain definition of obfuscation (see B. Barak, O. Goldreich, R. Impagliazzo, S. Rudich, A. Sahai, S. Vadhan, K. Yang, “On the (Im)possibility of Obfuscating Programs”, in Proc. of Crypto '01, LNCS 2139, pages 1-18), but obfuscation may be possible under a weaker, but still meaningful, definition. We also know that general obfuscation (under essentially any reasonable definition) would imply fully homomorphic encryption: it would suffice to obfuscate circuits that take ciphertexts encrypting π1 and π2 and output appropriately distributed ciphertexts encrypting π1+π2 and π1×π2. Since general obfuscation would imply fully homomorphic encryption, it seems reasonable to guess that a general obfuscation technique (if one exists) would employ some of the techniques (bootstrapping, etc.) that we use here to construct fully homomorphic encryption. Unlike a fully homomorphic encryption scheme, however, an obfuscated circuit should allow one to compute an unencrypted output. If one is to build a general obfuscation scheme from fully homomorphic encryption, the question becomes: how can one provide, as part of the obfuscated circuit, some sort of decryption key that allows recovery of the final output, in such a way that this decryption key does not permit decryption of interior nodes of the circuit, thereby unraveling the entire obfuscation.
2 Definitions Related to Homomorphic Encryption
2.1 Basic Definitions
A conventional public-key encryption scheme ε consists of three algorithms: KeyGenε, Encryptε, and Decryptε. KeyGenε is a randomized algorithm that takes a security parameter λ as input, and outputs a secret key sk and public key pk; pk defines a plaintext space  and ciphertext space . Encryptε is a randomized algorithm that takes pk and a plaintext π∈ as input, and outputs a ciphertext ψ∈. Decryptε takes sk and ψ as input, and outputs the plaintext π. The computational complexity of all of these algorithms must be polynomial in λ. Correctness is defined as follows: if




  
    
      (
      
        sk
        ,
        pk
      
      )
    
    ⁢
    
      ←
      R
    
    ⁢
    
      KeyGen
      ɛ
    
  
  ,
  
    π
    ∈
    P
  
  ,




and





  
    ψ
    ⁢
    
      ←
      R
    
    ⁢
    
      
        Encrypt
        ɛ
      
      ⁡
      
        (
        
          pk
          ,
          π
        
        )
      
    
  
  ,




then Decryptε(sk, ψ)→π.

It will be obvious to one well-versed in the art that any public key encryption scheme (homomorphic or not) can easily be converted into a secret key or “symmetric” encryption scheme simply by setting pk=sk.
In addition to the three conventional algorithms, a homomorphic encryption scheme ε has a (possibly randomized) efficient algorithm Evaluateε, which takes as input the public key pk, a circuit C from a permitted set ε of circuits, and a tuple of ciphertexts Ψ=ψ1, . . . , ψt for the input wires of C; it outputs a ciphertext ψ∈. Informally, the functionality that we want from Evaluateε is that, if ψi “encrypts πi” under pk, then ψ←Evaluateε(pk, C, Ψ) “encrypts C(π1, . . . , πt)” under pk, where C(π1, . . . , πt) is the output of C on inputs π1, . . . , πt.
There are different ways of formalizing the functionality “encrypts C(π1, . . . , πt).” A minimal requirement is correctness.
Definition 2.1 (Correctness of Homomorphic Encryption). We say that a homomorphic encryption scheme ε is correct for circuits in ε if, for any key-pair (sk, pk) output by KeyGenε(λ), any circuit C∈ε, any plaintexts π1, . . . , πt, and any ciphertexts Ψ=ψ1, . . . , ψt with Encryptε(pk, πi), it is the case that:

    
    
        if ψ←Evaluateε(pk, C, Ψ), then Decryptε(sk, ψ)→C(π1, . . . , πt)

except with negligible probability over the random coins in Evaluateε.

    
    


By itself, mere correctness fails to exclude trivial schemes. In particular, suppose we define Evaluateε(pk,C, Ψ) to just output (C, Ψ) without “processing” the circuit or ciphertexts at all, and Decryptε to decrypt the component ciphertexts and apply C to results. This scheme is correct, but uninteresting. We can address this shortcoming by upper-bounding the length of ciphertexts output by Evaluateε. One way to do this is by placing an upper bound on the size of the decryption circuit Dε for the scheme ε that depends only on the security parameter, as in the following definition.
Definition 2.2 (Compact Homomorphic Encryption). We say that a homomorphic encryption scheme ε is compact if there is a polynomial ƒ such that, for every value of the security parameter λ, ε's decryption algorithm can be expressed as a circuit Dε of size at most ƒ(λ).

Definition 2.3 (“Compactly Evaluates”). We say that a homomorphic encryption scheme ε “compactly evaluates” circuits in ε if ε is compact and also correct for circuits in ε.

We can consider various relaxations of compactness, since homomorphic encryption schemes in which the ciphertext size grows sub-linearly with the size of the circuit are still interesting for many applications. For example, we could permit the sizes of the secret key and ciphertexts to grow polynomially with the depth of the circuit. We will informally call such schemes “quasi-compact.” Now, we define fully homomorphic encryption as follows.
Definition 2.4 (Fully Homomorphic Encryption). We say that a homomorphic encryption scheme ε is fully homomorphic if it compactly evaluates all circuits.
One may consider this definition to be too strong, because, as mentioned above, quasi-compactness could suffice; we avoid using quasi-compactness in our definition both because it is tedious to formalize, and we will rarely use the notion anyway. A second reason that it is too strong is because it excludes leveled schemes, which only evaluate circuits of depth up to some d, and whose public key length may be poly(d); hence, the following relaxation.
Definition 2.5 (Leveled Fully Homomorphic Encryption). We say that a family of homomorphic encryption schemes {ε(d): d∈+} is leveled fully homomorphic if, for all d∈+, they all use the same decryption circuit, ε(d) compactly evaluates all circuits of depth at most d (that use some specified set of gates), and the computational complexity of ε(d)'s algorithms is polynomial in λ, d, and (in the case of Evaluateε) the size of the circuit C.
(We assume the set of gates that compose the circuit is understood.)
While fully homomorphic encryption, as we have defined it, seems highly nontrivial to achieve, one still might consider our definition to be too weak, since it does not require circuit privacy.
Definition 2.6 ((Statistical) Circuit Private Homomorphic Encryption). We say that a homomorphic encryption scheme ε is circuit-private for circuits in ε if, for any key-pair (sk, pk) output by KeyGenε(λ), any circuit C∈ε, and any fixed ciphertexts Ψ=ψ1, . . . , ψt that are in the image of Encryptε for plaintexts π1, . . . , πt, the following distributions (over the random coins in Encryptε, Evaluateε) are (statistically) indistinguishable:

Encryptε(pk,C(π1, . . . ,πt))≈Evaluateε(pk,C,Ψ)

The obvious correctness condition must still hold.

We prefer to consider circuit privacy to be a property that is separate from, and complementary to, full homomorphism. However, we will eventually show how to make our lattice-based fully homomorphic encryption scheme circuit private. Our technique will be to use a public (i.e., not using the secret key) algorithm RandomizeCTε that, applied post hoc, induces the same distribution (statistically) to ciphertexts output by Encryptε and Evaluateε, while preserving correctness. (See Section 13.)
The motivating setting for statistical circuit privacy is two-party computation in the honest-but-curious setting, where Alice holds a circuit, and Bob holds sk. Alice may want her output ciphertext to reveal nothing about her circuit, even though Bob chooses the input ciphertexts. She can hide her circuit by applying RandomizeCTε to the ciphertext output by Evaluateε before sending result to Bob. When sk is shared, one may also define a computational version of circuit privacy, but this is covered by the semantic security of encryption scheme, defined in the next Subsection.
For most applications, it is acceptable to reveal some limited information about the circuit, such as an upper bound on the number of levels. (Since any circuit is a directed acyclic graph, its gates can be topologically sorted and partitioned into levels, such that each wire extends from one gate to a gate with a higher level number.) Accordingly, we define the following slight relaxation of circuit privacy.
Definition 2.7 (Leveled Circuit Private Homomorphic Encryption). Like circuit private homomorphic encryption, except that there can be a different distribution associated to each level, and the distributions only need to be equivalent if they are associated to the same level (in the circuit).
Unlike circuit privacy, leveled circuit privacy, by itself, does not imply compactness. That is, in a leveled circuit private homomorphic encryption scheme, it is possible for the ciphertext size to grow exponentially with the number of levels. In fact, this is precisely the case in some previous circuit-private schemes, such as SYY (T. Sander, A. Young, and M. Yung, “Non-interactive cryptocomputing for NC1”, in Proc. of FOCS '99, pages 554-567, 1999).
An interesting open question is the extent to which fully homomorphic encryption, as we have defined it, already implies circuit-private fully homomorphic encryption. Intuitively, given a ciphertext ψ that encrypts π, we can “randomize” using the homomorphism—e.g., by repeatedly adding encryptions of ‘0’—to obtain new encryptions of π. Since the fully homomorphic encryption scheme is compact, this randomization occurs within a non-expanding ciphertext space. One may hope that these randomizations induce a nice, connected, expander-like graph, and that therefore a small number of randomizations results in a statistically random encryption of π. However, the definition of fully homomorphic encryption does not seem even to imply that this graph is connected. It would be nice to state some natural minimal generic property, in addition to full homomorphism, that would imply circuit privacy. (Certainly, the property that adding an encryption of ‘0,’ or multiplying in an encryption of ‘1,’ completely “randomizes” the ciphertext would be sufficient, but in this case circuit privacy is an uninteresting tautology.)
In the definitions above, we have focused on circuits, but one may also consider programs that use other representation models. For example, one may consider weaker models—e.g., formulas, branching programs, OBDDs, finite automata, decision trees, and truth tables—and consider the efficiency of a homomorphic encryption scheme with respect to one of these models. For example, although an encryption scheme that is additively homomorphic will not be able to evaluate general circuits efficiently, such a scheme can be used to construct a single-server private information retrieval (PIR) scheme with sub-linear communication; such a PIR scheme, in turn, can be viewed as homomorphic encryption scheme that permits the (efficient) evaluation of a truth table with an output ciphertext that is sub-linear in the size of the table. Ishai and Paskin (Y. Ishai and A. Paskin, “Evaluating Branching Programs on Encrypted Data”, in Proc. of TCC '07) describe a scheme in which Evaluate takes a branching program (BP) P as input; finite automata, decision trees, and OBDDs can be efficiently represented as BPs. The ciphertext output by their Evaluate algorithm depends polynomially on the number of input ciphertexts and on the depth of the BP, but not on its size. On the other hand, since a program may allow loops, it may permit a more compact representation of the circuit.
2.2 Computational Security Definitions
For an ordinary public key encryption scheme, security against adaptive chosen-ciphertext attacks (CCA2) is captured in the following game.
Setup. The challenger runs




  
    (
    
      sk
      ,
      pk
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      KeyGen
      ɛ
    
    ⁡
    
      (
      λ
      )
    
  




and gives pk to the adversary . It sets ψ*←⊥.

Queries.  issues decryption queries on ciphertexts ψi≠ψ*. The challenger responds with the output of Decryptε(sk, ψi). Queries can occur before or after the challenge.

Challenge.  generates two plaintexts π*0, π*1∈ and sends these to the challenger. The challenger sets





  b
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and





  
    ψ
    *
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        Encrypt
        ɛ
      
      ⁡
      
        (
        
          pk
          ,
          
            π
            b
            *
          
        
        )
      
    
    .
  




It sends ψ* to .

Guess.  sends b′∈{0, 1} to the challenger.  wins the game if b′=b.

Security against “lunchtime attacks”—i.e., CCA1 security—is modeled by a game similar to above, except that  may make queries only before the challenge. In the game for semantic security,  is not permitted to make any queries.

In each case, we define 's advantage in attacking the scheme ε as




  
    Adv
    ⁡
    
      (
      
        A
        ,
        ɛ
        ,
        λ
      
      )
    
  
  =
  
    
    
      
        Pr
        ⁡
        
          [
          
            b
            =
            
              b
              ′
            
          
          ]
        
      
      -
      
        1
        2
      
    
    
  




The probability is over the random bits used by the challenger and the adversary.

Definition 2.8 (Semantic Security against (CPA, CCA1, CCA2) attacks). We say E is semantically secure against (CPA, CCA1, CCA2) attacks if no polynomial time (CPA, CCA1, CCA2)-adversary  breaks ε with advantage non-negligible in the security parameter λ.

When referring simply to “semantic security,” we mean semantic security against chosen plaintext attacks.
We define the CCA2, CCA1, and semantic security games for a homomorphic encryption scheme as being identical to the original games, except that now the ciphertext space is potentially larger—i.e., the support of Evaluateε rather the support of Encryptε;  can draw its queries from this larger space. Also,  has more freedom in requesting its challenge. The natural way to define the Challenge phase is that  sends the challenger some circuit C∈ε with some number k=poly(λ) of inputs, and two sets of plaintexts, (π01, . . . , π0k), (π11, . . . , π1k)∈k; the challenger sets




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and outputs





  
    ψ
    *
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Evaluate
      ɛ
    
    ⁡
    
      (
      
        pk
        ,
        C
        ,
        
          ψ
          
            b
            ⁢
            
              
            
            ⁢
            1
          
        
        ,
        ...
        ⁢
        
          
        
        ,
        
          ψ
          bk
        
      
      )
    
  




where





  
    ψ
    bi
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        Encrypt
        ɛ
      
      ⁡
      
        (
        
          pk
          ,
          
            π
            bi
          
        
        )
      
    
    .
  




However, since the adversary can run Evaluateε itself, we can simplify the Challenge phase by having the adversary just request the input ciphertexts ψb1, . . . , ψbk.

Clearly, the only difference between the semantic security games for ordinary public key encryption and homomorphic encryption is that, in the latter, the adversary can request more ciphertexts in the Challenge phase. By a hybrid argument (see M. Bellare, A. Boldyreva, and S. Micali, “Public-Key Encryption in a Multi-user Setting: Security Proofs and Improvements”, in Proc. of Eurocrypt '00, pages 259-274, Springer, 2000), an algorithm  that that breaks the semantic security in the game above with advantage ∈can be used to construct an algorithm  that breaks the semantic security in the original game with advantage ∈/k; 's is roughly k times that of . Thus, to prove semantic security of a homomorphic encryption scheme, we can just use the semantic security game for ordinary public key encryption.
The same is true for CCA1 and CCA2 security, as long as the scheme is circuit-private. (Circuit privacy ensures that the ciphertext space is the same in both games, thus allowing  to forward 's decryption queries to the challenger, and forward the responses back to .)
Unfortunately, a scheme that has nontrivial homomorphisms cannot be CCA2 secure, because it is malleable. Benign malleability (see J. H. An, Y. Dodis, and T. Rabin, “On the security of joint signature and encryption”, in Proc. of Eurocrypt '02, LNCS 2332, pages 83-107, Springer, 2002) and replayable CCA (see R. Canetti, H. Krawczyk, and J. B. Nielsen, “Relaxing chosen-ciphertext security”, in Proc. of Crypto '03, pages 565-582, Springer, 2003), which are two relaxed notions of CCA2 security, permit only transformations that preserve the underlying plaintext. Prabhakaran and Rosulek (M. Prabhakaran and M. Rosulek, “Homomorphic Encryption with CCA Security,” in Proc. of ICALP '08, Springer, 2008) formalize a notion of “homomorphic-CCA security,” which permits certain nontrivial operations on a plaintext while remaining nonmalleable with respect to other operations; they present a construction based on pairings. However, their approach does not extend (in fact, they provide some impossibility results) to schemes that permit certain operations on multiple ciphertexts. Finding meaningful relaxations of CCA2 security in this domain, and particularly for fully homomorphic encryption, is an open area.
There do not seem to be inherent reasons why a homomorphic encryption scheme cannot have semantic or CCA1 security. In particular, “Cramer-Shoup lite” (see R. Cramer and V. Shoup, “A Practical Public Key Cryptosystem Provably Secure Against Adaptive Chosen Ciphertext Attack”, Crypto '98, LNCS 1462, pp. 13-25) is CCA1 and homomorphic (for one operation). However, we restrict our focus to semantic security, and leave finding a CCA1-secure fully homomorphic encryption scheme as an interesting open problem.
3 Other Homomorphic Encryption Schemes
Basic RSA was the first homomorphic encryption scheme: given ciphertexts ψ1=π1e mod N and ψ2=π2e mod N, one can compute a ciphertext ψ←ψ1·ψ2=(π1·π2)e mod N that encrypts the product of the original plaintexts. However, basic RSA is deterministic, and therefore not even semantically secure. Despite the lack of semantic security, RSA's multiplicative homomorphism is still useful for many applications. (See R. Rivest, A. Shamir, and L. Adleman, “A method for obtaining digital signatures and public-key cryptosystems”, in Comm. of the ACM, 21:2, pages 120-126, 1978.)
Rivest, Adleman, and Dertouzos were the first to explore the possibilities of fully homomorphic encryption, which they called a “privacy homomorphism”, and they proposed several candidate schemes. However, these early candidates have been broken (see E. Brickell and Y. Yacobi, “On Privacy Homomorphisms”, in Proc. of Eurocrypt '87, LNCS 304, pages 117-125, Springer, 1988). Their early schemes did not have a proof of security based on an established hard problem, so breaking the schemes did not require any new algorithm to break such a hard problem.
Homomorphic encryption schemes that are not semantically secure, like textbook RSA and some proposals by Rivest, Adleman and Dertouzos, may also have stronger attacks on their one-wayness. In particular, Boneh and Lipton proved that any algebraic privacy homomorphism over a ring n, can be broken in sub-exponential time under a (reasonable) number theoretic assumption, if the scheme is deterministic or offers an equality oracle. In the quantum setting, the situation is even worse. van Dam, Hallgen and Ip proved that, with quantum computation, any deterministic algebraic privacy homomorphism with an equality oracle can be broken in polynomial time. (See D. Boneh and R. Lipton, “Searching for Elements in Black-Box Fields and Applications”, in Proc of Crypto '96, LNCS 1109, pages 283-297, Springer, 1996.) (See W. van Dam, S. Hallgren, and L. Ip, “Quantum algorithms for some hidden shift problems”, in Proc. of SODA '03, pages 489-498.)
The first scheme with a proof of semantic security based on a well-defined assumption was proposed by Goldwasser-Micali in the paper that introduced the notion of semantic security. (See S. Goldwasser and S. Micali, “Probabilistic encryption and how to play mental poker keeping secret all partial information”, in Proc of STOC '82, pages 365-377, 1982.) Some other additively homomorphic encryption schemes with proofs of semantically security are Benaloh, Naccache-Stern, Okamoto-Uchiyama, Paillier, and Damgard-Jurik. ElGamal (T. ElGamal, “A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms”, Crypto '84, pp. 469-472) is multiplicatively homomorphic. Some semantically secure schemes that allow both addition and multiplication include Boneh-Goh-Nissim (D. Boneh, E.-J. Goh, and K. Nissim, “Evaluating 2-DNF formulas on ciphertexts”, TCC '05, LNCS 3378, pp. 325-341), which permits computation of quadratic formulas (e.g., 2-DNFs) over ciphertexts, and “Polly Cracker” (M. Fellows and N. Koblitz, “Combinatorial cryptosystems galore!”, in Contemporary Mathematics, volume 168 of Finite Fields Theory, Applications, and Algorithms, FQ2, pages 51-61, 1993), which permits computation of arbitrary circuits over ciphertexts, but where the ciphertext size blows up exponentially with the depth of the circuit. For expository purposes, and since one can easily find other surveys of homomorphic encryption, we characterize these “conventional” homomorphic encryption schemes (although perhaps Polly Cracker is less conventional) as all falling within a certain abstract framework, with security abstractly based on an ideal membership problem. We will review these schemes in more detail momentarily. This description will help highlight how our construction is fundamentally different, abstractly relying on an ideal coset problem that we define in Section 7.
It is also known that one can construct additively homomorphic encryption schemes from lattices or linear codes. The lattice-based scheme (C. A. Melchor, P. Gaborit, and J. Herranz, “Additive Homomorphic Encryption with t-Operand Multiplications”, available at http://eprint.iacr.org/cgi-bin/getfile.pl?entry=2008/378&version=20090326:145338&file=378.pdf) and the Reed-Solomon-code-based scheme by Armknecht and Sadeghi (F. Armknecht and A.-R. Sadeghi, “A New Approach for Algebraically Homomorphic Encryption”, Cryptology ePrint Archive: Report 2008/422) also allow multiplications, though with exponential expansion in ciphertext size. Such schemes have a different flavor from the more “conventional” schemes above, because ciphertexts implicitly contain an “error” that grows as ciphertexts are added together. Thus, ciphertexts output by Evaluate do not have the same distribution as ciphertexts output by Encrypt, and at some point the error may become large enough to cause incorrect decryption. For this reason, the homomorphism is sometimes referred to as a “pseudohomomorphism” or a “bounded homomorphism”. (We use different terminology; see Section 2.) We will not discuss these schemes in detail here, since the main technical complication—managing the size of the “error”—is also central to our scheme, where it will require an even closer analysis because our multiplicative homomorphism using ideal lattices expands the “error” quite rapidly.
van Dijk describes a technique that he calls “interval obfuscation” which can be viewed as a symmetric homomorphic encryption scheme. It uses a secret integer modulus M and a secret integer s that is relatively prime to M. A ‘0’ is encrypted as s·x mod M for some x∈[1, a], where a is a “small” integer, while a ‘1’ is encrypted as s·x mod M for some x∈[b+1, b+a], where b is a “large” integer (but still small in comparison to M). One can cryptocompute a homogeneous polynomial of degree d logarithmic in the security parameter by simply adding or multiplying the ciphertexts modulo M. The recipient decrypts c by setting c′←c/sd mod M (to remove the blinding factor) and then outputting └c′/bd┐; the idea is that each monomial which is a product of 1's will be represented by some integer that approximately equals bd after the blinding factor is removed, while the monomials for which the product is 0 will be represented by much smaller integers that can be ignored. One can view their scheme as using a one-dimensional ideal lattice—namely, the ideal (M) in the integers—while our somewhat homomorphic construction in Section 7 is conceptually somewhat similar but uses an n-dimensional ideal lattice. At a high level, the reason M must be kept private in their scheme (while we can reveal a basis for the lattice in our scheme) is that lattice problems over one-dimensional lattices are not hard. An initial version of van Dijk's scheme succumbed to attacks that used lattice reduction to recover M. It is an open question as to whether the security of a variant of van Dijk's scheme can be based on a natural hard problem.
Finally, there are schemes that use a singly homomorphic encryption scheme to construct a scheme that can perform more complicated homomorphic operations. Sanders, Young and Yung (SYY) show that one can use a circuit-private additively homomorphic encryption scheme to construct a circuit-private scheme that can handle arbitrary circuits, where the ciphertext size increases exponentially with the depth of the circuit. Their scheme can therefore feasibly evaluate NC1 circuits. (See T. Sander, A. Young, and M. Yung, “Non-interactive cryptocomputing for NC1”, in Proc. of FOCS '99, pages 554-567, 1999.)
Ishai and Paskin show how to evaluate branching programs, and with much smaller ciphertexts than SYY. In their scheme Evaluate outputs a ciphertext whose length is proportional to the length of the branching program. This remains true even if the size of the branching program is very large—e.g., super-polynomial. However, the computational complexity of their scheme is proportional to the size; Barrington tells us that bounded-width polynomial-size branching programs recognize exactly those languages in NC1. (See Y. Ishai and A. Paskin, “Evaluating Branching Programs on Encrypted Data”, in Proc. of TCC '07.)
In more detail, Ishai and Paskin use a “leveled” approach to evaluate a branching program, like we will use a leveled approach to evaluate circuits (see Section 4), though the details are very different. A (deterministic) branching program (BP) P is defined by a DAG from a distinguished initial node in which each nonterminal node has two outgoing edges labeled 0 and 1, and where the terminal nodes also have labels. To compute P(x) where the binary representation of x is x1 . . . xl, one starts at the distinguished node, and traverses the DAG in the natural way dictated by x1 . . . xl to reach a terminal node, and outputs that node's label as P(x). The size of the BP is the number of nodes; the length is the length of the longest path. One can topologically arrange the nodes into levels, such that the number of levels is at most one more than the length of the BP, and the edges are all directed downward. BPs are relatively powerful; finite automata, decision trees, and ordered binary decision diagrams all have polynomial-size BPs.
To evaluate a BP, Ishai and Paskin essentially use 1-out-of-2 string OT recursively. Specifically, suppose Alice has a BP with l levels, and Bob has an input x=x1 . . . xl∈{0, 1}l for which he wants to obtain P(x). Bob constructs l 1-out-of-2 string OT queries qi, which respectively correspond to his bits xi. Using Bob's queries, Alice evaluates her BP from the bottom-up. In particular, suppose N is a node at level l−1 with children N0 and N1 with labels L0 and L1. Alice uses ql, L0 and L1 to construct a string-OT response R that implicitly “encrypts” label Lxl; she then sets R to be the label of N. In this fashion, she gives labels to all of the nodes at level l−1, and then (recursively) to nodes at higher levels using Bob's other OT queries. Alice's ultimate response is the label associated to the distinguished node. This final label looks something like a multiple encryption in onion routing, and Bob “decrypts” it as such—using his secret knowledge to recover the label for x1, then x1x2, and so on. The length of Alice's response grows (at least) linearly with l for essentially the same reason that this happens in onion-routing: each layer of “encryption” has additive communication overhead. Using a communication-efficient string-OT scheme—e.g., one built from the length-flexible additively homomorphic Damgard-Jurik encryption scheme (see I. Damgard and M. Jurik, “A Length-Flexible Threshold Cryptosystem with Applications”, ACISP '03, LNCS 2727, pages 350-356)—the ciphertext expansion per level is exactly linear. On the other hand, Alice's computation is proportional to the size of the BP, since she must construct OT responses even for “irrelevant” nodes in the BP.
To summarize to other approaches as far we know, in terms of schemes that offer more than a single homomorphism and offer a proof of semantic security, we have the schemes by Fellow and Koblitz, Melchor et al., Armknecht and Sadeghi, and Sanders et al., and related work (see D. Beaver, “Minimal-latency secure function evaluation”, in Proc. of Eurocrypt '00, pages 335350, Springer, 2000, and F. Levy-dit-Vehel and L. Perret, “A Polly Cracker system based on satisfiability”, in Coding, Crypt. and Comb., Prog. in Comp. Sci. and App. Logic, v. 23, pp. 177-192, and L. Ly, “A public-key cryptosystem based on Polly Cracker”, Ph.D. thesis, Ruhr-Universitat Bochum, Bochum, Germany 2002, and L. Ly, “Polly two—a new algebraic polynomial-based public-key scheme”, AAECC, 17(3-4), 2006) where ciphertext size grows exponentially with the multiplicative (and sometimes also additive) depth of the circuit. In Boneh-Goh-Nissim and Ishai-Paskin, Evaluate outputs small ciphertexts but handles a limited class of circuits—quadratic formulas, or circuits which correspond to branching programs of manageable size.
Now, we review the more “conventional” homomorphic encryption schemes whose semantic security can be based on a natural problem, like Goldwasser-Micali and Paillier. Since our scheme will rely heavily on properties of algebraic rings and ideals, we explain how these other homomorphic encryption schemes implicitly use these objects. By describing other homomorphic encryption schemes using these abstractions, we will see how the semantic security of most of these schemes relies on the hardness of an ideal membership problem—i.e., determining whether a member of the ring is also a member of the ideal.
Basically, a ring is a mathematical object like a field, except that not every element has a multiplicative inverse. Examples include the integers , or the integers modulo a composite integer N: /N. Rings have an additive identity ‘0’, a multiplicative identity ‘1’, allow additive inverses, and are closed under addition and multiplication. An ideal I of a ring R is a subset of R that is closed under addition, and is also closed under multiplication with elements of R. An example is the ideal (2) of , the set of even numbers; multiplying an element of (2) with an element of  gives an element in (2). For ideal I⊂R, R/I is the ring of cosets of I in R; e.g., if R= and I=(2), R/I consists of the cosets 0+(2) (the even integers, the additive identity of R/I) and 1+(2) (the odd integers, the multiplicative identity of R/I).
With these abstractions, we can say that many other homomorphic encryption schemes fall within the following framework. (Essentially, this abstract framework is explicit in Fellows' and Koblitz's description of Polly Cracker.)
KeyGen(λ). Generates some representation of a finite ring R with an efficient ‘+’ operation, and possibly an efficient ‘×’ operation. It also fixes an ideal I of R. The plaintext space  is a set of distinguished representatives of R/I. The secret key is a function ƒ: R→ such that ƒ(r) is the distinguished representative of r+I. The public key pk includes the encoding of R and an algorithm SampI to sample (efficiently) from I.

Encrypt(pk, π). Set





  i
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Samp
      I
    
    ⁡
    
      (
      R
      )
    
  




and ψ←π+2.

Decrypt(sk, ψ). Output ƒ(ψ).

Add(ψ1, ψ2). Output ψ1+ψ2.

Mult(ψ1, ψ2). Output ψ1×ψ2.

For example, in Goldwasser-Micali, KeyGen generates a modulus N=pq for p=2p′+1 and q=2q′+1, and a number x∈(/N)* whose Legendre symbols are




  
    (
    
      x
      p
    
    )
  
  =
  
    
      (
      
        x
        q
      
      )
    
    =
    
      -
      1.
    
  




In terms of the abstract framework, the underlying ring R is /(2p′q′), which corresponds to the powers of x modulo N. The underlying ideal I is (2), the set of quadratic residues, even powers of x. The plaintext space is {0, 1}, represented as {x0, x1}. The function ƒ: R→ on input r∈R (i.e., xr) is given by outputting the distinguished representative of r+(2). Sampling from I is efficient. Also, the ‘+’ operation is efficient, though the ‘×’ operation is not; hence, the scheme is only additively homomorphic.

Remark 3.1. The abstract framework hides some issues regarding how plaintexts are represented. For example, as applied to Goldwasser-Micali, the framework would say plaintext space is {x0, x1}, versus the usual {0, 1}. For Goldwasser-Micali, this is fine since the encrypter can easily map the latter representation to the former. This is the case with the other schemes as well.

Remark 3.2. Of course, a lot of complexity is hidden in the function ƒ. Goldwasser-Micali uses Legendre symbols. Paillier uses a more elaborate approach. Some schemes, such as Boneh-Goh-Nissim (described below) can use only a small (polynomial-sized) subset of the potential plaintext space because the function ƒ involves an otherwise infeasible computation—e.g., discrete logarithm.

It is easy to see that the abstract scheme is semantically secure assuming the following ideal membership problem is hard.
Definition 3.3 (Ideal Membership Problem (IMP)). According to a prescribed distribution, the challenger generates an encoding of R, an ideal I, and an algorithm Sampr that samples from I. It sets a bit




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    
      {
      
        0
        ,
        1
      
      }
    
    .
  




If b=0, it sets





  x
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        Samp
        I
      
      ⁡
      
        (
        R
        )
      
    
    .
  




If b=1, it sets





  x
  ⁢
  
    ←
    R
  
  ⁢
  
    R
    .
  




The problem is to guess b given (x, R, SampI)—i.e., essentially to decide whether or not x is a member of I.

Theorem 3.4. If there is an algorithm  that breaks the semantically security of the abstract scheme with advantage ∈, then there is an algorithm  that solves the IMP with advantage ∈/2.

Proof. Given instance (x, R, SarnI) of IMP,  includes (R, SamI) in pk, which it sends to .  requests a challenge ciphertext on one of π0, π1∈.  sets





  
    β
    ⁢
    
      ←
      R
    
    ⁢
    
      {
      
        0
        ,
        1
      
      }
    
  
  ,




and sends the challenge

ψ←πβ+x to .  sends guess and β′, and  sends guess b′←β⊕β′ to the challenger.

If b=0, then 's simulation is perfect; in particular, the challenge is a valid encryption of πβ. In this case,  should guess β with advantage ∈, and thus b′=b with advantage ∈. If b=1, x is random in R, and thus the challenge ciphertext is a random element of R, independent of β. In this case, β′ is independent of β, and so b′ is independent of b, so that 's advantage is 0. Overall, 's advantage is ∈/2.
Obviously, Goldwasser-Micali uses quadratic residuosity as its version of the IMP. Benaloh is similar to Goldwasser-Micali, but uses ideals of the form (m) for m≠2 where m divides φ(N). In Paillier, the ring is /(p′q′N), the ideal is (N), and it is based on the N-th residuosity problem. Damgard-Jurik extends Paillier to the ring is /(p′q′Nk) and uses the ideal is (Nk). Okamoto-Uchiyama uses a modulus of the form N=p2q, and uses the ring /(pp′q′) and the ideal /(p).
The above schemes can all be said to be based on a subgroup (or subset) membership problem, since only one operation (namely addition, which is instantiated as group multiplication) is actually being used. Two schemes that make more use of the ring structure are Polly Cracker and Boneh-Goh-Nissim (BGN).
The Polly Cracker scheme was proposed by Fellows and Koblitz. They state essentially the abstract framework above and propose an instantiation of it using the polynomial ring R=q[x1, . . . , xn]. The ideal I is presented as a set of generating polynomials ={pi(x1, . . . , xn)} having a common (secret) root (a1, . . . , an); the ideal I is the set of all polynomials of the form Σpi(x)·ri(x) for ri(x)∈R. To sample from I, one uses the generators, though there is plenty of freedom here in setting the sampling distribution since R and I are infinite. The plaintext space is q. The abstract function ƒ is instantiated as evaluation of the ciphertext polynomial at (a1, . . . , an), a homomorphism whose kernel contains I.
The security of Polly Cracker in practice still seems to be an open question. Various efficient attacks have been proposed for various sets of parameters. (See R. Endsuleit, W. Geiselmann, and R. Steinwandt, “Attacking a polynomial-based cryptosystem: Polly Cracker” Int. Jour. Information Security, (1):143-148, 2002, and W. Geiselmann and R. Steinwandt, “Cryptanalysis of Polly Cracker”, IEEE Trans. Information Theory, (48):2990-2991, 2002.) Roughly speaking, parameters for which the underlying IMP is not hard because it is possible to recover the common root using Groebner bases. Modified versions of Polly Cracker have been proposed by Levy-dit-Vehel and Perret, and also by Ly (see above), but also with attacks (see R. Steinwandt, “A ciphertext-only attack on Polly Two, 2006”). See F. Levy-dit-Vehel, M. G. Marinari, L. Perret, and C. Traverso, “A Survey On Polly Cracker Systems”, for a survey of Polly Cracker cryptanalysis.
Ciphertext expansion in Polly Cracker is a serious problem. Add simply adds two ciphertext polynomials, and Mult multiplies them. In the worst-case, Mult operations are extremely expensive: the ciphertext length grows doubly-exponentially in the multiplicative depth of the circuit, since each Mult operation can square the number of monomials. Even with respect to the additive depth, the ciphertext size can grow exponentially. It is certainly conceivable that some incarnation of Polly Cracker could escape this deficiency and still be secure, but so far no such scheme is known.
BGN is a practical scheme that permits homomorphic evaluation of quadratic formulas—i.e., it allows one level of multiplication and an arbitrary number of additions. It is an interesting case because it uses multiple different representations of its underlying ring R. Specifically, KeyGen generates a modulus N=pq, two groups , 1 of order N with an efficiently computable non-degenerate bilinear map e: ×→1 (where typically  is an elliptic curve group and 1 is a multiplicative subgroup of a finite field), a generator g of , and an element h=gp. In terms of the abstract framework, the underlying ring R is /(N), which is represented in the public key both by (, g) and implicitly ((1, e(g, g)); we will call these the -representation and the 1-representation. The ideal I is (p), the p-residues; it can be sampled efficiently using h. Essentially, the underlying IMP is, given the representations of R, the map e, and the generator of I, to decide whether an element x∈R, given in -representation, is in I. (The BGN paper states its underlying hard problem in a different way, without the generator of I, that is equivalent up to a factor of 2 in the adversary's advantage.)
Adding two ciphertexts in BGN is done in the usual way, but the Mult operation is more interesting. Mult uses the pairing operation, meaning that it can only be applied to two ciphertexts in -representation, and the output has a 1-representation: i.e., for ψ1∈π1+(p) and ψ2∈π2+(p), Mult(ψ1, ψ2)=ψ1×ψ2∈π1×π2+(p), but the latter ciphertext represents the ring element differently (in 1-representation); concretely, this multiplication in the exponent occurs by computing c(gx, gx)→e(g, g)xy. Since there is no known way to efficiently map from the 1-representation back to the -representation, the scheme is limited to one level of multiplication.
To decrypt a ciphertext gπ+tp in  in BGN, the decrypter computes (gπ+tp)q=gπq, and then DLgqy(gπq)=π; it decrypts ciphertexts in 1 similarly. For the discrete logarithm computation to be feasible, π must be from a set of polynomial size—say, a polynomial-sized interval centered at 0. However, subject this constraint on the input ciphertexts {ψi} from , the scheme can homomorphically compute arbitrary polynomial-sized quadratic formulas on {ψi}, and still be able to decrypt the result in polynomial time.
In principle, one can also squeeze ElGamal into the above framework. One can view R as GL(2, p), the general linear group of 2×2 matrices over p, and an ideal Ib⊂R as the subset of matrices whose second row is b times the first column. Basically, Ib corresponds to the set of valid DDH tuples (g, ga, gb, gab) involving b. We can define addition in R as simply adding the matrices together entry-wise; Ib is closed under addition. This operation is efficient even if matrix is represented “in the exponent,” as in ElGamal, permitting the additive homomorphishm. Multiplication in R is right-multiplication; one can see that right-multiplying a term in Ib with a term in R gives a term in Ib. However, obviously right-multiplication cannot be efficient if the Diffie-Hellman problem is hard.
Strictly speaking, however, since none of these schemes aside from Polly Cracker actually makes full use of the ring homomorphism, their dependence on an IMP may be more coincidental than essential. For example, one can modify BGN in a way that preserves the ability to evaluate quadratic formulas, while dispensing with the need to use a composite modulus N, and without using an ideal membership problem; instead, it is based on a “rank” problem similar to the linear assumption. On the other hand, this modification would become exponentially inefficient if extended to handle n-degree polynomials over ciphertexts with a hypothetical n-linear map; for this more robust homomorphism, it would seem more efficient to use BGN's original ideal-membership approach.
4 Bootstrappable Encryption
4.1 Leveled Fully Homomorphic Encryption from Bootstrappable Encryption, Generically
Assume we have an encryption scheme ε that compactly evaluates some set of circuits ε. We want to use ε to construct a homomorphic encryption scheme that can handle arbitrary circuits. In this Section we prove a fundamental result: that if ε contains (slight augmentations of) ε's own decryption circuit Dε—i.e., if ε “compactly evaluates” its (augmented) decryption circuit—then we can use ε to construct an efficient scheme that handles circuits of arbitrary depth.
A bit more specifically, for any integer d, we use ε to construct a scheme ε(d) that can compactly evaluate circuits of depth up to d. The decryption circuit for ε(d) is still Dε; the secret key and ciphertexts are the same size as in ε. The public key in ε(d) consists of d+1 public keys from ε, together with a chain of encrypted ε secret keys—the first ε secret key encrypted under the second ε public key, and so on. In short, the family of schemes {ε(d)} is leveled fully homomorphic. We base the semantic security of ε(d) on that of ε using a hybrid argument; as usual with hybrid arguments, the reduction loses a factor linear in d. In Section 4.3, we describe how one can obtain a fully homomorphic encryption scheme (where the public key size does not depend on the maximum number of levels we want to evaluate) by assuming key-dependent-message (KDM) security, specifically circular-security—i.e., that one can safely encrypt a ε secret key under its associated public key.
Since this critical property of ε—that it can compactly evaluate (slight augmentations of) its own decryption circuit—is self-referential and universal, we give it the obvious name: bootstrappability. Why should bootstrappability be such a powerful feature? At a high level, the reason is that bootstrappability allows us periodically to “refresh” ciphertexts associated to interior nodes in a circuit; we can refresh for an arbitrary number of levels in the circuit, and thus can evaluate circuits of arbitrary depth. To “refresh” a ciphertext that encrypts a plaintext π under ε public key pki, we re-encrypt it under pki+1 and then homomorphically apply the decryption circuit to the result, using the secret key ski that is encrypted under pki+1, thereby obtaining an encryption of π under pki+1. Homomorphically evaluating the decryption circuit decrypts the inner ciphertext under pki, but within homomorphic encryption under pki+1. The implicit decryption “refreshes” the ciphertext, but the plaintext is never revealed; the plaintext is always covered by at least one layer of encryption. Now that the ciphertext is refreshed, we can “continue” correctly evaluating the circuit.
To see how this works mathematically, begin by considering the following algorithm, called Recrypt. For simplicity, suppose the plaintext space  is {0, 1} and Dε is a boolean circuit in ε. Let (sk1, pk1) and (sk2, pk2) be two ε key-pairs. Let φ1 be an encryption of π∈ under pk1. Let sk1j be an encryption of the j-th bit of the first secret key sk1 under the second public key pk2. Recrypt takes as these things as input, and outputs an encryption of π under pk2.
Recrypt(pk2, Dε,  sk1j, ψ1).




  
    Set
    ⁢
    
      
    
    ⁢
    
      
        ψ
        
          1
          ⁢
          j
        
      
      _
    
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Encrypt
      ɛ
    
    ⁡
    
      (
      
        
          pk
          2
        
        ,
        
          ψ
          
            1
            ⁢
            j
          
        
      
      )
    
  




where ψ1j is the j-th bit of ψ1 

    
    
        Set ψ2←Evaluateε(pk2, Dε,  sk1j,  ψ1j)
        Output ψ2 

Above, the Evaluate algorithm takes in all of the bits of sk1 and all of the bits of ψ1, each encrypted under pk2. Then, ε is used to evaluate the decryption circuit homomorphically. The output ψ2 is thus an encryption under pk2 of Decryptε(sk1, ψ1)→π.

Remark 4.1. The Recrypt algorithm implies a proxy one-way re-encryption scheme. (See M. Blaze, G. Bleumer, and M. Strauss, “Divertible protocols and atomic proxy cryptography”, Eurocrypt '98, LNCS 1403, pp. 127-144.) Roughly speaking, a one-way proxy re-encryption scheme allows the owner of sk1 to generate a tag that enables an untrusted proxy to convert an encryption of π under pk1 to an encryption of π under pk2, but not the reverse. In our case, the tag is sk1j, the encrypted secret key. Strictly speaking, the security model for proxy re-encryption typically requires the security of the delegator's secret key, even against a collusion of delegatee's who also get to see the delegating tags. However, this requirement seems unnecessary, since a delegatee will be able to decrypt ciphertexts directed to the delegator anyway.

    
    


In the Recrypt algorithm above, the plaintext π is doubly encrypted at one point—under both pk1 and pk2. Depending on the encryption scheme ε, however, this double encryption might be overkill. Suppose WeakEncryptε is an algorithm such that the image of WeakEncryptε(pk, π) is always a subset of the image of Encryptε(pk, π). Then we can replace the first step of Recryptε with:

    
    
        Set
    
    






  
    
      ψ
      
        1
        ⁢
        j
      
    
    _
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        WeakEncryp
        ⁢
        t
      
      ɛ
    
    ⁡
    
      (
      
        
          pk
          2
        
        ,
        
          ψ
          
            1
            ⁢
            j
          
        
      
      )
    
  




Set where ψ1j is the j-th bit of ψ1 

Let us call this relaxation Recrypt′ε. The main point of this relaxation is that WeakEncrypt does not need to be semantically secure for Recrypt′ε to be a secure one-way proxy re-encryption scheme, or for Recrypt′ε to be useful toward bootstrapping (as we will see below). Thus, depending on ε, WeakEncryptε can be very simple—e.g., for some schemes, and in particular for the ideal-lattice-based scheme that we describe later, WeakEncryptε might leave the input “bits” entirely unmodified. This will unfortunately not help us much in terms of making the encryption scheme bootstrappable; essentially, it will add one circuit level to what ε can evaluate. However, it will affect the eventual computational complexity of our scheme, since it will require less computation to apply the decryption circuit homomorphically to ciphertexts in which the outer encryption is weak. Another way of viewing this relaxation is that we only need to be able to evaluate non-uniform decryption circuits, where the ciphertext is “hard-wired” into the circuit (making this circuit simpler than the “normal” decryption circuit that takes the ciphertext (and secret key) as input.

To be bootstrappable, ε needs to be able to compactly evaluate not only its decryption circuit, which merely allows recryptions of the same plaintext, but also slightly augmented versions of it, so that we can perform binary operations on plaintexts and make actual progress through a circuit.
Definition 4.2 (Augmented Decryption Circuit). Let Dε be ε's decryption circuit, which takes a secret key and ciphertext as input, each formatted as an element of l(λ), where  is the plaintext space. Let Γ be a set of gates with inputs and output in , which includes the trivial gate (input and output are the same). We call a circuit composed of multiple copies of Dε connected by a single g gate (the number of copies equals the number of inputs to g) a “g-augmented decryption circuit.” We denote the set of g-augmented decryption circuits, g∈Γ, by Dε(Γ).

Definition 4.3 (Bootstrappable Encryption Scheme). As before, let ε denote the set of circuits that ε can compactly evaluate. We say that ε is bootstrappable with respect to Γ if

Dε(Γ)⊂ε.

ε is simply bootstrappable if ε is bootstrappable with respect to Γ for some complete set of gates Γ.

For example, if Γ includes the trivial gate and NAND, ε is bootstrappable with respect to Γ if ε contains Dε and the circuit formed by joining two copies of Dε with a NAND gate. Remarkably, as we will show, if there is a scheme ε that can compactly evaluate only these two circuits, then there is a scheme that is leveled fully homomorphic.
Remark 4.4. We could relax the bootstrappability definition slightly to say that ε only needs to be able to homomorphically evaluate its (augmented) decryption circuit when the input ciphertext is weakly encrypted, similar to the relaxation Recrypt′ε above. The reason that we did not state the definition this way is that it makes the definition of bootstrappable more cumbersome. Below, we will continue with the definition above, and remind the reader occasionally that the relaxation can be used. However, it will be understood that “bootstrappable” in the broader sense will include the case of when the input ciphertext is weakly encrypted.
From the informal description above, it should already be somewhat clear how to use a bootstrappable encryption scheme to construct a leveled fully homomorphic one; below, we give a more formal description. Let ε be bootstrappable with respect to a set of gates Γ. For any integer d≧1, we use ε to construct a scheme ε(d)=(KeyGenε(d), Encryptε(d), Evaluateε(d), Decryptε(d)) that can handle all circuits of depth d with gates in F. Note that in the description below we encrypt the secret keys in reverse order; the only reason is that this ordering simplifies our description of the recursion in Evaluate. When we refer to the level of a wire in C, we mean the level of the gate for which the wire is an input. We use the notation Dε(Γ, δ) to refer to the set of circuits that equal a δ-depth circuit with gates in Γ augmented by Dε(copies of Dε become inputs to the δ-depth circuit).
KeyGenε(d) (λ, d). Takes as input a security parameter λ and a positive integer d. For l=l(λ) as in Definition 4.2, it sets




  
    
      
        
          (
          
            
              sk
              i
            
            ,
            
              pk
              i
            
          
          )
        
        ⁢
        
          ←
          R
        
        ⁢
        
          
            KeyGen
            ɛ
          
          ⁡
          
            (
            λ
            )
          
        
      
    
    
      
        
          for
          ⁢
          
            
          
          ⁢
          i
        
        ∈
        
          [
          
            0
            ,
            d
          
          ]
        
      
    
  
  
    
      
        
          sk
          ij
        
        ⁢
        
          ←
          R
        
        ⁢
        
          
            Encrypt
            ɛ
          
          ⁡
          
            (
            
              
                pk
                
                  i
                  -
                  1
                
              
              ,
              
                sk
                ij
              
            
            )
          
        
      
    
    
      
        
          
            for
            ⁢
            
              
            
            ⁢
            i
          
          ∈
          
            [
            
              1
              ,
              d
            
            ]
          
        
        ,
        
          j
          ∈
          
            [
            
              1
              ,
              l
            
            ]
          
        
      
    
  




where ski1, . . . , skil is the representation of ski as elements of . It outputs the secret key sk(d)←sk0 and the public key pk(d)←(pki,  skij). Let ε(δ) refer to the sub-system that uses sk(δ)←sk0 and pk(δ)←(pkii∈[0,δ],  skiji∈[1,δ]) for δ≦d.

Encryptε(d)(pk(d), π). Takes as input a public key pk(d) and a plaintext π∈. It outputs a ciphertext





  ψ
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        Encrypt
        ɛ
      
      ⁡
      
        (
        
          
            pk
            d
          
          ,
          π
        
        )
      
    
    .
  




Decryptε(d)(sk(d), ψ). Takes as input a secret key sk(d) and a ciphertext ψ (which should be an encryption under pk0). It outputs Decryptε(sk0, ψ).

Evaluateε(δ)(pk(δ), Cδ, Ψδ). Takes as input a public key pk(δ), a circuit Cδ of depth at most δ with gates in Γ, and a tuple of input ciphertexts Ψδ (where each input ciphertext should be under pkδ). We assume that each wire in Cδ connects gates at consecutive levels; if not, add trivial gates to make it so. If δ=0, it outputs Ψ0 and terminates. Otherwise, it does the following:

    
    
        Sets (Cδ−1†, Ψδ−1†)←Augmentε(δ)(pk(δ), Cδ, Ψδ).
        Sets (Cδ−1, Ψδ−1)←Reduceε(δ−1)←(pk(δ−1), Cδ−1, Ψδ−1).
        Runs Evaluateε(δ−1)(pk(δ−1), Cδ−1, Ψδ−1).

Augmentε(δ)(pk(δ), Cδ, Ψδ). Takes as input a public key pk(δ), a circuit Ψδ of depth at most δ with gates in Γ, and a tuple of input ciphertexts Ψδ (where each input ciphertext should be under pkδ). It augments Cδ with Dε; call the resulting circuit Cδ−1†. Let Ψδ−1† be the tuple of ciphertexts formed by replacing each input ciphertext ψ∈Ψδ by the tuple  skδj,  ψj, where ψj←WeakEncryptε(δ−1)(pk(δ−1), ψj) and the ψj's form the properly-formatted representation of ψ as elements of . It outputs (Cδ−1†, Ψδ−1†).

Reduceε(δ)(pk(δ), Cδ†, Ψδ†). Takes as input a public key pk(δ), a tuple of input ciphertexts Ψδ† (where each input ciphertext should be in the image of Encryptε(δ)), and a circuit Cδ†∈Dε(Γ, δ+1). It sets Cδ to be the sub-circuit of Cδ† consisting of the first δ levels. It sets Ψδ to be the induced input ciphertexts of Cδ, where the ciphertext ψδ(w) associated to wire w at level δ is set to Evaluateε(pkδ, Cδ(w), Ψδ(w)), where Cδ(w) is the sub-circuit of Cδ† with output wire w, and Ψδ(w) are the input ciphertexts for Cδ(w). It outputs (Cδ, Ψδ).

High-level review of the Evaluate algorithm. We are given a circuit Cd of, say, d levels with gates in Γ. For each input wire w of Cd, there is an associated input ciphertext ψw encrypted under pkd. We are also given an encryption scheme ε that compactly evaluates circuits in Dε(Γ).

    
    


Note that we have not assumed that ε can evaluate gates in Γ; we have only assumed it can evaluate gates in Γ that are augmented by the decryption circuit. So, our first step is to augment Cd by placing copies of Dε at the leaves of Cd (as in Augment), thereby constructing Cd−1†. Now, what are the input ciphertexts for our new circuit Cd−1†?
Reconsider the algorithm Recrypt′ε. In Recrypt′ε, we begin with a ciphertext ψ1 encrypting π under pk1 for the single wire w, and an “empty” circuit C1 (since Recrypt′ε doesn't actually evaluate any gates, it just generates a new encryption of the same plaintext). Our next step was to augment C1 with the decryption circuit Dε to obtain C2←Dε. The input ciphertexts Ψ2 to C2 included the encrypted secret key bits, and the weakly encrypted bits of ψ1. We then showed that the ciphertext generated by ψ2←Evaluateε(pk2, C2, Ψ2), which is also associated to wire w, also encrypts π, but now under pk2.
In the full scheme above, the ciphertexts that we associate to the decryption circuit that was attached to wire w are analogous to the ones we used in Recrypt′ε: the encrypted secret key (skd under pkd−1), and the re-encryption ciphertexts of ψw under pkd−1. By the correctness of Recrypt, the ciphertext now associated to w (after performing Evaluateε) should encrypt the same plaintext as ψw, but now under pkd−1.
The Reduce step simply performs this Evaluate up to the wire w, and one level beyond. We know that Evaluate can correctly continue one level beyond the wire w, because (by assumption) ε can evaluate not just the decryption circuit attached to w, but can evaluate a circuit containing one Γ-gate above w. Reduce outputs Cd−1 and ciphertexts associated to Cd−1's input wires. We have made progress, since Cd−1 is one level shallower than Cd. We perform this entire process d−1 more times to obtain the final output ciphertexts.
Remark 4.5. Previously, we said that Evaluate takes as input ciphertexts that are “fresh” outputs of Encrypt. However, we note Evaluateε(δ) also operates correctly on ciphertexts output by Evaluate. (For δ<d above, this is precisely what Evaluateε(δ) does.)

4.2 Correctness, Computational Complexity and Security of the Generic Construction

Here we state and prove some theorems regarding the generic construction. Regarding correctness, we have the following theorem.

Theorem 4.6. Let ε be bootstrappable with respect to a set of gates Γ. Then ε(d) compactly evaluates all circuits of depth d with gates in Γ—i.e., if Γ is a universal set of gates, the family ε(d) is leveled fully homomorphic.

Proof. (Theorem 4.6) First, we define a convenient notation: let D(δ, w, C, Ψ) denote the plaintext value for wire w in circuit C induced by the decryptions (under skδ) of the ciphertexts Ψ associated to C's input wires. If C is empty (has no gates), then the input wires are the same as the output wires, and D(δ, w, C, Ψ) just denotes the decryption of the single ciphertext ψ∈Ψ associated to w. To prove correctness, it suffices to show that

D(d,wout,Cd,Ψd)=D(0,wout,C0,Ψ0)  (1)

for every output wire wout of C0 (at level 0).

First, when (Cδ−1†, Ψδ−1†)←Augmentε(δ)(pk(δ), Cδ, Ψδ), we claim that D(δ, w, Cδ, Ψδ)=D(δ−1, w, Cδ−1†, Ψδ−1†) for any wire w at level at most δ−1. This follows from the correctness of Recrypt (generalized beyond a boolean plaintext space and boolean circuits), and the fact that circuits Cδ and Cδ−1† are identical up to level δ−1.
Next, when (Cδ, Ψδ)←Reduceε(δ)(pk(δ), Cδ†, Ψδ†), we have D(δ, w, Cδ†, Ψδ†)=D(δ, w, Cδ, Ψδ) for any wire at level at most δ. This follows from the correctness of Evaluateε over circuits in Dε(Γ), and the fact that circuits Cδ† and Cδ are identical up to level δ.
From these two claims, Equation 1 follows.
Note that Γ is arbitrary. For example, each gate in Γ could be a circuit of (ANDs, ORs, NOTs) of depth m and fan-in 2; for this value of Γ, Theorem 4.6 implies the scheme correctly evaluates boolean circuits up to depth d·m.
We need to check that the computational complexity of Evaluateε(d) is reasonable—e.g., that recursive applications of Augment do not increase the effective circuit size exponentially.
Theorem 4.7. For a circuit C of depth at most d and size s (defined here as the number of wires), the computational complexity of applying Evaluateε(d) to C is dominated by at most s·l·d applications of WeakEncryptε and at most s·d applications of Evaluateε to circuits in Dε(Γ), where l is as in Definition 4.2.

Proof. (Theorem 4.7) There is a pre-processing step to ensure that all wires in the circuit connect gates at consecutive levels; clearly, this step increases the number of wires in the circuit by at most a multiplicative factor of d. It remains to prove that, for the pre-processed circuit, the computational complexity is dominated by at most s′·l applications of Encrypt and at most s′ applications of Evaluateε to circuits in Dε(Γ), where s′ is the size of the pre-processed circuit.

The complexity of Augmentε(δ)(pk(δ), Cδ, Ψδ) is dominated by replacing each ciphertext ψ∈Ψδ by the ciphertexts  skδj,  ψj; generating the  ψj's involves |Wδ|·l applications of WeakEncryptε, where Wδ is the set of wires at level δ. Summing over all δ, there are at most s′·l applications of WeakEncryptε.
The complexity of Reduceε(δ)(pk(δ), Cδ†, Ψδ†) is dominated by the evaluation of Cδ(w) for each w∈Wδ, which involves |Wδ| applications of Evaluateε to circuits in Dε(Γ). Summing over all δ, there are at most s′ such applications. The theorem follows.
Finally, assuming the semantic security of ε, we prove the semantic security of ε(d).
Theorem 4.8. Let  be an algorithm that (t, ∈)-breaks the semantic security of ε(d). Then, there is an algorithm  that (t′, ∈′)-breaks the semantic security of ε for t′≈t·l and ∈′≧∈/l(d+1), for l as in Definition 4.2.
Proof. (Theorem 4.8) Let (ε)l be equivalent to ε, but with plaintext space ≦l, where Encrypt(ε)l involves up to l invocations of ε and a concatenation of the results. We use a hybrid argument to show that (t′′, ∈′′)-breaks the semantic security of (ε)l for t′′≈t and ∈′′≧∈/(d+1), from which the result follows.
For k∈[0, d], let Game k denote a game against ε(d) in which everything is exactly as in the real-world game, except that for all i∈[1, k] the challenger sets




  
    (
    
      
        sk
        i
        ′
      
      ,
      
        pk
        i
        ′
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        KeyGen
        ɛ
      
      ⁡
      
        (
        λ
        )
      
    
    ⁢
    
      
    
    ⁢
    and
    ⁢
    
      
    
    ⁢
    
      sk
      ij
    
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Encrypt
      ɛ
    
    ⁡
    
      (
      
        
          pk
          
            i
            -
            1
          
        
        ,
        
          sk
          ij
          ′
        
      
      )
    
  




In other words, for i∈[1, k], skij is the encryption (under pki−1) of the j-th bit of a random secret key sk′i unrelated to ski. Game d+1 is identical to Game d, except that the challenger ignores b and (π0, π1), generates a random plaintext π of the appropriate length, and encrypts π to construct the challenge ciphertext. Let ∈k denote the adversary's advantage in Game k.

Since Game 0 is identical to the real world attack, the adversary's advantage is ∈ by assumption. Also, ∈d+1=0, since the challenge is independent of b. Consequently, for some k∈[0, d], it must hold that |∈k−∈k+1|≧∈/(d+1); fix this value of k.
 uses  to break (ε)l as follows.  receives from the challenger a public key pk.  generates the secret and public values exactly as in Game k, except that it replaces its original value of pkk with pk. Also, if k<d, it generates a dummy key pair




  
    
      (
      
        
          sk
          
            k
            +
            1
          
          ′
        
        ,
        
          pk
          
            k
            +
            1
          
          ′
        
      
      )
    
    ⁢
    
      ←
      R
    
    ⁢
    
      
        KeyGen
        ɛ
      
      ⁡
      
        (
        λ
        )
      
    
  
  ,




sets π0←skk+1 and π1←sk′k+1, and requests a challenge ciphertext (under pk) encrypting either π0, π1∈l. The challenger generates





  β
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and sends a tuple of ciphertexts ψj encrypting the bits πβj.  replaces its original tuple  sk(k+1)j with the tuple ψj. One can verify that the public values are generated exactly as in Game k+β.  sends the public values to .

Eventually,  requests a challenge ciphertext on π0 or π1.  sets




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    
      {
      
        0
        ,
        1
      
      }
    
    .
  




If k<d,  sends the values





  
    ψ
    j
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        Encrypt
        ɛ
      
      ⁡
      
        (
        
          
            pk
            d
          
          ,
          
            π
            bj
          
        
        )
      
    
    .
  




If k=d,  generates random





  π
  ⁢
  
    ←
    R
  
  ⁢
  p




and asks the challenger for a challenge ciphertext on πb or π. The challenger generates





  β
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and encrypts πb or π accordingly, and  forwards the challenge to .  sends a bit b′.  sends bit β′←b⊕b′ to the challenger. One can verify that the challenge is generated as in Game k+β.

Since 's simulation has the same distribution as Game k+β, and the probability that  outputs 0 is ∈k+β. The result follows.
4.3 Fully Homomorphic Encryption from KDM-Secure Bootstrappable Encryption
The length of the public key in ε(d) is proportional to d (the depth of the circuits that can be evaluated). It would be preferable to have a construction ε* where the public key size is completely independent of the circuit depth, a construction that is fully homomorphic rather than merely leveled fully homomorphic. Here is the obvious way to make the public key pk* of ε* short: for ε key pair (sk, pk), pk* includes only pk and (the “bits” of) sk encrypted under pk. In other words, we have a cycle (in fact, a self-loop in this example) of encrypted secret keys rather than an acyclic chain. It is clear that ε* is correct: the recursive algorithm Evaluateε* works as before, except that the implicit recryptions generate “refreshed” ciphertexts under the same public key.
Why didn't we present this construction in the first place? Using an acyclic chain of encrypted secret keys allowed us to base the security of ε(d) on ε using a hybrid argument; this hybrid argument breaks down when there is a cycle. In general, a semantically secure encryption scheme is not guaranteed to be KDM-secure—i.e., secure when the adversary can request the encryptions of key-dependent messages, such as the secret key itself. Typically, when we prove an encryption scheme semantically secure, there is not an obvious attack when the adversary is given the encryption of a key-dependent message. However, KDM-security is highly nontrivial to prove. The problem is precisely that the usual hybrid argument breaks down.
Remark 4.9. Canetti proposed the acyclic, leveled approach as a way to remove the need for KDM-security. Our initial approach had actually been to use ε* (with the self-loop), and assume, or try to prove, KDM-security.
Let us review (a restriction of) the definition of KDM-security. We will say a scheme ε is KDM-secure if all polynomial-time adversaries  have negligible advantage in the following KDM-security game.
KDM-Security Game.
Setup(λ,n). The challenger sets




  
    (
    
      
        sk
        i
      
      ,
      
        pk
        i
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    KeyGen
    ⁡
    
      (
      λ
      )
    
  




for e∈[0, n−1] for integer n=poly(λ). It chooses a random bit





  b
  ⁢
  
    ←
    R
  
  ⁢
  
    
      {
      
        0
        ,
        1
      
      }
    
    .
  




If b=0, then for i∈[0, n−1] and j∈[1,l], it sets





  
    
      
        sk
        ij
      
      _
    
    ⁢
    
      ←
      R
    
    ⁢
    
      
        Encrypt
        ɛ
      
      ⁡
      
        (
        
          
            pk
            
              
                (
                
                  i
                  -
                  1
                
                )
              
              ⁢
              modn
            
          
          ,
          
            sk
            ij
          
        
        )
      
    
  
  ,




where skij is the jth “bit” of ski. If b=1, it generates the skij values as encryptions of random secret keys, unrelated to pk0, . . . , pkn−1. It sends the public keys and encrypted secret keys to .

Challenge and Guess. Basically as in the semantic security game.

This definition of KDM-security is a restriction of the general setting, where  can select multiple functions ƒ, and request the encryption of ƒ(sk0, . . . , skn−1). However, when ε is a bootstrappable encryption scheme,  can use the cycle of encrypted secret keys in our game to generate the encryption of ƒ(sk0, . . . , skn−1) under any pki, as long as ƒ can be computed in polynomial time. Hence, we only need to consider our restricted setting. We have the following theorem.
Theorem 4.10. Suppose ε is KDM-secure and also bootstrappable with respect to a universal set of gates Γ. Then, ε*, obtained from ε as described above (with the self-loop), is semantically secure (and fully homomorphic).
The theorem is a straightforward consequence of the fact that, from any loop of public keys and encrypted secret keys that includes (pk0, sk0), one can compute an encryption of sk0 under pk0. There does not seem to be any advantage in having pk* contain any cycle of encrypted secret keys other than a self-loop.
Absent proof of KDM-security in the plain model, one way to obtain fully homomorphic encryption from bootstrappable encryption is simply to assume that the underlying bootstrappable encryption scheme is also KDM-secure. This assumption, though unsatisfying, does not seem completely outlandish. While an encrypted secret key is very useful in a bootstrappable encryption scheme—indeed, one may view this as the essence of bootstrappability—we do not see any actual attack on a bootstrappable encryption scheme that provides a self-encrypted key.
4.4 Fully Homomorphic Encryption from Bootstrappable Encryption in the Random Oracle Model
Above, we constructed a fully homomorphic encryption ε* from a bootstrappable encryption scheme ε basically by adding a “self-loop”—a ε secret key sk encrypted under its corresponding public key pk—to the ε* public key pk*. We showed that ε* should inherit the semantic security of ε, under the assumption that ε is KDM-secure—in particular, under the assumption that it is “safe” to reveal a direct encryption of a secret key under its own public key (as opposed to some possibly-less-revealing non-identity function of the secret key). Can we provide any evidence that ε* is semantically secure without this assumption?
Here we provide some evidence in the random oracle model. First, given a leveled fully homomorphic scheme ε(d) and a hash function, we define an intermediate scheme ε(d)†. ε(d)† the same as ε(d), except for the following. The public key includes a hash function H: l′→l. Also, in KeyGen, one generates




  
    r
    ⁢
    
      ←
      R
    
    ⁢
    
      p
      
        l
        ′
      
    
  
  ,




sets





  
    
      r
      j
    
    _
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Encrypt
      
        ɛ
        
          (
          d
          )
        
      
    
    ⁡
    
      (
      
        
          pk
          
            (
            d
            )
          
        
        ,
        
          r
          j
        
      
      )
    
  




for j∈[1, l′], sets σ←H(r)* , sk0, and includes ( rj, σ) in the public key. (Assume * , is some invertible operation such that a* b would completely hide b∈l if a∈l were a one-time pad.) In other words, the ε(d)† public key includes some additional information: an encryption of the secret key sk0, where the encryption uses a hash function that will be treated as a random oracle in the security analysis. Next, we prove the following theorems.

Theorem 4.11. If ε(d) is semantically secure, then ε(d)† is semantically secure in the random oracle model.

Theorem 4.12. Suppose ε is leveled circuit-private (in addition to being bootstrappable) and let ε(d)† and ε* be constructed from ε as described above. Then, if ε(d)† is semantically secure (in the plain model), and the circuit required to compute the hash function H and invert the * operation is at most d levels, then ε* is semantically secure.

The result here should be quite surprising. The scheme ε* does not even contain a hash function, and yet we are basically claiming that it is secure in the random oracle model! This is the first instance that we are aware of where one scheme is proven secure in the random oracle model, and then a second scheme's security is based on the first scheme, even though the second scheme does not use a hash function.
How is this possible? First, let us consider Theorem 4.11. This theorem basically just states the previously known result that it is easy to construct a KDM-secure encryption scheme in the random oracle model. This is because the random oracle allows the reduction to construct a “fake” ciphertext purportedly encrypting the secret key, such that the adversary finds out that it was fake only after it has queried the random oracle; this query gives the reduction all of the information that it needs to solve the underlying problem. In our particular case, ε(d)† has a loop among (sk0, pk0), . . . , (skd, pkd), because ε(d) reveals direct encryptions of ski under pki−1 for i∈[1, d], and ε(d)† also reveals an indirect encryption ( rj, σ) of sk0 under pkd (“indirect,” because encryption in ε does not normally use a hash function). However, the reduction algorithm in the proof of Theorem 4.11 will construct a simply as a random string—i.e., it does not actually need to know anything about sk0.
Theorem 4.12 is perhaps the more surprising result. But the result is actually a simple consequence of the fact that: given a correctly constructed ε(d)† public key, the reduction algorithm can generate an ε-encryption of sk0 under pk0, as needed for the ε* public key. How do we generate the latter ciphertext? The reduction algorithm is given  rj, an encryption of r under pkd. It simply uses the leveled homomorphism and the circuit corresponding to the hash function H to compute a ciphertext that encrypts H(r) from the ciphertext that encrypts r. Then, given that ciphertext and the value of σ=H(r)* sk0, it computes a ciphertext that encrypts sk0 in the natural way—i.e., directly, rather than with the hash function. We assumed that the hash function H and the * operation can be computed with a circuit of depth at most d; therefore, our leveled homomorphic scheme ε(d) has enough levels to evaluate this circuit. Consequently, we obtain a “natural” encryption of sk0 (i.e., under ε) under some public key pki for i≧0, and we can use Recrypt operations to obtain a natural encryption of sk0 under pk0. This ciphertext is an output of Evaluateε, but circuit privacy guarantees that the ciphertext is distributed as if it were output directly by Encryptε.
Remark 4.13. Although one can view ( rj, σ) as an “encryption” of sk0, this “encryption” function is not the usual encryption function and it might have a very complex decryption circuit, much more complex than Dε. In particular, we cannot assume that its decryption circuit is in ε. This why we needed many (d) levels in the leveled scheme to recover sk0, and could not immediately use a self-loop from the outset.
So, if ε* is secure in the random oracle model despite not using a hash function, does that imply that it is secure in the plain model? Certainly not. The obstacle to this conclusion is obviously that random oracles cannot be instantiated in general. (See R. Canetti, O. Goldreich, and S. Halevi, “The random oracle methodology, revisited”, in Proc. of STOC '98, pages 209-218, ACM, 1998.) A bit more specifically, however, the obstacle is that the proof of Theorem 4.12 depends crucially on the correctness of the ciphertext ( rj, σ) in ε(d)† to construct (homomorphically) an encryption of sk0 under pk0 as needed for the ε* public key; however, in the proof of Theorem 4.11 the ciphertext is not correct (except with negligible probability): the adversary finds out that it was fake only after it has queried r to the random oracle, giving the reduction all the information it needs.
Proof. (Theorem 4.11) Let  be an algorithm that attacks the semantic security of ε(d)†; from , we construct an algorithm  that attacks the semantic security of ε(d).  will actually request l′+1 challenge ciphertexts; thus, the reduction loses a factor of l′+1 under the usual hybrid argument.
The challenger gives  a ε(d) public key. It also sets a bit




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    
      {
      
        0
        ,
        1
      
      }
    
    .
  




 selects two messages r(0), r(1)∈l′ and sends them to the challenger. The challenger sets





  Ψ
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      
        Encrypt
        ⁡
        
          (
          
            
              pk
              d
            
            ,
            
              r
              j
              
                (
                b
                )
              
            
          
          )
        
      
      ;
      
        j
        ∈
        
          [
          
            1
            ,
            
              l
              ′
            
          
          ]
        
      
    
    }
  




and sends back Ψ. The following is included in the public key that  sends to : the public key for ε(d) sent by the challenger, the set of ciphertexts Ψ, and





  σ
  ⁢
  
    ←
    R
  
  ⁢
  
    
      p
      l
    
    .
  




 requests a challenge ciphertext on one π0, π1∈.  forwards the query to the challenger, who responds with a ciphertext encrypting πb, which  forwards to .
Eventually, either  queries some r′∈{r(0), r(1)} to the random oracle, or  finishes with a guess b′. In the former case,  sets b′ so that r′=r(b′). In either case,  sends b′ as its guess to the challenger.
Let p be the probability that  queries some r′∈{r(0), r(1)} to the random oracle. 's simulation appears perfect to  if it does not query some r′∈{r(0), r(1)}; in this case, which occurs with probability 1−p, 's advantage is at least ∈. Since 's view is independent of r(1−b), the probability that it queries r(b) to the random oracle is at least p−qH/||l′, where qH is the number of random oracle queries make by . Overall 's advantage in guessing b′ is at least (1−p)∈+p−qH/||l′≧∈−qH/||l′.
Proof. (Theorem 4.12) The proof is essentially a simple consequence of the fact that, given a public key for ε(d)†, it is easy to generate the public key for ε* homomorphically.
Let  be an algorithm that breaks the semantic security of ε*. We use  to construct an algorithm  that breaks the semantic security of ε(d)†.
 receives a ε(d)† public key from the challenger. This public key consists of pkii∈|0,∈|,  skiji∈[1,δ],  rjj∈[1,l′], and σ=H(r)*sk0. From  rj,  uses the homomorphism of ε(d) to compute ciphertexts Ψ that encrypt H(r). It encrypts σ, and then uses the homomorphism to recover to obtain an encryption of sk0 from the encryptions of H(r) and σ (inverting the * operation). By assumption, these homomorphic operations take at most d levels. If it takes only δ<d levels, and we obtain an encryption of sk0 under pkd−δ, then we can perform Recrypt operations until we have the desired encryption of sk0 under pk0. By circuit privacy, this ciphertext is distributed properly.  includes the encryption of sk0 under pk0 as the encrypted secret key contained in the public key for ε* that it provides to .
 requests a challenge ciphertext on one π0, π1∈.  forwards the query to the challenger, who responds with a ciphertext encrypting πb.  uses Recrypt operations to obtain an encryption of πb under pk0 and forwards the result to .  sends a guess b′, which  forwards to the challenger.
Clearly, 's advantage is the same as 's.
5 An Abstract Scheme Based on the Ideal Coset Problem
Our goal now is to construct a bootstrappable encryption scheme, a scheme that can homomorphically evaluate a rich set of circuits that includes its own decryption circuit, “plus some.” In the past, attempts to construct fully homomorphic encryption have focused solely on maximizing the complexity of the circuits that the scheme can evaluate. Our notion of bootstrapability gives us a different way of attacking the problem—by minimizing the complexity of the scheme's decryption circuit.
Our strategy for minimizing the circuit complexity of decryption is to avoid schemes like RSA and Diffie-Hellman, where decryption uses a complex high-nonparallelizable exponentiation operation. Instead, we give an embodiment of our scheme that uses ideal lattices. Decryption in lattice-based cryptosystems is typically dominated by a simple operation, such as an easily parallelizable matrix-vector multiplication. We begin describing the ideal-lattice-based scheme in Section 7, after providing some basic background on ideal lattices in Section 6.
In this Section, we describe our strategy for maximizing the “evaluative capacity” of the scheme abstractly, without reference to lattices. Generally speaking, our exposition strategy throughout the paper is to defer technical lattice details for as long as possible. One reason is to make the presentation more modular, and therefore easier to understand. Another reason is that some of our techniques—e.g., bootstrapping, and using techniques from server-aided cryptography to “squash the decryption circuit”—are general and can apply to schemes that use different underlying mathematics—e.g., linear codes, or something less similar to lattices.
5.1 The Ideal Coset Problem
We saw in Section 3 that many previous homomorphic encryption schemes base security on some ideal membership problem (IMP). For example, in the “Polly Cracker” scheme by Fellows and Koblitz, the public key consists of some multivariate polynomials that generate the ideal I of polynomials having a common root x, and π is encrypted by outputting a number




  ψ
  ⁢
  
    ←
    R
  
  ⁢
  
    π
    +
    
      I
      .
    
  




One can easily see that this is semantically secure if it is hard to distinguish membership in I—in particular, deciding whether ψ−π∈I. Unfortunately, one can also see that homomorphic operations, especially multiplication, expand the ciphertext size potentially exponentially in the depth.

For our embodiment using lattices, we apparently need a different abstract approach, since it is easy to distinguish membership in a lattice L: given a basis B of L and t∈n, one simply determines whether t mod B=0 mod B. Instead, we base security on an ideal coset problem (ICP), which we will state abstractly in terms of rings and ideals. Recall that a ring R is an algebraic object that is closed under addition ‘+’ and multiplication ‘×’ and additive inverse, with an additive identity ‘0’ and multiplicative identity ‘1’. An ideal I of a ring R is a subset satisfying a+b∈I and r×a∈I for all a, b∈I and r∈R. The sum and product of two ideals I and J are, respectively, {i+j:i∈I,j∈J} and the additive closure of {i×j:i∈I, j∈J}. Two ideals I and J are relatively prime if I+J=R. For example, if R=, the ideals (2) (the even integers) and (5) (the integers divisible by 5) are relatively prime: (2)+(5)=(1).
Now, the ideal coset problem (ICP) is as follows.
Definition 5.1 (Ideal Coset Problem (ICP)). Fix R, BI, algorithm IdealGen, and an algorithm Samp1 that efficiently samples R. The challenger sets




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and





  
    (
    
      
        B
        J
        sk
      
      ,
      
        B
        J
        pk
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      IdealGen
      ⁡
      
        (
        
          R
          ,
          
            B
            I
          
        
        )
      
    
    .
  




If b=0, it sets





  r
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Samp
      1
    
    ⁡
    
      (
      R
      )
    
  




and t←r mod BJpk. If b=1, it samples t uniformly from R mod BJpk. The problem: guess b given (t,BJpk).

Basically the ICP asks one to decide whether t is uniform modulo J, or whether it was chosen according to a known “dumpier” distribution induced by Samp1. Of course, the ICP will be impossible if Samp1 also samples uniformly modulo J, but the security of our encryption scheme will rely on the ICP being hard for a “dumpier” instantiation of Samp1; the hardness of the problem depends on the particular instantiation of Samp1. Note that it is possible for the ICP to be hard even when the IMP is easy.
5.2 An Abstract Scheme
We start by describing our initial attempt simply in terms of rings and ideals; we bring in ideal lattices later. In our initial scheme ε, we use a fixed ring R that is set appropriately according to a security parameter λ. We also use a fixed basis BI of a ideal I⊂R, and an algorithm Idea IGen(R, BI) that outputs public and secret bases BJpk and BJsk of some (variable) ideal J, such that I+J=R—i.e., I and J are relatively prime. We assume that if t∈R and BM is a basis for ideal M⊂R, then the value t mod BM is unique and can be computed efficiently—i.e., the coset t+M has a unique, efficiently-computable “distinguished representative” with respect to the basis BM. We use the notation R mod BM to denote the set of distinguished representatives of r+M over r∈R, with respect to the particular basis BM of M. We also use an algorithm Samp(BI, x) that samples from the coset x+I.
In the scheme, Evaluate takes as input a circuit C whose gates perform operations modulo BI. For example, an AddBI gate in C takes two terms in R mod BI, and outputs a third term in R mod BI, which equals the sum of the first two terms modulo I.
KeyGen(R, BI). Takes as input a ring R and basis BI of I. It sets




  
    (
    
      
        B
        J
        sk
      
      ,
      
        B
        J
        pk
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      IdealGen
      ⁡
      
        (
        
          R
          ,
          
            B
            I
          
        
        )
      
    
    .
  




The plaintext space  is (a subset of) R mod BI. The public key pk includes R, BI, BJpk, and Samp. The secret key sk also includes BJsk.

Encrypt(pk,π). Takes as input the public key pk and plaintext π∈. It sets ψ′←Samp(BI, π) and outputs ψ←ψ′ mod BJpk.

Decrypt(sk,ψ). Takes as input the secret key sk and a ciphertext ψ. It outputs

π←(ψ mod BJsk)mod BI 

Evaluate(pk, C, Ψ). Takes as input the public key pk, a circuit C in some permitted set ε of circuits composed of AddBI and MultBI gates and a set of input ciphertexts Ψ. It invokes Add and Mult, given below, in the proper sequence to compute the output ciphertext ψ. (We will describe ε when we consider correctness below. If desired, one could use different arithmetic gates.)

Add(pk, ψ1, ψ2). Outputs ψ1+ψ2 mod BJpk.

Mult(pk, ψ1, ψ2). Outputs ψ1×ψ2 mod BJpk.

Remark 5.2. Concerning IdealGen, it is fine if the secret basis BJsk defines a lattice (BJsk) for a (possibly fractional) ideal that contains J, rather than being exactly J.

Now, let us consider correctness, which is a highly nontrivial issue in this paper. The following definitions provide structure for our analysis.
To begin, we observe that the scheme is actually using two different circuits. First, Evaluate takes a mod-BI circuit C as input. This circuit is implicitly applied to plaintexts. Second, Evaluate applies a circuit related to C, which we call the generalized circuit, to the ciphertexts; this circuit uses the ring operations (not modulo I).
Definition 5.3 (Generalized Circuit). Let C be a mod-BI circuit. We say generalized circuit g(C) of C is the circuit formed by replacing C's AddBI and MultBI operations with addition ‘+’ and multiplication ‘×’ in the ring R.
Here are a few more definitions relevant to Theorem 5.7 below, which concerns correctness.
Definition 5.4 (XEnc and XDec). Let XEnc be the image of Samp. Notice that all ciphertexts output by Encrypt are in XEnc+J. Let XDec equal R mod BJsk, the set of distinguished representatives of cosets of J wrt the secret basis BJsk.
Definition 5.5 (Permitted Circuits). Let

ε′={C:∀(x1, . . . ,xt)∈XEnct,g(C)(xn, . . . ,xt)∈XDec}

In other words, ε′ is the set of mod-BI circuits that, when generalized, the output is always in XDec if the inputs are in XEnc. (The value t will of course depend on C.) If ε⊂ε′, we say that ε is a set of permitted circuits.

Definition 5.6 (Valid Ciphertext). ψ is a valid ciphertext wrt ε public key pk and permitted circuits ε if it equals Evaluate(pk, C, Ψ) for some C∈ε, where each ψ∈Ψ is in the image of Encrypt. The circuit C may be the identity circuit, in which case the output of Evaluate is simply an output of Encrypt.

Finally, we prove correctness with respect to ε.
Theorem 5.7. Assume ε is a set of permitted circuits containing the identity circuit. ε is correct for ε—i.e., Decrypt correctly decrypts valid ciphertexts.
Proof. For ciphertexts Ψ={ψ1, . . . , ψt}, ψk=πk+ik+jk, where πk∈, ik∈I, jk∈J, and πk+ik∈XEnc, we have

Evaluate(pk,C,Ψ)=g(C)(Ψ)mod BJpk∈g(C)(π1+i1, . . . ,πt+it)+J 

If C∈ε, we have g(C)(XEnc, . . . , XEnc)∈XDec and therefore





  
    
      
        
          Decrypt
          ⁡
          
            (
            
              sk
              ,
              
                Evaluate
                ⁡
                
                  (
                  
                    pk
                    ,
                    C
                    ,
                    Ψ
                  
                  )
                
              
            
            )
          
        
        =
        
        ⁢
        
          
            g
            ⁡
            
              (
              C
              )
            
          
          ⁢
          
            (
            
              
                
                  π
                  1
                
                +
                
                  i
                  1
                
              
              ,
              ...
              ⁢
              
                
              
              ,
              
                
                  π
                  t
                
                +
                
                  i
                  t
                
              
            
            )
          
          ⁢
          mod
          ⁢
          
            
          
          ⁢
          
            B
            I
          
        
      
    
  
  
    
      
        =
        
        ⁢
        
          
            g
            ⁡
            
              (
              C
              )
            
          
          ⁢
          
            (
            
              
                π
                1
              
              ,
              ...
              ⁢
              
                
              
              ,
              
                π
                t
              
            
            )
          
          ⁢
          mod
          ⁢
          
            
          
          ⁢
          
            B
            I
          
        
      
    
  
  
    
      
        =
        
        ⁢
        
          C
          ⁡
          
            (
            
              
                π
                1
              
              ,
              ...
              ⁢
              
                
              
              ,
              
                π
                t
              
            
            )
          
        
      
    
  




as required.

The bottom line is that we have proven that ε is correct for permitted circuits, and our goal now is to maximize this set. The permitted circuits are defined somewhat indirectly; they are the circuits for which the “error” g(C)(x1, . . . , xt) of the output ciphertext is small (i.e., lies inside XDec) when the input ciphertexts are in the image of Encryptε. When we begin to instantiate the abstract scheme with lattices and give geometric interpretations of XEnc and XDec, the problem of maximizing ε will have a geometric flavor.
Again, we note the rather confusing fact that C “automatically” reduces the result modulo BI, since it uses mod-BI gates. It does not particularly matter how these mod-BI gates are implemented; in particular, it is more confusing than helpful to imagine a boolean implementation of these gates. Instead, one should just observe that the generalized circuit manages to lazily emulate these gates, reducing its output modulo BI at the end of the computation. C's mod-BI operations are never actually “implemented;” they only occur implicitly. Later, when we consider whether our scheme is bootstrappable, and analyze the depth of the decryption circuit in terms of mod-BI gates, it will again be tempting to consider how these gates are “implemented.” But in fact these gates are “given” in the sense that they are emulated (without any intermediate reduction steps) by the usual ring operations.
5.3 Security of the Abstract Scheme
For the following abstract “instantiation” of Samp, and where I is a principle ideal generated by some s∈R (and s is encoded in BI), we provide a simple proof of semantic security based on the ICP.
Samp(BI,x). Run




  r
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        Samp
        1
      
      ⁡
      
        (
        R
        )
      
    
    .
  




Output x+r×s.

Obviously, the output is in x+I since s∈I.

Theorem 5.8. Suppose that there is an algorithm  that breaks the semantic security of ε with advantage ∈ when it uses Samp. Then, there is an algorithm , running in about the same time as , that solves the ICP with advantage ∈/2.

Proof. The challenger sends  a ICP instance (t, BJpk).  sets s, and sets the other components of pk in the obvious way using the ICP instance. When  requests a challenge ciphertext on one of π0, π1∈,  sets a bit





  β
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and sends back ψ←πβ+t×s mod BJpk.  sends back a guess β′, and  guesses b′←β⊕β′.

If b=0, we claim that 's simulation is perfect; in particular, the challenge ciphertext has the correct distribution. When b=0, we have that t=r+j, where r was chosen according to Samp1 and j∈J. So, ψ←πβ+t×s=πβ+r×s mod BJpk; the ciphertext is thus well-formed. In this case  should have advantage ∈, which translates into an advantage of ∈ for .
If b=1, then t is uniformly random modulo J. Since the ideal I=(s) is relatively prime to J, t×s is uniformly random modulo J, and consequently ψ is a uniformly random element of R mod BJpk that is independent of β. In this case 's advantage is 0. Overall, 's advantage is ∈/2.
6 Background on Ideal Lattices I: The Basics
From the abstract construction in Section 5, among the objects that we need to make concrete are: the ring R, the ideals I and J, how to compute t mod BM, the algorithms Samp and IdealGen, and a concrete version of the ICP. In this Section, we provide some basic background material needed to instantiate these things while using ideal lattices. Later, we will provide more background on ideal lattices as needed.

6.1 Basic Background on Lattices

Let  denote the real numbers, and  the integers. We write vectors in column form using bold lower-case letters, e.g. v; We write matrices as bold capital letters, e.g., B; bi is the ith column. We use ∥v∥ to denote the Euclidean length of a vector v. For matrix B, we use ∥B∥ to denote the length of the longest column vector in B.
An n-dimensional lattice of rank k≦n is

L=(B)={Bc:c∈k},B∈n×k 

where the k columns b1, . . . , bk∈n of the basis are linearly independent. All lattices in this paper are full rank—i.e., k=n. Usually lattices in this paper are sub-lattices of n—i.e., the lattice vectors have integer coefficients.

Every lattice has an infinite number of lattice bases. If B1 and B2 are two lattice bases of L, then there is some matrix U that is unimodular (i.e., U has integer entries and det(U)=±1) satisfying B1·U=B2. Since U is unimodular, |det(Bi)| is invariant for different bases of L. Since it is invariant, we may refer to det(L). This value is precisely the size of the quotient group n/L if L is an integer lattice.
To basis B of lattice L we associate the half-open parallelepiped (B)←{Σi=1nxibi:xi∈[−1⁄2,1⁄2)}. The volume of (B) is precisely det(L).
Informally, we say that some bases of L are “good” and some are “bad;” a basis B of L is “good,” roughly speaking, if the vectors of B are reasonably short and nearly orthogonal. Of course, for any basis B={b1, . . . , bn}, it must hold that Πi=1n∥bi∥≧det(L); roughly speaking, good bases come closer to reaching equality than bad ones.
For t∈n, we use t mod B to denote the unique vector t′∈(B) such that t−t′∈L. Given t and B, t mod B can be computed efficiently as t−B·└B−1·t┐, where └·┐ rounds the coefficients of a vector to the nearest integer. Let dist(L, t) denote minv∈L{∥t−v∥}. Clearly, for any basis B, ∥t mod B∥≧dist(L, t), though again (roughly speaking) “good” bases come closer to equality.
In some sense, the worst basis of a lattice L is its unique upper-triangular Hermite normal form HNF(L). Given any basis B of L, one can compute HNF(L) efficiently—i.e., in time poly(n, log ∥B∥). Thus, HNF(L) does not “reveal” more about L's structure than any other basis, making HNF(L) a good choice for the public lattice basis to be included in a public key. (See D. Micciancio, “Improving Lattice Based Cryptosystems Using the Hermite Normal Form”, in Proc. of CaLC '01, LNCS 2146, pages 126-145, Springer, 2001.)
The dual lattice of L, denoted L*, is defined as L*={x∈span(L): ∀v∈L, x, v∈}. It holds that det(L)·det(L*)=1. If B is a basis for the full-rank lattice L, then (B−1)T (the inverse transpose of B) is a basis of L*.
The ith successive minimum λi(L) is the smallest radius r such that L contains at least i linearly independent vectors of norm at most r. In particular λ1(L) is the length of the shortest nonzero vector in L. A very good basis may have some of these very short vectors.
The two most well-known lattices problems are the shortest vector problem (SVP) and closest vector problem (CVP). Here are their approximate versions.
Definition 6.1 (γ(n)-Shortest Vector Problem (SVP)). Given a basis for a lattice L of dimension n, output a nonzero vector v∈L of length at most γ(n)·λ1(L).
Definition 6.2 (γ(n)-Closest Vector Problem (CVP)). Given a basis for a lattice L of dimension n and a vector t∈n, output a nonzero vector v∈L such that ∥t−v∥≦γ(n)·dist(L, t).
A close variant of the SVP is the shortest independent vector problem (SIVP), defined as follows.
Definition 6.3 (γ(n)-Shortest Independent Vector Problem (SIVP)). Like the SVP, except one outputs linearly independent v1, . . . , vn∈L, all of length at most γ(n)·λn(L).
In a variant of the CVP, one is given the promise that the closest L-vector to t is much closer than any other—e.g., by a factor of γ(n).
Definition 6.4 (γ(n)-Bounded Distance Decoding Problem (BDDP)). Same as γ(n)-CVP, but with the promise that there is a unique solution—i.e., (γ(n)+1)·dist(L, t)<λ1(L).
In other words, the BDDP is the CVP under the promise that t is very close to the lattice L, and that in fact the solution v is unique. The solution is unique, since if ∥t−v∥<λ1(L)/(γ(n)+1), then ∥t−w∥≧∥v−w∥−∥t−v∥>λ1(L)·γ(n)/(γ(n)+1)>γ(n)·dist(L, t) for all w∈L\{v}. This definition of the BDDP is non-standard, in the sense that in γ(n)-BDDP, γ(n) is typically defined to be an upper bound on the ratio dist(L, t)/λ1(L), whereas we prefer (essentially) to define it to be a lower-bound on λ1(L)/dist(L, t), since (in our formulation) the problem becomes easier as γ(n) becomes larger (as in γ(n)-SVP, γ(n)-CVP, and γ(n)-SIVP).
Aside from BDDP, the above problems are known to be NP-hard for very small approximation factors. For all of these problems, the best polynomial-time approximation algorithms are variants of the lattice reduction algorithm LLL by Lenstra et al. or Babai's nearest plane algorithm; these algorithms only work for essentially-exponential—e.g., (n(log log n)/log n) approximation factors. (See M. Ajtai, R. Kumar, and D. Sivakumar, “A Sieve Algorithm for the Shortest Lattice Vector Problem”, in Proc. of STOC '01, pages 601-610, 2001.) As a rough rule of thumb, approximating these lattice problems to within a factor of 2k takes time about 2n/k, using known algorithms. See C. P. Schnorr, “A Hierarchy of Polynomial Time Lattice Basis Reduction Algorithms”, Theoretical Computer Science, 53(2-3):201-224, 1987.)
6.2 Basic Background on Ideal Lattices
To our knowledge, the first use of ideal lattices in cryptography was the NTRU cryptosystem by Hoffstein et al.,5 though NTRU's connection to lattices was made explicit later in cryptanalysis. (See J. Hoffstein, J. Pipher and J. Silverman, “NTRU: A Ring Based Public Key Cryptosystem”, in Proc. of ANTS '98, LNCS 1423, pages 267-288.) None of this cryptanalysis has broken the core average-case problem underlying the scheme. NTRU's main selling point is efficiency; encryption and decryption very fast—much faster than RSA, for example—since the operations involved are simple (multiplications in the ring [x]/(xn−1) for small integer q), and since n can be reasonably small (several hundreds) since the best known lattice attacks on NTRU take time essentially exponential in n. 5Strictly speaking, NTRU's lattice has a 2n×2n basis, where each n×n quadrant generates an ideal lattice.
Recent cryptography involving ideal lattices is typically framed immediately with reference to Ajtai's worst-case/average-case connection. In these works, they have been used to construct, for example, hash functions and signature schemes. (See D. Micciancio, “Improved cryptographic hash functions with worst-case/average-case connection”, in Proc. of STOC '02, pages 609-618, and C. Peikert and A. Rosen, “Efficient collision-resistant hashing from worst-case assumptions on cyclic lattices”, in Proc. of TCC '06, pages 145166, and C. Peikert and A. Rosen, “Lattices that Admit Logarithmic Worst-Case to Average-Case Connection Factors”, in Proc. of STOC '07, pages 478-487, and V. Lyubashevsky and D. Micciancio, “Generalized compact knapsacks are collision resistant”, in Proc. of ICALP '06, and D. Micciancio, “Generalized compact knapsacks, cyclic lattices, and efficient one-way functions from worst-case complexity assumptions”, in Proc. of FOCS '02, pages 356-365.)
Our construction will use the polynomial ring R=[x]/(θ(x)), where θ(x) is a monic polynomial of degree n. We view an element v∈R both as a ring element and as a vector—specifically, the coefficient vector v∈n. The ideal (v) generated by v directly corresponds to the lattice generated by the column vectors {vi←v×xi mod ƒ(x): i∈[0, n−1]}; we call this the rotation basis of the ideal lattice (v). Specifically, any w∈(v) is in the lattice generated by the rotation basis {vi}, since there must be some a for which w=v×a, and then w=Σiaivi. Conversely, if w is in the lattice generated by {vi}, then w=Σiaivi for some integers {ai}, which implies that w=v×a in the ring R, where a=Σiai·xi. In general, the rotation basis for the product of two elements a, b∈[x]/(ƒ(x)) is the rotation basis of a×b. Also the matrix-vector product of a rotation basis a with the vector b is the vector a×b.
Generally speaking, an ideal I⊂R need not be principal—i.e., have a single generator—and a basis BI of I need not be a rotation basis. Suppose it is generated by v and w. In this case, the ideal is represented by the lattice generated by the columns {v0, . . . , vn−1, w0, . . . , wn−1}, where wi is the vector associated to w×xi. Of course, the vectors in this set will be linearly dependent. A lattice reduction algorithm, such as LLL, will find these dependencies and output a basis for the lattice associated to I that contains only linearly independent vectors.
Sometimes we will use inverses in the ring [x]/(ƒ(x)). In this case, to avoid complications, we assume ƒ(x) is irreducible and therefore all nonzero terms have inverses. If I is an ideal in R, I−1 is a fractional ideal. I−1 is defined in a somewhat similar way as a dual lattice; it is the set {x∈[x]/(ƒ(x)): ∀y∈I, x×y∈R}. Aside from the fact that I−1 is not necessarily a subset of R, it is exactly like a normal ideal—in particular, it is closed under addition and under multiplication with R-elements. We say that (possibly fractional) ideals I and J are relatively prime if I+J⊃R. For example, ideal (2/5) and (3/7) are relatively prime (contain (1)), but (3/5) and (3/7) are not, since (1) is not in (3/35).
For principal ideal (v), the fractional ideal (v)−1 is generated by 1/v, where the inverse is in [x]/(ƒ(x)). The determinant associated to the ideal lattice for (v) (we may occasionally refer to this determinant as the norm of the ideal, denoted Nm(I)) is the inverse of the determinant of (1/v). For an ideal I that has multiple generators v1, v2, . . . , the fractional ideal I−1 is the intersection of (1/v1), (1/v2), . . . .
In our constructions, we will use a polynomial ring as defined above. Such rings are called monogenic number rings, or simple algebraic extensions, because they are isomorphic to [a] where α is a root of ƒ(x). Algorithmically, such rings are easy to work with, which will be important later for minimizing the complexity of our decryption circuit.
Algebraically, however, a more natural ring would be the ring of integers associated to a number field. A number field is a finite extension K=(α) of the rationals , isomorphic to [x]/(ƒ(x)) for some polynomial ƒ(x) irreducible over  for which ƒ(α)=0. The ring of integers of a number field K is:

    
    
        K={x∈K: ƒx∈[x]}, where ƒx is the (monic) minimal polynomial of x in [x]

While it may not be immediately obvious that K is even a ring, (α) generally has better algebraic properties than [α], most notably that every ideal I of the ring of integers factors uniquely as a product of prime ideals in the ring. Also, all ideals I of K are “invertible”—i.e., I−1·I=K when the inverse I−1 is taken in K; this is not necessary true in [α], where I−1·I may be a subset of R if Nm(I) is divisible by one of a small number of singular primes whose squares divide the discriminant Δ(ƒ) of ƒ(x). (See the survey on number rings by Stevenhagen.) Peikert and Rosen show that ideal lattices associated to the ring of integers in fields with very small root discriminant have very small worst-case/average-case connection factors, only logarithmic (versus polynomial) in n. While their approach is appealing, and most likely can be used in connection with our scheme, we choose instead to use [α] because using integer vectors permits us to push complicated details away from the decryption circuit, which is already quite complicated. Also, it is straightforward, though tedious, to simply avoid the singular primes when working with [α].

    
    


Since all of the hardness assumptions are with respect to a fixed ring R, one must choose it wisely. For example, a seemingly attractive choice for R is the ring [x]/(xn−1). Aside from efficiency, this choice in some sense maximizes the multiplicative depth of circuits that our scheme can evaluate, since one can bound the Euclidean length ∥u×v∥ by γMult(R)·∥u∥·∥v∥ for γMult(R)=√{square root over (n)}; other rings have larger values of γMult(R). We note that the NTRU encryption scheme, whose core hard problem has never been broken, uses this ring (though it uses a lattice basis that consists of 4 quadrants, where each quadrant is a basis of an ideal lattice in R). On the other hand, although there is no known attack against ideal lattice problems in this ring that is completely fatal, there are some attacks that suggest that this ring may be weaker than others. One fairly obvious attack by Gentry (C. Gentry, “Key Recovery and Message Attacks on NTRU-Composite”, Eurocrypt '01, LNCS 2045, pp. 182-194) works when n is composite; essentially, it reduces a lattice problem over [x]/(xcm−1) to a much more tractable m-dimensional lattice problem over [x]/(xm−1) for small constant c. Generally, one would prefer ƒ(x) to be irreducible. Even when n is prime, Gentry and Szydlo (C. Gentry and M. Szydlo, “Cryptanalysis of the Revised NTRU Signature Scheme”, Eurocrypt '02, LNCS 2332, pages 299-320) gave an algorithm that can be adapted to take an n-dimensional basis of a principal ideal lattice I of R=[x]/(xn−1), and construct a (n+1)/2-dimensional lattice basis that contains at least one nonzero I-vector of length at most √{square root over (2)}·λ1(I); if I has an orthonormal basis, their algorithm can find it in polynomial time. But again we mention that these attacks are not fatal for [x]/(xn−1). If one simply takes n prime and (easily) avoids ideals with orthonormal bases, the Gentry-Szydlo attack only gives an attack whose running time is at best square root of the original time of attack, which is fine (in principle) if the original time of attack is super-polynomial.
6.3 Probability Background
A family H of hash functions from X to Y, both finite sets, is said to be 2-universal if




  
    
      Pr
      
        h
        ⁢
        
          ←
          R
        
        ⁢
        H
      
    
    ⁡
    
      [
      
        
          h
          ⁡
          
            (
            x
            )
          
        
        =
        
          h
          ⁡
          
            (
            
              x
              ′
            
            )
          
        
      
      ]
    
  
  =
  
    1
    /
    
      
      Y
      
    
  




for all distinct x, x′∈X. A distribution D is ∈-uniform if its statistical distance from the uniform distribution is at most ∈, where the statistical difference between two distributions





  
    D
    1
  
  ,
  
    
      D
      2
    
    ⁢
    
      
        
      
      ⁢
      
        
      
    
    ⁢
    is
    ⁢
    
      
        
      
      ⁢
      
        
      
    
    ⁢
    
      1
      2
    
    ⁢
    
      
        ∑
        
          x
          ∈
          X
        
      
      ⁢
      
        
          
          
            
              
                D
                1
              
              ⁡
              
                (
                x
                )
              
            
            -
            
              
                D
                2
              
              ⁡
              
                (
                x
                )
              
            
          
          
        
        .
      
    
  




Lemma 6.5 (Leftover Hash Lemma). Let H be a family of 2-universal hash functions from X to Y. Suppose that





  h
  ⁢
  
    
  
  ⁢
  
    ←
    R
  
  ⁢
  H




and





  x
  ⁢
  
    ←
    R
  
  ⁢
  X




are chosen uniformly and independently. Then, (h, h(x)) is





  
    
      1
      2
    
    ⁢
    
      
        
          
          Y
          
        
        /
        
          
          X
          
        
      
    
  
  -
  uniform




over H×Y.

7 A Somewhat Homomorphic Encryption Scheme
7.1 Why Lattices?
To bootstrap our new notion of bootstrappability, we ask a natural question: where do we find encryption schemes that have decryption algorithms with low circuit complexity?
We note that this is not an essential question. Conceivably, ε could be tailored so that it evaluates only its (augmented) decryption circuits Dε(Γ), or very few gates outside of this small set, even though its decryption circuit is “complex”. However, our approach will be to look for a scheme that evaluates circuits at least as complex as (e.g., in terms of depth) its (augmented) decryption circuit.
Under this approach, it does not make much sense to look at schemes based on factoring or variants of Diffie-Hellman, even though there are several homomorphic schemes here—RSA, Goldwasser-Micali, ElGamal, Paillier, Boneh-Goh-Nissim, etc. In all of these schemes, decryption uses some operation—exponentiation, Legendre symbol computation, pairing—that is not even known to have circuit complexity in NC. For these schemes, we can reduce the depth of the decryption circuit somewhat by using techniques like those described in Section 10, where we offload some decryption work onto the encrypter, who outputs a longer ciphertext that can be decrypted by a shallower circuit, but we do not see how to reduce the decryption depth enough to make these schemes bootstrappable.
On the other hand, for encryption schemes based on lattices or linear codes or even simple integers (see Craig Gentry and Shai Halevi, “Implementing Gentry's Fully Homomorphic Encryption Scheme”, available at http://eprint.iacr.org/2010/520), the dominant decryption operation is typically an inner product or matrix-vector multiplication or division, which is in NC1 (assuming the bit-length of the coefficients are polynomial in the vector dimension).
7.2 Why Ideal Lattices?
To be bootstrappable, it is not enough that the scheme has a decryption circuit of low complexity; the scheme needs to be able to evaluate that circuit. We already have schemes that can evaluate circuits in NC1. In fact, unless one wants circuit privacy (as in Sanders-Young-Yung), “evaluating” circuits of logarithmic depth is completely trivial: one simply outputs the circuit and the “unprocessed” input ciphertexts. So, why is it not trivial to construct a bootstrappable encryption scheme from a lattice-based scheme that has a decryption circuit in NC1?
The problem with the trivial construction, and with SYY, is that they achieve logarithmic depth by permitting the ciphertext size to grow exponentially with the circuit depth. As the ciphertext grows, the decryption circuit must also grow to handle the larger ciphertexts. In short, as one allows larger and larger ciphertexts, the evaluation depth will never “catch up” to the depth of the decryption circuit. To obtain a bootstrappable encryption scheme, it seems necessary to consider encryption schemes that have more complex inherent homomorphisms.
As we will see, while general lattices offer an additive structure, ideal lattices also have a multiplicative structure that will enable us to evaluate deep arithmetic circuits (though we will need more tricks before we ultimately obtain a bootstrappable scheme). Hence, they are well-suited to help construct one embodiment of our bootstrappable encryption scheme.
7.3 A Geometric Approach to Maximizing the Circuit Depth that can be Evaluated
In Section 5, where we described the abstract scheme, we saw that ε correctly evaluates circuit C if the generalized circuit g(C) satisfies g(C)(x1, . . . , xt)∈XDec for all (x1, . . . , xt)∈XEnct. For example, it correctly evaluates the gate AddBI if XEnc+XEnc⊂XDec, and the gate MultBI if XEnc×XEnc⊂XDec. Our hope is that applying these gates—indeed, even applying high-depth circuits—does not cause to much “expansion,” so that the output of the generalized circuit remains within XDec.
An important reason that we use ideal lattices, versus ideals over general rings, is that lattices permit a clean analysis of XEnc and XDec in terms of Euclidean length. When we implement the abstract scheme using a polynomial ring [x]/(ƒ(x)) and ideal lattices as summarized above, the sets XEnc and XDec become subsets of n. We re-characterize these sets geometrically as follows.
Definition 7.1 (rEnc and rDec). Let rEnc be the smallest value such that XEnc⊂(rEnc), where (r) is the ball of radius r. Let rDec be the largest such that XDec⊃(rDec).
Now, let us define a set of permitted circuits ε as follows:

ε={C:∀(x1, . . . ,xt)∈(rEnc)t,g(C)(x1, . . . ,xt)∈(rDec)}

ε is defined like the maximal set ε′ of permitted circuits in Definition 5.5, but we have replaced XEnc and XDec with (rEnc) and (rDec). Clearly, ε ⊂ε′. (At several points later in the paper, we narrow our set of permitted circuits again so as to enable a less complex decryption algorithm.)

For fixed values of rEnc and rDec, what is ε ? This is a geometric problem, and we can bound the Euclidean length ∥g(C)(x1, . . . , xt)∥ by bounding the lengths of ∥u+v∥ and ∥u×v∥ in terms of ∥u∥ and ∥v∥. For addition, this is easy: using the triangle inequality, we have ∥u+v∥≦+∥v∥ for u, v∈R. For multiplication, we can prove that ∥u×v∥≦γMult(R)·∥u∥·∥v∥, where γMult(R) is some factor that is dependent only on the ring R.
The following theorem characterizes the “error expansion” that a circuit can cause based on the circuit's depth.
Theorem 7.2. Suppose rE≧1 and that circuit C's additive fan-in is γMult(R), multiplicative fan-in is 2, and depth is at most

log log rD−log log(γMult(R)·rE)

Then, C(x1, . . . , xt)∈(rD) for all x1, . . . , xt∈(rE).

In particular, ε correctly evaluates circuits of depth up to log log rDec−log log(γMult(R)·rEnc).

Proof. For a d-depth circuit, let ri be an upper-bound on the Euclidean norm of the values at level i, given that rd=rE. By the triangle inequality, an addition (or subtraction) gate at level i outputs some v∈R such that ∥v∥≦γMult(R)·ri. A multiplication gate at level i outputs some v∈R such that ∥v∥≦γMult(R)·ri2. In either case, ri−1≦γMult(R)·ri2, and thus r0≦(γMult(R)·rE)2d. The result follows.

An (oversimplified) bottom line from Theorem 7.2 is that, to maximize the depth of circuits that ε can correctly evaluate (see Theorem 5.7), we should minimize γMult(R) and rEnc, and maximize rDec. Most of the remainder of this section consists of proposals toward this goal.
7.4 Instantiating the Ring: The Geometry of Polynomial Rings
From Theorem 7.2, it seems important to set ƒ(x) so that R=[x]/(ƒ(x)) has a reasonably small value of γMult(R). (Recall that γMult(R) is a value such that ∥u×v∥≦γMult(R)·∥u∥×∥v∥.) The following results show that there are many ƒ(x) for which the associated γMult(R) is only polynomial in n.

Theorem 7.3. Let ƒ(x) be a monic polynomial of degree n. Let F(x)=xn·ƒ(1/x) and g(x)=F(x)−1 mod xn−1. Then, ∥u×v∥≦γMult(R)·∥u∥·∥v∥ for some

γMult(R)≦√{square root over (2n)}·(1+2n·∥ƒ∥·∥g∥)

Proof. (Theorem 7.3) Let t(x)←u(x)·v(x) be the (unreduced) degree 2n−2 product of u and v. Let t(x)=q(x)ƒ(x)+r(x), where r(x)=t(x) mod ƒ(x) is a polynomial of degree n−1, and q(x) is a polynomial of degree n−2. We have ∥u×v∥=∥r∥, the latter term denoting the Euclidean norm of the vector formed by the coefficients of r(x).

Note that each coefficient of t(x), being an inner product of some subset of coefficients of u and v, must have norm less than ∥u∥·∥v∥; overall, ∥t∥≦√{square root over (2n)}·∥u∥·∥v∥.
Let T(x)=x2n−2t(1/x), Q(x)=xn−2q(1/x), and R(x)=x2n−2r(1/x). Then, T(x)=Q(x)F(x)+R(x), where T, Q, F are all integer polynomials with the same degrees and norms as t, q, ƒ. R, which has the same norm as r, is divisible by xn−1, implying that Q(x)=T(x)g(x) mod xn−1. Since Q(x) has degree n−2, this equation implies ∥Q∥≦√{square root over (2n)}·∥T∥·∥g∥. We have




  
    
      
        
          
          
            u
            ×
            v
          
          
        
        =
        
        ⁢
        
          
            
            r
            
          
          =
          
            
              
              R
              
            
            ≤
            
              
                
                T
                
              
              +
              
                
                
                  Q
                  ·
                  F
                
                
              
            
            ≤
          
        
      
    
  
  
    
      
        
        ⁢
        
          
            
              
              T
              
            
            +
            
              
                
                  2
                  ⁢
                  n
                
              
              ·
              
                
                Q
                
              
              ·
              
                
                F
                
              
            
          
          ≤
        
      
    
  
  
    
      
        
        ⁢
        
          
            
            T
            
          
          +
          
            2
            ⁢
            
              
            
            ⁢
            
              n
              ·
              
                
                T
                
              
              ·
              
                
                g
                
              
              ·
              
                
                F
                
              
            
          
        
      
    
  
  
    
      
        =
        
        ⁢
        
          
            
              
              t
              
            
            ·
            
              (
              
                1
                +
                
                  2
                  ⁢
                  
                    
                  
                  ⁢
                  
                    n
                    ·
                    
                      
                      f
                      
                    
                    ·
                    
                      
                      g
                      
                    
                  
                
              
              )
            
          
          ≤
        
      
    
  
  
    
      
        
        ⁢
        
          
            
            u
            
          
          ·
          
            
            v
            
          
          ·
          
            
              2
              ⁢
              
                
              
              ⁢
              n
            
          
          ·
          
            (
            
              1
              +
              
                2
                ⁢
                
                  
                
                ⁢
                
                  n
                  ·
                  
                    
                    f
                    
                  
                  ·
                  
                    
                    g
                    
                  
                
              
            
            )
          
        
      
    
  




as required.

To find a suitable ring R=[x]/(ƒ(x)) for which γMult(R) is small, it suffices to find an ƒ(x) for which both F(x) and F(x)−1 mod xn−1 have small norms, where F(x)=xn·ƒ(1/x). This gives us a lot of freedom in choosing ƒ(x).
For example, we can sample ƒ(x) from the large class of polynomials such that ƒ(x) has small norm and ƒ(x)=xn−h(x) where h(x) is a polynomial of degree at most (n+1)/2. In this case, for R=[x]/(ƒ(x)), one can prove that γMult(R)≦√{square root over (2n)}·(1+2n·∥ƒ∥2). One can generalize this to the case that h(x) has degree at most n−(n−1)/k for k>2.
Theorem 7.4. Suppose ƒ(x)=xn−h(x) where h(x) has degree at most n−(n−1)/k for k≧2. Then, for R=[x]/(ƒ(x)), it holds that γMult(R)≦√{square root over (2n)}·(1+2n ·(√{square root over ((k−1)n)}∥ƒ∥)k).
Proof. Let F(x)=xn·ƒ(1/x)=1−xn·h(1/x). Let H(x)=xn·h(1/x). Note that H(x) is divisible by xm for integer m≧(n−1)/k, since h(x) has degree at most n−(n−1)/k. This fact implies that 1−H(x)k=1 mod xn−1. So, g(x)←F(x)−1=1/(1−(H(x))k)/(1−H(x)) mod xn−1, and we have:

∥g(x)∥≦1+∥H∥+ . . . +∥Hk−1∥

≦1+∥H∥+ . . . +((k−1))n)(k−1)/2∥H∥k−1 

≦1+∥ƒ∥+ . . . +((k−1)n)(k−1)/2∥ƒ∥k−1 

≦((√{square root over ((k−1)n)}∥ƒ∥)k−1)/((√{square root over ((k−1)n)}∥ƒ∥)−1)

Since ∥ƒ∥<(√{square root over ((k−1)n)}∥ƒ∥)−1, we have γMult(R)≦√{square root over (2n)}·(1+2n·(√{square root over ((k−1)n)}∥ƒ∥)k).

Undoubtedly there are suitable ƒ(x) that do not fall into the class of polynomials above. For example, let a1, . . . , ak, b1, . . . , bk be polynomials, such that for each i, ai=xri−1 and bi=(1−xrisi)/(1−xri) for some {ri},{si} where ri·si≧n−1 and ri<n−1. Then, for each i, aibi=1 mod xn−1 (nontrivially) and ∥ai∥ and ∥bi∥ are both quite small. We could set F(x) and g(x) by picking a random subset S⊂{1, . . . ,k} and setting F(x)←Πi∈Sai mod xn−1 and g(x)←Πi∈Sbi mod xn−1. The Euclidean norms of F and g would be rather small, since the Euclidean norms of the ai's and bi's were very small. This technique seems messier than the approach above; the point here is that the approach above is not the only approach.
A simple case is to set ƒ(x)←xn−1. For the ring R=[x]/(xn−1), it is easy to show that γMult(R)≦√{square root over (n)}.
Lemma 7.5. Suppose x, y∈R=[x]/(xn−1), and let z←x×y. Then ∥z∥≦√{square root over (n)}·∥x∥·∥y∥.
Proof. Consider the i-th coefficient zi of z; we have




  
    z
    i
  
  =
  
    
      ∑
      j
    
    ⁢
    
      
        
          x
          j
        
        ·
        
          y
          
            i
            -
            j
          
        
      
      ⁢
      
        mod
        ⁢
        n
      
    
  




In particular, since zi is an inner product of (rotated versions of) x and y, we have that |zi|≦∥x∥·∥y∥ (for all i). The result follows.

However, such circulant ideal lattices come with the disclaimer, mentioned in Section 6.2, that there are non-fatal but somewhat disconcerting attacks on hard problems over this particular ring.
We also prefer ƒ(x) to be irreducible, so that K=(x)/(ƒ(x)) is a field. In this case, [x]/(ƒ(x)) inherits the nice properties of its overlying ring of integers K, with some qualifications. (See Section 6.) Using irreducible ƒ(x) also seems to make R less vulnerable to cryptanalytic attacks. If desired, we can get many of the benefits of using [x]/(xn−1) by instead using [x]/(ƒ(x)) for ƒ(x)=(xn−1)/(x−1), which is irreducible when n is prime.
7.5 Instantiating Encrypt and Minimizing rEnc 
From Theorem 7.2, we would like to set rEnc to be as small as possible, consistent with security. Recall that XEnc⊂(rEnc) is the image of the Samp algorithm used in Encrypt, where our security proof (Theorem 5.8) holds when Samp(BI, x) runs r←Samp1(R) and outputs x+r×s, where s is a generator of the ideal I. Let lSamp1 be an upper bound on the length of r, drawn according to Samp1. We have

rEnc=max{∥x+r×s∥}≦n·∥BI∥+√{square root over (n)}·lSamp1·∥BI∥

Toward minimizing rEnc, we can choose s to be short—e.g., use s=2·e1.

The size of lSamp1 is a security issue. We need it to be large enough so that the min-entropy of t mod BJpk in the ICP is large. As a concrete example, one could set lSamp1=n, and have Samp1 sample a uniformly random integer vector in (lSamp1).
Overall, we can take rEnc to be polynomial in n. We note that, even in this case, the plaintext space may be as large as [R:I]=det(I), which can be exponential in n.
There are certainly alternative ways of generating I and instantiating Samp. For example, one may set s in such a way that the Hermite normal form of (s) has all 1's along the diagonal, except for the upper-left corner, which equals det(I). (This property of the Hermite normal form will always hold when det(I) is prime.) This gives a plaintext space isomorphic to det(I), which may be more useful than the space 2n for some application. Also, the image of Samp is not necessarily very “nice”—e.g., it may not be “spherical,” but may rather be distorted in a way that depends on the ring R. Later, we discuss a different way to instantiate Samp is using Gaussian distributions over lattices.
7.6 Instantiating Decrypt and Maximizing rDec 
From Theorem 7.2, we would like to set rDec to be as large as possible, consistent with security. Recall that rDec is the radius of the largest sphere centered at 0 that is circumscribed by BJsk. Also, recall our decryption equation.

π=ψ−BJsk·└(BJsk)−1·ψ┐ mod Bi 

To maximize rDec, one strategy is simply to scale up the parallelepiped BJsk. But this does not really buy us anything. For a fixed ratio rDec/rEnc, one can verify that our maximum depth (per Theorem 7.2) of log log rDec−log log(γMult(R)·rEnc) decreases as we scale up rDec and rEnc simultaneously. (If we scale up rDec without scaling up rEnc, this increases the approximation factor of the associated bounded distance decoding lattice problem, which hurts security. See Section 7.7.) The important property of BJsk is its shape—i.e., we want the parallelepiped (BJsk) to be “fat” enough to contain a large sphere. This property is easier to formalize in terms of the inverse matrix (BJsk)−1, whose transpose is a basis (or independent set) of the dual lattice (BJsk).
Lemma 7.6. Let B be a lattice basis and B*=(B−1)T. Let r be the radius of the largest sphere, centered at 0, circumscribed by (B) (permitting tangential overlap). Then, r=1/(2·∥B*∥). In particular,

rDec=1/(2·∥((BJsk)−1)T∥)

Suppose ∥t∥<rDec; then each coefficient of B−1·t has magnitude at most 1⁄2.

Proof. Suppose ∥x∥<1/(2·∥B*∥). Each coefficient of B−1·x is an inner product of x with a column vector of B*, and therefore has magnitude at most ∥x∥·B*∥<1⁄2. This implies that └B−1·x┐=0, that x=(x mod B), and that x∈(B). Now, suppose ∥x∥>1/(2·∥B*∥) and is parallel to the longest vector bi in B*. Then, |bi,x|>1⁄2, implying that └B−1·x┐≠0, and that x≠(x mod B), and that x∉(B).

The relevance of Lemma 7.6 is that the decryption equation above is correct when ψ is at most rDec=1/(2·∥((BJsk)−1)T∥) away from a lattice point in J.
It is easy to imagine ad hoc ways of instantiating IdealGen so that the parallelepiped (BJsk) is “fat”—i.e., contains a sphere whose radius is only polynomially shorter than the parallelepiped's diameter. For example, one could generate a random vector v and simply set BJsk to be the rotation basis of v, and set BJpk to be the HNF of (v). Very roughly speaking, if v is generated as a vector that is very “nearly parallel” to e1 (i.e., the vector (1, 0, . . . , 0)), then the rotational basis will have rDec within a small (polynomial) factor of λ1(J). More formally, we have the following lemma.
Lemma 7.7. Let t≧4·n·γMult(R)·s. Suppose v∈t·e1+(s)—i.e., v is in the ball of radius s centered at t·e1. Let B be the rotation basis of v. Then, (B) circumscribes a ball of radius at least t/4.
Proof. For i∈[0,n−1], let vi=v×xi, and zi=vi−t·ei. We have that |zi∥=∥z0×xi∥≦γMult(R)·∥z0∥≦γMult(R)·s. (In other words, we have that vi=t·e1+zi is nearly parallel to ei when γMult(R)·s is much smaller than t.)
For every point a on the surface of (B), there is an i such that




  a
  =
  
    
      
        (
        
          
            ±
            1
          
          /
          2
        
        )
      
      ·
      
        v
        i
      
    
    +
    
      
        ∑
        
          j
          ≠
          i
        
      
      ⁢
      
        
          x
          j
        
        ·
        
          v
          j
        
      
    
  




for xj∈[−1⁄2, 1⁄2]. So,

|(a,ei)|≧t/2−n·γMult(R)·s 

In particular, ∥a∥≧t/2−n·γMult(R)·s and the lemma follows.

7.7 Security of the Concrete Scheme

When instantiated with ideal lattices, the ideal coset problem (ICP) becomes the following problem.

Definition 7.8 ((Decision) Bounded Distance Decoding Problem (Decision BDDP) for Ideal Lattices). Fix a polynomial ring R=[x]/(ƒ(x)), algorithm IdealGen that samples a basis of an ideal in R, and an algorithm Samp1, that efficiently samples n. The challenger sets





  b
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and





  
    (
    
      
        B
        J
        sk
      
      ,
      
        B
        J
        pk
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      IdealGen
      ⁡
      
        (
        
          R
          ,
          
            B
            I
          
        
        )
      
    
    .
  




If b=0, it sets





  r
  ⁢
  
    ←
    R
  
  ⁢
  
    
      Samp
      1
    
    ⁡
    
      (
      R
      )
    
  




and t←r mod BJpk. If b=1, it samples t uniformly from R mod BJpk. The problem: guess b given (t, BJpk).

In short, the problem is to decide whether t is uniform modulo the ideal lattice J, or whether t was sampled according to a known “dumpier” distribution induced by Samp1.
Obviously, the hardness of decision BDDP depends crucially on Samp1—i.e., decision BDDP is an average-case problem whose hardness depends on the (average-case) distribution of Samp1. For example, if Samp1(R) always output the zero vector 0, or sampled according to some other distribution with very low min-entropy, the problem would be easy. However, based on current knowledge, it seems reasonable to believe the problem can be hard when Samp1's min-entropy is high—e.g., when r is sampled from a sphere of radius n, or when r is sampled according to a discrete n-dimensional Gaussian distribution with a standard deviation parameter s=w(√{square root over (log n)}). As a concrete example, let's suppose that r is sampled uniformly from a sphere of radius lSamp1=n.
The hardness of decision BDDP also depends on how J is generated—in particular, on the value λ1(J), and whether λ1(J) is much larger than lSamp1. In particular, if λ1(J)/lSamp1≧2n (and we could replace the rhs with a slightly sub-exponential value), then Babai's nearest plane algorithm or variants of the lattice reduction algorithm LLL can be used to recover the closest J-vector to t in polynomial time. This attack breaks decision BDDP for these parameters, since it is a very safe bet that t was generated using Samp1 when dist(J, t)<lSamp1; if dist(J, t)>lSamp1, it is a certain bet that t was generated uniformly. However, there are no known attacks when, for example, λ1(J)=2O(√{square root over (n)}) (and lSamp1 is as before).
Above, we suggested ways of instantiating the ring R, the algorithm Samp used in Encrypt, and the algorithm IdealGen used in KeyGen. Let's reconsider these suggestions, and revisit the sizes of rEnc and rDec, with a view to how they impact the hardness of the induced decision BDDP.
In Section 7.5, we observed that rEnc is at most n·∥BI∥+√{square root over (n)}·lSamp1·∥BI∥, where BI can be chosen so that ∥BI∥ is polynomial in n (or even constant). In short, we can have rEnc only polynomially larger than lSamp1. In Section 7.6, we observed that one can instantiate IdealGen so that it outputs a secret basis BJsk for J such that, if rDec is the radius of the largest ball circumscribed by (BJsk), then rDec is only polynomially smaller than λ1(J). Overall, we can make rDec/rEnc be within a polynomial factor of λ1(J)/lSamp1, where the latter is essentially the approximation factor of our decision BDDP problem. As a rule of thumb, solving 2k-approximate decision BDDP takes time roughly 2n/k using known attacks; so, rDec=2O(√{square root over (n)}) and rEnc=poly(n) seems to be a reasonable setting of parameters. When rDec=2nc1 and γMult(R)·rEnc=2nc2, then Theorems 5.7 and 7.2 imply that the scheme can correctly evaluate circuits of depth (c1−c2) log n.
Remark 7.9. Setting rDec to be small permits a weaker assumption, but leads to a scheme that can evaluate only very shallow circuits. Let us suppose that rDec=nα(n) and γMult(R)·rEnc=nβ(n) for some functions α(n), β(n). As far as we know, for irreducible ƒ(x), γMult(R) must be at least polynomial in n, so β(n) must be at least constant. In this case, the scheme can evaluate depth log α(n)−log β(n). This implies that we can only evaluate constant depth circuits, unless rDec/rEnc is super-polynomial. Though we omit details here, constant depth will be insufficient to make our eventual scheme bootstrappable; bootstrappability will require the BDDP approximation factor to be super-polynomial.
Again, one may question how hard the decision BDDP actually is for our ad hoc instantiation of IdealGen. In Section 6, we mentioned that Gentry and Szydlo have a polynomial-time attack on circulant ideal lattices that have orthonormal bases. This attack suggests that we may want to avoid principal ideal lattices with “nearly orthonormal” bases even in non-cyclotomic polynomial rings.
We stress that our analysis below regarding the decryption circuit does not rely on the ad hoc concrete suggestions in this section—e.g., the analysis does not require I or J to be principal ideals.
7.8 How Useful is the Somewhat Homomorphic Scheme By Itself?
The momentum of our paper is directed toward obtaining a bootstrappable, and hence a (leveled) fully homomorphic, encryption scheme. However, we pause briefly to consider how we can use our somewhat homomorphic scheme even if we do not try to bootstrap.
Theorem 7.2 tells us that we can evaluate circuits of depth

log log rDec−log log(γMult(R)·rEnc)

even if the AddBI gates have high fan-in (i.e., γMult(R) fan-in). We have seen above that we can take rDec to be of the form 2nc for some constant c<1, and γMult(R) and rEnc to be polynomial in n. In this case, we can evaluate logarithmic depth.

Already this is a significant improvement on prior work. For example, the Boneh-Goh-Nissim (BGN) pairing-based cryptosystem was the first to permit efficient evaluation of 2-DNF formulas, quadratic formulas that may have a polynomial number of monomials. Being able to compute quadratic formulas is extremely useful—e.g., Groth, Ostrovsky, and Sahai used their system to construct a perfectly NIZK system for general circuits, with length proportion to the size of the circuit. (See J. Groth, R. Ostrovsky, and A. Sahai, “Perfect Non-Interactive Zero Knowledge for NP”, Eurocrypt '06, LNCS 4004, pp. 339-358.) However, one shortcoming of the BGN system is its small plaintext space—log λ bits for security parameter λ. Our somewhat homomorphic scheme, without the bootstrapping, already improves upon this, allowing both greater multiplicative depth in the circuit and a larger plaintext space.
As an example, we obtain the first single-database private information retrieval scheme with communication complexity O(λ·log m), where λ is the security parameter and m is bit-length of the database s1, . . . , sm. The querier encrypts the binary representation π1, . . . , πM of the index that it wants, constructing the ciphertexts ψ1, . . . , ψM, where M=└log m┘+1. Homomorphically, the server homomorphically evaluates the formula




  
    f
    ⁡
    
      (
      
        
          π
          1
        
        ,
        ...
        ⁢
        
          
        
        ,
        
          π
          M
        
        ,
        
          s
          1
        
        ,
        ...
        ⁢
        
          
        
        ,
        
          s
          m
        
      
      )
    
  
  =
  
    
      ∑
      
        t
        ∈
        
          
            {
            
              0
              ,
              1
            
            }
          
          M
        
      
    
    ⁢
    
      
        s
        t
      
      ·
      
        
          ∏
          
            j
            =
            1
          
          M
        
        ⁢
        
          
        
        ⁢
        
          
            (
            
              
                t
                i
              
              -
              
                π
                i
              
              +
              1
            
            )
          
          ⁢
          
            
          
          ⁢
          mod
          ⁢
          
            
          
          ⁢
          2
        
      
    
  




where, in st, t is interpreted as a number in [1, m]. Notice that this formula encrypts the correct entry in the database. Also, observe that if the ciphertexts ψ1, . . . , ψM have offsets in (rEnc), then the offset of the output is in (r) for r=O(m·(γMult(R)·rEnc)M)=O((2·γMult(R)·rEnc)M). If one permits rDec=2θ(√{square root over (n)}), then one can permit M=θ(√{square root over (n)}/log(γMult(R)·rEnc)), which is polynomial in n. In other words, our scheme correctly evaluates the PIR formula even when the database is sub-exponential (super-polynomial) in size, though of course the computation would be very high in that case.

In general, when the function to be evaluated is highly parallel, the bootstrapping step may be unnecessary, permitting better efficiency.
Another example is returning an (encrypted) file that contains a particular keyword. Searching for such a file can roughly be broken down into two steps: searching within a single file to see if the keyword is present, and then aggregating the searching information across all of the files. The first step basically involves string matching. If the keyword k is represented as a bit string of t bits, one can compare each t-bit portion of the file with the keyword, trying to detect a match. One can compare two t-bit strings k and s as follows: compute Πi=1t(1−ki−si) mod 2. If this quantity equals 1, then the strings are equal; otherwise, the quantity equals 0, and the strings are unequal.
However, there is a trick due to Smolensky that can detect a string match with high probability while using a mod-2 polynomial of lower degree (lower than degree t). To compute OR(x1, . . . , xt), where xi∈{0, 1}, correctly with probability 1−(1⁄2)l, the trick generates l bit-strings (aj1, . . . , ajt) for j∈[1, l], and outputs 1−Πj=1l(1+Σi=1t aji·xi) mod 2. If the xi's are all 0, then the terms (1+Σi=1t aji·xi) all equal 1, and therefore the overall expression is 0. On the other hand, if at least one of the xi's equals 1, then the term (1+Σi=1t aji·xi) is even with probability 1⁄2, and consequently the overall expression is 1 with probability 1−(1⁄2)l. In short, the trick computes the OR of a high number of terms using a polynomial having degree that is largely independent of the number of terms. Now, if the plaintext space of our somewhat homomorphic encryption scheme is modulo (2), we can use Smolensky's trick in the straightforward way to homomorphically compute an OR of many terms using a low-degree polynomial, a polynomial that our somewhat homomorphic encryption scheme can handle (whereas it may or may not be able to handle the high-degree version of OR). Observe that the negation of OR(k1XORs1, . . . , ktXORst) is 1 precisely when the strings match.
The second step of keyword search involves aggregating the search information across the files. If we simply want to detect whether the keyword was in one of the files, this involves another OR computation: simply take the OR of all of the respective bits indicating whether or not the bit was in the respective file. So, again, we can use Smolensky's trick to keep the polynomial degree down. Overall, we see that, by using Smolensky's trick, we only need our somewhat homomorphic encryption scheme (not a homomorphic encryption that can evaluate very high degree polynomials) to (homomorphically) detect whether a keyword (even if the keyword is long) is in a set of files (even if the set is long) with high probability. The Smolensky trick is applicable in many other settings, where we want to homomorphically evaluate a circuit that has high-fan-in ANDs or ORs.
8 Tweaks to the Somewhat Homomorphic Scheme
At this point, we have described our somewhat homomorphic scheme in enough detail to begin considering whether the scheme is bootstrappable. First, however, we describe two “tweaks” to the scheme. The purpose of these tweaks is to lower the eventual circuit complexity of decryption without substantially reducing the depth that the scheme can evaluate.
As the first tweak, we modify the secret key of our scheme so that the decryption equation simplifies from

π=ψ−BJsk·└(BJsk)−1·ψ┐ mod BI 

to

π=ψ−└vJsk×ψ┐ mod BI 

where vJsk∈J−1.

Before describing the tweak, it is helpful to understand the relationship between the dual of a lattice (a good basis for which was originally used as the decryption key) and the inverse of an ideal lattice (a vector from which is used as the decryption key in our revised decryption equation).
8.1 On the Relationship Between the Dual and the Inverse of an Ideal Lattice
Recall the definition of the dual of an ideal lattice J: J*={x∈n: ∀v∈J, x,v∈}. The inverse in R=[x]/(ƒ(x)) of an ideal has a superficially similar definition: J−1={x∈[x]/(ƒ(x)): ∀v∈J,x×v∈}.
If BJ happens to be a rotation basis of J=(v), then the inverse J−1=(1/v) is generated by the rotation basis of 1/v, the columns of BJ−1. However, the dual of J is generated by the inverse transpose of BJ. So it is certainly not true in general that the ideal lattice associated to J−1 is generated by the dual of the ideal lattice associated to J. However, for rotation bases, since the bases of the dual and the inverse are just transposes of each other, we have the following easy lemma, which is analogous to Lemma 7.6.
Lemma 8.1. Let B be a rotation basis and B* be its inverse transpose. Then, ∥B*∥·√{square root over (n)}≧∥B−1∥≧∥B*∥/√{square root over (n)}. In particular, if BJsk is a rotation basis, we have 1/(2√{square root over (n)}∥(BJsk)−1∥)≦rDec≦√{square root over (n)}/(2·∥(BJsk)−∥).

Proof. Let bij be the highest-magnitude coefficient in the matrix B−1. Then,

∥B−1∥≧bij≧∥B*∥/√{square root over (n)} and ∥B*∥≧bij≧∥B−1∥/√{square root over (n)}

Using Lemma 7.6, we have

1/(2√{square root over (n)}·∥(BJsk)−∥)≦rDec≦√{square root over (n)}/(2·∥(BJsk)−1∥)

Can we provide a more precise characterization of this relationship between the dual and the inverse for general (non-principal) ideal lattices? For example, given a short vector in J−1, can we find a short basis of J*? Or, given a short vector in J*, can we output a short basis of J−1. The answer to both of these questions is yes.
Lemma 8.1 already answers the first question. Let BJ be a basis of J, with column vectors u0, . . . , un−1. If v is a short vector in J−1 and Bv is its rotation basis, then v×ui∈R for all i, and therefore Bv. BJ is an integer matrix. This implies that the rows of Bv form an independent set in J*. The longest row of Bv cannot be much longer than the longest column, as in the proof of Lemma 7.6.
The second question—i.e., whether one can generate a short basis of J−1 from a short vector in J* is more challenging, but we have the following lemma.
Lemma 8.2. Let w∈J*, where J* is the dual of the ideal lattice J. Let




  v
  =
  
    
      ∑
      
        i
        =
        0
      
      
        n
        -
        1
      
    
    ⁢
    
      
        x
        i
      
      ⁢
      
        
          ∑
          
            j
            =
            
              i
              +
              1
            
          
          n
        
        ⁢
        
          
            f
            j
          
          ·
          
            w
            
              j
              -
              i
              -
              1
            
          
        
      
    
  




Then, v∈J−1. Let Bv be the rotation basis of v. Then, ∥Bv∥≦√{square root over (n)}·∥ƒ∥·∥w∥. This applies even when J is a fractional ideal.

The idea of the proof is to take w∈J*, place it as the bottom row in an n×n matrix, and then to try to fill out the rest of the matrix so that we end up with the rotation basis of a vector in J−1. Together, the vector w and the polynomial ƒ(x) dictate what the rest of the matrix must be.
Proof. We claim that the bottom row of Bv is (w0, w1, . . . , wn−1). In other words, in some sense, one can view Bv as an “extension” of the single row (w0, w1, . . . , wn−1) into an entire matrix that happens to be a rotation basis.
Denote the columns of Bv by v(k)=v·xi mod ƒ(x). We claim that




  
    v
    
      (
      k
      )
    
  
  =
  
    
      
        ∑
        
          i
          =
          k
        
        
          n
          -
          1
        
      
      ⁢
      
        
          x
          i
        
        ⁢
        
          
            ∑
            
              j
              =
              
                i
                +
                1
              
            
            n
          
          ⁢
          
            
              f
              j
            
            ·
            
              w
              
                j
                -
                i
                -
                1
                +
                k
              
            
          
        
      
    
    -
    
      
        ∑
        
          i
          =
          0
        
        
          k
          -
          1
        
      
      ⁢
      
        
          x
          i
        
        ⁢
        
          
            ∑
            
              j
              =
              0
            
            i
          
          ⁢
          
            
              f
              j
            
            ·
            
              w
              
                j
                -
                i
                -
                1
                +
                k
              
            
          
        
      
    
  




from which it follows that the coefficient of xn−1 in v(k) is indeed wk. This is clearly true for k=0; assume it is true for k′−1. We have that





   
  
    
      
        
          
            v
            
              (
              
                k
                ′
              
              )
            
          
          =
          
          ⁢
          
            x
            (
            
              
                
                  ∑
                  
                    i
                    =
                    
                      
                        k
                        ′
                      
                      -
                      1
                    
                  
                  
                    n
                    -
                    1
                  
                
                ⁢
                
                  
                    x
                    i
                  
                  ⁢
                  
                    
                      ∑
                      
                        j
                        =
                        
                          i
                          +
                          1
                        
                      
                      n
                    
                    ⁢
                    
                      
                        f
                        j
                      
                      ·
                      
                        w
                        
                          j
                          -
                          i
                          -
                          1
                          +
                          
                            k
                            ′
                          
                          -
                          1
                        
                      
                    
                  
                
              
              -
            
          
        
      
    
    
      
        
          
            
            ⁢
            
              
                ∑
                
                  i
                  =
                  0
                
                
                  
                    k
                    ′
                  
                  -
                  2
                
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      0
                    
                    i
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                        -
                        1
                      
                    
                  
                
              
            
            )
          
          ⁢
          mod
          ⁢
          
            
          
          ⁢
          
            f
            ⁡
            
              (
              x
              )
            
          
        
      
    
    
      
        
          =
          
          ⁢
          
            
              
                ∑
                
                  i
                  =
                  
                    k
                    ′
                  
                
                n
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      i
                    
                    n
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                      
                    
                  
                
              
            
            -
            
              
                ∑
                
                  i
                  =
                  1
                
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      0
                    
                    
                      i
                      -
                      1
                    
                  
                  ⁢
                  
                    
                      
                        f
                        j
                      
                      ·
                      
                        w
                        
                          j
                          -
                          i
                          -
                          1
                          +
                          
                            k
                            ′
                          
                        
                      
                    
                    ⁢
                    mod
                    ⁢
                    
                      
                    
                    ⁢
                    
                      f
                      ⁡
                      
                        (
                        x
                        )
                      
                    
                  
                
              
            
          
        
      
    
    
      
        
          =
          
          ⁢
          
            
              
                ∑
                
                  i
                  =
                  
                    k
                    ′
                  
                
                n
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      i
                    
                    n
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                      
                    
                  
                
              
            
            -
            
              
                ∑
                
                  i
                  =
                  1
                
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      0
                    
                    
                      i
                      -
                      1
                    
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                      
                    
                  
                
              
            
            -
          
        
      
    
    
      
        
          
          ⁢
          
            
              (
              
                
                  f
                  n
                
                ·
                
                  w
                  
                    
                      k
                      ′
                    
                    -
                    1
                  
                
              
              )
            
            ·
            
              f
              ⁡
              
                (
                x
                )
              
            
          
        
      
    
    
      
        
          =
          
          ⁢
          
            
              
                ∑
                
                  i
                  =
                  
                    k
                    ′
                  
                
                n
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      i
                    
                    n
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                      
                    
                  
                
              
            
            -
            
              
                ∑
                
                  i
                  =
                  1
                
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      0
                    
                    
                      i
                      -
                      1
                    
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                      
                    
                  
                
              
            
            -
          
        
      
    
    
      
        
          
          ⁢
          
            
              ∑
              
                i
                =
                0
              
              n
            
            ⁢
            
              
                x
                i
              
              ·
              
                w
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ·
              
                f
                i
              
            
          
        
      
    
    
      
        
          =
          
          ⁢
          
            
              
                ∑
                
                  i
                  =
                  
                    k
                    ′
                  
                
                n
              
              ⁢
              
                
                  x
                  i
                
                ⁡
                
                  (
                  
                    
                      
                        -
                        
                          f
                          i
                        
                      
                      ·
                      
                        w
                        
                          
                            k
                            ′
                          
                          -
                          1
                        
                      
                    
                    +
                    
                      
                        ∑
                        
                          j
                          =
                          i
                        
                        n
                      
                      ⁢
                      
                        
                          f
                          j
                        
                        ·
                        
                          w
                          
                            j
                            -
                            i
                            -
                            1
                            +
                            
                              k
                              ′
                            
                          
                        
                      
                    
                  
                  )
                
              
            
            -
          
        
      
    
    
      
        
          
          ⁢
          
            
              
                ∑
                
                  i
                  =
                  1
                
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ⁢
              
                
                  x
                  i
                
                ⁡
                
                  (
                  
                    
                      
                        f
                        i
                      
                      ·
                      
                        w
                        
                          
                            k
                            ′
                          
                          -
                          1
                        
                      
                    
                    +
                    
                      
                        ∑
                        
                          j
                          =
                          0
                        
                        
                          i
                          -
                          1
                        
                      
                      ⁢
                      
                        
                          f
                          j
                        
                        ·
                        
                          w
                          
                            j
                            -
                            i
                            -
                            1
                            +
                            
                              k
                              ′
                            
                          
                        
                      
                    
                  
                  )
                
              
            
            -
            
              
                w
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ·
              
                f
                i
              
            
          
        
      
    
    
      
        
          =
          
          ⁢
          
            
              
                ∑
                
                  i
                  =
                  
                    k
                    ′
                  
                
                n
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      
                        i
                        +
                        1
                      
                    
                    n
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                      
                    
                  
                
              
            
            -
            
              
                ∑
                
                  i
                  =
                  1
                
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ⁢
              
                
                  x
                  i
                
                ⁢
                
                  
                    ∑
                    
                      j
                      =
                      0
                    
                    i
                  
                  ⁢
                  
                    
                      f
                      j
                    
                    ·
                    
                      w
                      
                        j
                        -
                        i
                        -
                        1
                        +
                        
                          k
                          ′
                        
                      
                    
                  
                
              
            
            -
            
              
                w
                
                  
                    k
                    ′
                  
                  -
                  1
                
              
              ·
              
                f
                i
              
            
          
        
      
    
  




as required.

To show that v∈J−1, it suffices to prove that z←v×x∈R for any x∈J. Let Bx and Bz be the rotation bases of x and z. We know that Bz=Bv·Bx. We also know that the bottom row of Bz is an integer vector, since this row is w·Bx and w has an integer inner product with all vectors in J (which includes the column vectors of Bx).
Assume, toward a contradiction that z is not an integer vector—in particular, that i* is the largest such that the coefficient zi* is not an integer. Consider z(n−i*−1)←xn−i*−1·z mod ƒ(x), which is a column vector in Bz. In xn−i*−1·z, the coefficients of xn through x2n−i*−2—all of the highest coefficients—are integers. Therefore, since ƒ(x) is monic, z(n−i*−1)=xn−i*−1·z−a(x)·ƒ(x), where a(x) is an integer polynomial. On the other hand, the coefficient of xn−1 in xn−i*−1·z is not an integer, since zi* is not an integer. Consequently, since z(n−i*−1) differs from xn−i*−1·z by an integer polynomial, the coefficient of xn−1 in z(n−i*−1) is also not an integer. But we have established that the bottom row of Bz is integral, a contradiction. Therefore, z is in R and v∈J−1.
Regarding ∥Bv∥, we have established that each entry of this matrix is an inner product of two vectors—one vector with coefficients in {ƒ0, . . . , ƒn}, the other with coefficients in {w0, . . . , wn−1} (up to sign). The magnitude of each coefficient in Bv is therefore at most ∥ƒ∥·∥w∥, implying that ∥Bv∥≦√{square root over (n)}·∥ƒ∥·∥w∥.
8.2 Transference Lemmas for Ideal Lattices
As an easily corollary, we can obtain a bound on the determinant of J−1 in terms of det(J), and also place a bound on λn(J−1) in terms of λn(J). Not all ideals are “invertible” in the sense that it is not always the case that J−1. J=R. But we bound the discrepancy in the following lemma.

Lemma 8.3. Let J be a (possibly fractional) ideal of R=[x]/(ƒ(x)). Then, λn(J−1)≦√{square root over (n)}·∥ƒ∥·λ1(J*)≦n·∥ƒ∥/λn(J). Also, det(J−1)<nn·∥ƒ∥n/det(J).

Proof. Let w be a vector in J* of length λ1(J*). Generate v∈J−1 from w∈J* as in Lemma 8.2, and let Bv be its rotation basis. By Lemma 8.2, ∥Bv∥≦√{square root over (n)}·∥ƒ∥·∥w∥. By the transference theorem λ1(L)·λn(L*)≦√{square root over (n)} for general lattices, we have that ∥w∥≦√{square root over (n)}/λn(J) which implies the first statement. Since det(J*)=1/det(J), ∥w∥≦√{square root over (n)}/det(J)1/n by Minkowski, we have det(Bv)≦nn·∥ƒ∥n/det(J).

Using Lemma 8.3, we can upper bound λn(J) in terms of n, |ƒ| and det(J).
Lemma 8.4. Let J be an ideal of R=[x]/(ƒ(x)). Then, λn(J)<n·∥ƒ∥·det(J)1/n.
Proof. We have

λn(J)≦n·∥ƒ∥/λn(J−1)

≦n·∥ƒ∥/det(J−1)1/n 

≦n·∥ƒ∥·det(J)1/n  (by Lemma 8.3)

We have a similar result regarding the product of two general ideals (not necessarily inverses of each other).
Lemma 8.5. Let J and K be two (possibly fractional) ideals of R. Then, λn(JK)<n·∥ƒ∥(det(J)·det(K))1/n. Also, det(JK)≦nn·∥ƒ∥ndet(J)·det(K).
Proof. This would follow trivially from Lemma 8.4, except that it is possible that det(J·K)>det(J)·det(K) when J and K are divisible by singular primes.
By Lemma 8.3, we have that

λn(JK)≦√{square root over (n)}·∥ƒ∥·λ1(((JK)−1)*)

The determinant of the latter ideal is at most det(J)·det(K), since, in general, det(I1·I2)≧det(I1)·det(I2) and det(I)·det(I−1)≧1. So, by Minkowski, λn(JK)<n·∥ƒ∥(det(J)·det(K))1/n.

By Lemma 8.3, we have that det(JK)·det((JK)−1)<nn·∥ƒ∥n. So, we have

nn·∥ƒ∥n≧det(JK)·det((JK)−1)

≧det(JK)·det(J−1)·det(K−1)

≧det(JK)·det(J*)·det(K*)

from which the result follows.

8.3 Tweaking the Decryption Equation

Having characterized the relationship between the inverse and the dual, we return to our first tweak.

Tweak 1: From BI and secret key BJsk, compute a certain short vJsk∈J−1 and redefine decryption to output π=ψ−└vJsk×ψ┐ mod BI. Also, redefine ε, so that it instead uses (rDec/(n2.5·∥ƒ∥·∥BI∥) instead of (rDec).

Purpose: To simplify the decryption equation and improve computational efficiency.

This tweak is not actually essential, since matrix-vector multiplication is just as parallelizable as ring multiplication—i.e., the circuits have essentially the same depth. However, the tweak reduces the size of our secret key. This will help reduce the computational complexity of decryption (and, thus, the computational complexity of the homomorphic decryption step in bootstrapping). Essentially, it makes the already shallow decryption circuit less wide.
Tweak 1 requires us to reduce the permitted distance of ciphertexts from the J-lattice. But it does not affect our maximum evaluation depth very much when |ƒ| and ∥BI∥ are only polynomial in n, and rDec/rEnc is super-polynomial (as it will need to be to make our scheme bootstrappable).
Toward understanding how this simplification works, suppose that it is the case that BJsk is the rotation basis for some vector wJsk∈[x]/(ƒ(x)). Let xJsk=1/wJsk∈[x]/(ƒ(x)). Then, since the rotation basis of xJsk is precisely (BJsk)−1, and by properties of rotation bases we have that

π=ψ−BJsk·└(BJsk)−1·ψ┐ mod BI=ψ−ψ−wJsk×└xJsk×ψ┐ mod BI 

As for generating the initial BJsk as a rotation basis, for now we just mention that the ad hoc instantiation of IdealGen given in Section 7.6 suffices. However, as the lemmas below establish, Tweak 1 works even when BJsk is not a rotation basis.

Lemma 8.6. Let BJsk be an initial secret basis that decrypts correctly for parameter rDec. From BJsk and BI, we can compute in polynomial time a vector vJsk∈J−1 such that the rotation basis of 1/vJsk circumscribes a ball of radius at least rDec/(n2.5·∥ƒ∥·∥BI∥). In particular, if ψ is a valid ciphertext according to Tweak 1, in the sense that it equals π+i+j for plaintext π, i∈I, j∈J, and π+i∈(rDec/(n2.5·∥ƒ∥·∥BI∥), then π=ψ−(vJsk)−1×└vJsk×ψ┐ mod BI. For our particular value of vJsk∈J−1, it will also hold that π=ψ−└vJsk×ψ┐ mod BI.

Proof. Since BJsk be an initial secret basis that decrypts correctly for parameter rDec, Lemma 7.6 tells us that ∥((BJsk)−1)T∥≦1⁄2rDec. Let w∈J* be a vector in this basis. By Lemma 8.2, we can use w to generate a vector x∈J−1 whose rotation basis Bx has length at most √{square root over (n)}·∥ƒ∥·∥w∥≦√{square root over (n)}·∥ƒ∥/2rDec. From Bx and a vector in I of length at most ∥BI∥, we can generate an independent set BJ−1I of (x)·I⊂J−1I of length at most √{square root over (n)}·∥Bx∥·∥BI∥≦n·∥ƒ∥·∥BI·/2rDec. We set vJsk←e1 mod BJ−1I. It has length at most n2·∥ƒ∥·∥BI∥/2rDec.

Let BJ† be the rotation basis of (vJsk)−1; we want to prove that this basis can be used as the secret key for ciphertexts that are valid according to Tweak 1. Certainly BJ† fulfills the requirement of generating a super-lattice of J, since vJsk generates a sub-lattice of J−1. It remains to show that a large enough sphere is circumscribed by BJ†. Let r′Dec be the radius of the largest such sphere. We have

r′Dec≧1/(2√{square root over (n)}·∥(BJ†)−1∥)≧rDec/(n2.5·∥ƒ∥·∥BI∥)

where the first inequality follows from Lemma 8.1, and the second substitutes in the upper bound on the length of the rotation basis for vJsk. The correctness of decryption with the new key follows.

However, now we need to establish that we can simply drop the (vJsk)−1 term in the decryption equation. Since I and J are relatively prime, there is a vector j∈J∩(1+I). Such a j can be found efficiently using the Chinese remainder theorem and bases for I and J. Let r=j×vJsk. Since vJsk∈J−1, we have r∈R. In fact, since vJsk∈1+J−1I, we have r∈1+I. Since, by the correctness of decryption, we know that (vJsk)−1×└vJsk·ψ┐∈R (even though vJsk)−1 may not be in R, we have the following congruences modulo I:




   
  
    
      
        
          
            
              
                (
                
                  v
                  J
                  sk
                
                )
              
              
                -
                1
              
            
            ×
            
              ⌊
              
                
                  v
                  J
                  sk
                
                ·
                ψ
              
              ⌉
            
          
          =
          
          ⁢
          
            r
            ×
            
              
                (
                
                  v
                  J
                  sk
                
                )
              
              
                -
                1
              
            
            ×
            
              ⌊
              
                
                  v
                  J
                  sk
                
                ·
                ψ
              
              ⌉
            
          
        
      
    
    
      
        
          =
          
          ⁢
          
            j
            ×
            
              ⌊
              
                
                  v
                  J
                  sk
                
                ·
                ψ
              
              ⌉
            
          
        
      
    
    
      
        
          =
          
          ⁢
          
            ⌊
            
              
                v
                J
                sk
              
              ·
              ψ
            
            ⌉
          
        
      
    
  




8.4 A Tweak to Reduce the Circuit Complexity of the Rounding Step in Decryption

Tweak 2 will actually be more critical than Tweak 1 for reducing the depth of our decryption circuit and enabling bootstrapping.

Tweak 2: Redefine the set of permitted circuits ε, replacing (rDec) with (rDec/2).

Purpose: To ensure that ciphertext vectors are closer to the lattice J than they strictly need to be, so that we will need less “precision” to ensure the correctness of decryption.

Remark 8.7. If using Tweak 1 and Tweak 2, then use (rDec/(2n2.5·∥ƒ∥·∥BI∥) in the redefinition of permitted circuits—i.e., a radius half as small as the one used in Tweak 1. For simplicity, in this Subsection, we will abuse notation and use rDec to refer to the value of the permitted radius before Tweak 2.

The purpose of the tweak will become clearer as we delve into the details of the decryption circuit. But, briefly, recall that Decrypt computes BJsk1. └(BJsk2)−1·ψ┐. (If Tweak 1 is used, then BJsk1 is just the identity matrix and (BJsk2)−1 is the rotation basis of vJsk.) If we permitted the coefficients of (BJsk2)−1·ψ to be very close to half-integers, we would need high precision to ensure correct rounding. However, after Tweak 2, we have the following lemma:

Lemma 8.8. If ψ is a valid ciphertext after Tweak 2, then each coefficient of (BJsk2)−1·ψ is within 1⁄4 of an integer.

Proof. Observe that ψ∈(rDec/2)+J. Let ψ=x+j for x∈(rDec/2) and j∈J. We have (BJsk)−1·ψ=(BJsk)−1·x+(BJsk)−·j, where the former term has coefficients of magnitude at most 1⁄4 by Lemma 7.6 and the latter is an integer vector.

This fact will help us simplify our decryption circuit, and does not substantially impair the evaluative capacity of our scheme. The new maximum evaluation depth, per Theorem 7.2, is log log(rDec/2)·log log(γMult(R)·rEnc), which is less than the original amount by only a subconstant additive factor.
Again, to use Tweaks 1 and 2 simultaneously, use (rDec/(2n2.5·∥ƒ∥·∥BI∥).
9 Decryption Complexity of the Tweaked Scheme
To decrypt, we compute

(ψ−BJsk1·└BJsk2·ψ┐)mod BI 

where ψ∈n, BJsk1∈n×n, BJsk2∈n×n, and BI is a basis of an ideal I of R=[x]/(ƒ(x)). From Tweak 2, we have the promise that the coefficients of BJsk2·ψ are all within 1⁄4 of an integer. Optionally, Tweak 1 ensures that BJsk1 is the identity matrix and BJsk2 is a rotation matrix. How do we optimally express this computation as a circuit?

Let us split the computation into pieces—in particular, the following steps:
Step 1: Generate n vectors x1, . . . , xn with sum BJsk2·ψ.
Step 2: From the n vectors x1, . . . , xn, generate integer vectors y1, . . . , yn+1 with sum └Σxi┐.
Step 3: Compute π←ψ−BJsk1·(Σyi)mod BI 
We do not claim that this way of splitting up the computation leads to an optimal decryption circuit. But, we will eventually see that, thanks to Tweak 2, Step 3 can be done in constant depth using a circuit with polynomial fan-in addition gates. (In Theorem 7.2, we saw that constant fan-in multiplication gates were as bad as, or worse than, polynomial fan-in addition gates.) We will see that Step 2 requires a deep circuit, but that there is a way to squash this aspect of the computation. (See Section 10.) Step 1 could be done by multiplying the n columns of BJsk2 by the n coefficients of ψ. But our method for squashing the decryption circuit will eliminate Step 1. So, we will concentrate on analyzing the complexity of Steps 2 and 3 in this Section.
To better understand the circuit complexity issues here, consider the problem of adding n numbers in [0, 1), each one a fraction in [0, 1) represented in binary with k bits of precision. As far as we know, this requires a constant fan-in boolean circuit of depth Ω(log n+log k). Here is a concrete example of such a circuit. First, we use the “3-for-2” trick (see Karp's survey of parallel algorithms, R. Karp, “A Survey of Parallel Algorithms for Shared Memory Machines”): given 3 numbers in binary representation, there is a constant-depth (say, depth c) boolean circuit that replaces these 3 numbers with 2 numbers having the same sum. (Essentially, one of the two numbers receives the XOR of the 3 addends, and the other number receives the carry bits.) Using this trick recursively, one can replace n numbers with 2 numbers having the same sum in depth approximately c·log3/2n. As for adding the final two numbers, there is certainly no general guarantee that this can be done in constant depth. The problem is that the least significant bit of the addends could affect the most significant bit of the sum. One needs Ω(log k) depth to ensure the final sum is computed correctly.
But suppose one is given the promise that the sum of the numbers is very close to an integer, and that one is only interested in computing this integer. In this case, we can eliminate all but O(log n) bits of precision in each of the n addends, and still obtain the correct result. This integer can be computed in c log3/2n+O(log log n) depth; there is no longer any dependence on k. Indeed, this was the purpose of Tweak 2—to obtain exactly this promise.
However, the c log3/2n term is still problematic for us. We have seen that our somewhat homomorphic scheme can evaluate O(log n) depth, but where the hidden constant is less than 1, whereas the c induced by the 3-for-2 trick (combined with the constant log3/22) is certainly greater than 1, and thus prevents bootstrapping. Also, even after we apply our “squashing the decryption circuit” technique to make our scheme bootstrappable, a constant factor in the depth of the decryption circuit makes a huge difference in the performance and security of the scheme. Can we make this constant smaller?
Toward this goal, we compute the rounded sum using elementary symmetric polynomials. Roughly speaking, using symmetric polynomials eliminates some of the inefficiencies of the 3-for-2 technique. Also, although we have been saying (as shorthand) that we want to minimize the “depth” of the decryption circuit Dε, this is an oversimplification; we are actually trying to minimize ∥Dε(x1, . . . , xt)∥ where the inputs xi are in (rEnc). The value ∥Dε(x1, . . . , xt)∥ is actually more tightly related to the degree of the multivariate polynomial Dε(x1, . . . , xt) than to the depth of the circuit that computes this polynomial. Elementary symmetric polynomials are the lowest-degree multivariate polynomials (that we know of) that compute certain Hamming weights that arise when computing the sum of numbers.
What do elementary symmetric polynomials have to do with adding up n numbers, represented in binary? Let {ai} be the n numbers, where ai has bits (ai,−1, . . . , ai,−T). We can add up these numbers by separately adding up the least significant bits of the numbers, the penultimate bits, etc., and thereafter combining the partial results. That is, for j∈[−1, −T], we compute the Hamming weight bj, represented in binary, of (a1,j, . . . , an,j), and then we add up the T numbers bj. (We established above that the precision T only needs to be logarithmic in n, so this final step should take up much less depth than computing the binary representations bj of the Hamming weights.) Now, it turns out, through the magic of binomial coefficients, that the binary representation of the Hamming weight of (x1, . . . , xn) is given by

(e2└log n┐(x1, . . . ,xn)mod 2, . . . ,e20(x1, . . . ,xn)mod 2)

where ei(x1, . . . , xn) is the ith elementary symmetric polynomial over x1, . . . , xn. The highest degree among these polynomials is at most n, versus the multivariate polynomial we would obtain from the 3-for-2 trick, which has degree nc for some c>1. Also, we know how to efficiently evaluate the elementary symmetric polynomials. They are simply coefficients of the polynomial p(z)=Σi=1n(z−xi).

We have been talking about the decryption circuit as if it is boolean. However, for bootstrapping to work—i.e., to be able to perform decryption homomorphically—we know that we need to express decryption as a mod-BI circuit. Of course, one option is simply to take I=(2). (We hasten to add that the reduction given in Section 5 applies even for I=(2).) In any case, it is easy to emulate boolean circuits using mod-BI circuits for any I. In particular, for x, y∈{0, 1}, the value 1−x×y equals NAND(x, y)∈{0, 1}, regardless of the ring of cosets in which the computation is performed. We restrict the plaintext space  to be {0, 1} mod BI, and represent the inputs and output as elements of this restricted plaintext space, regardless of the underlying ideal I. Of course, this plaintext space restriction is unnecessary if we use the somewhat homomorphic scheme without bootstrapping.
Restricting the plaintext space to {0, 1} rather than using all det(I) cosets of I, just so that we can emulate boolean circuits, seems rather wasteful and inefficient. Is this waste necessary? We leave this as an open problem to which we have not found a satisfactory solution. As far as we can tell, adding terms represented in general “base-I”, where det(I) is large, results in “carries” that are represented by multivariate polynomials of degree too high for our purposes.
Now, we have the following lemma regarding Step 2.
Lemma 9.1. For i∈[1, t], let ai=( . . . , ai,1, ai,0, ai,−1, . . . ) be a real number given in binary representation mod BI with the promise that Σi ai mod 1∈[−1⁄4,1⁄4]. There is a mod-BI circuit C for generating t+1 integers z1, . . . , zt+1 (also represented in binary) whose sum is └Σi ai┐, such that if the generalized circuit g(C)'s inputs are in (rin), then its outputs are in (rout) for:

rout≦(γMult(R)·n·∥BI∥·(1+γMult(R)·rin)t·t)poly log(t) 

For ∥BI∥≦rin, t≦n, and γMult(R)=nΩ(1), we have:

rout≦(γMult(R)·rin)t·poly log(t) 

Proof. Let a*i be the integer part of ai and let ai†=(ai,−1, ai,−2, . . . ) be the fractional part. Let T=└log t┐+2. Let bi=(ai,−1†, . . . , ai,−T†). First, we claim that └Σai†┐=└Σbi┐—i.e., that truncating the least significant bits of the ai†'s does not affect the rounded sum. This claim follows from the promise that Σiai† is within 1⁄4 of an integer, and that





  
    
    
      
        
          ∑
          i
        
        ⁢
        
          a
          i
          †
        
      
      -
      
        
          ∑
          i
        
        ⁢
        
          b
          i
        
      
    
    
  
  =
  
    
      
      
        
          ∑
          i
          
            j
            ∈
            
              [
              
                
                  T
                  +
                  1
                
                ,
                ∞
              
              ]
            
          
        
        ⁢
        
          
            2
            
              -
              j
            
          
          ·
          
            a
            
              i
              ,
              
                -
                j
              
            
          
        
      
      
    
    <
    
      1
      /
      4
    
  




The t+1 integers that we will eventually output will be a*1, . . . , a*t, └Σbi┐.

Our strategy for computing └Σbi┐ is first to compute, for each j∈[1, T], the binary representation cj of the Hamming weight of (b1,−j, . . . , bt,−j). Then, we finish by computing the sum └Σj=1T2−j·cj┐; this latter term is much easier to compute than the original term, since it only consists of T numbers, rather than t.
This strategy is straightforward when I=(2·e1) and the plaintext space is {0, 1} mod I. The binary representation of the Hamming weight of (x1, . . . , xt) is given by

(e2log t┘(x1, . . . ,xt)mod 2, . . . ,e20(x1, . . . ,xt)mod 2)

where ei(x1, . . . , xt) is the ith elementary symmetric polynomial over x1, . . . , xt. These elementary symmetric polynomials can obviously be computed efficiently. Specifically, one obtains them as the coefficients of the polynomial





  
    p
    ⁡
    
      (
      z
      )
    
  
  =
  
    
      ∏
      
        i
        =
        1
      
      t
    
    ⁢
    
      
    
    ⁢
    
      
        (
        
          z
          -
          
            x
            i
          
        
        )
      
      .
    
  




The next step would be to bound ∥e2k(x1, . . . , xt)∥ for xi∈(rin), for k∈{0, . . . , └log t┘}.

However, for I≠(2·e1) the situation is complicated by the fact that reduction modulo 2 does not occur automatically in the mod-BI circuit. Here we use a slightly different approach (which also works when I=(2·e1)). Let M∈(t+1)×(t+1) be given by Mij=(ji) for i, j∈[0, t]. Let M−1 be a matrix with elements in R mod I such that M−1. M is the identity matrix modulo I; M is invertible modulo I, since det(M)=1. First, our circuit will compute v←(e0(b1, . . . , bt), . . . , et(b1, . . . , bt))T. Note that M−1·v=eh, which is essentially the Hamming weight h of (b1, . . . , bt) in unary. From the unary, we obtain the binary expression by computing the inner product of eh with the multi-vector (c0, . . . , ch, . . . , ct), where ci is the binary representation of i.
Let C be the mod-BI sub-circuit above for computing any bit of the binary representation of the Hamming weight. Using n·∥BI∥ as an upper bound on the length of elements in R mod BI, we have




  
    
      
      
        
          g
          ⁡
          
            (
            C
            )
          
        
        ⁢
        
          (
          
            
              x
              1
            
            ,
            ...
            ⁢
            
              
            
            ,
            
              x
              t
            
          
          )
        
      
      
    
    ≤
    
      
        
          γ
          Mult
        
        ⁡
        
          (
          R
          )
        
      
      ·
      n
      ·
      
        
        
          B
          I
        
        
      
      ·
      
        (
        
          
            ∑
            
              i
              ∈
              
                [
                
                  0
                  ,
                  t
                
                ]
              
            
          
          ⁢
          
            
            
              
                e
                i
              
              ⁡
              
                (
                
                  
                    x
                    1
                  
                  ,
                  ...
                  ⁢
                  
                    
                  
                  ,
                  
                    x
                    t
                  
                
                )
              
            
            
          
        
        )
      
      ·
      t
    
    ≤
    
      
        
          γ
          Mult
        
        ⁡
        
          (
          R
          )
        
      
      ·
      n
      ·
      
        
        
          B
          I
        
        
      
      ·
      
        (
        
          
            ∑
            
              i
              ∈
              
                [
                
                  0
                  ,
                  t
                
                ]
              
            
          
          ⁢
          
            
              (
              
                
                  
                    t
                  
                
                
                  
                    i
                  
                
              
              )
            
            ⁢
            
              
                
                  
                    γ
                    Mult
                  
                  ⁡
                  
                    (
                    R
                    )
                  
                
                
                  i
                  -
                  1
                
              
              ·
              
                r
                in
                i
              
            
          
        
        )
      
      ·
      t
    
  
  =
  
    n
    ·
    
      
      
        B
        I
      
      
    
    ·
    
      
        (
        
          1
          +
          
            
              
                γ
                Mult
              
              ⁡
              
                (
                R
                )
              
            
            ·
            
              r
              in
            
          
        
        )
      
      t
    
    ·
    t
  




At this point, we have generated T numbers, each with O(T) bits, with the same sum as Σbi. There is a O(log T)-depth constant fan-in boolean circuit for computing this sum, which can be emulated by a O(log T)-depth mod-BI circuit. (We omit the details.) Combining the above with results in the proof Theorem 7.2, the result follows.
Unfortunately, Step 2 uses t=n, implying rDec/rEnc≧rout/rin>2n, and therefore the above analysis cannot show that the scheme is both bootstrappable and secure. However, Lemma 9.1 will be relevant to our final scheme, as will the following lemma regarding Step 3:
Lemma 9.2. Using a constant depth circuit having polynomial fan-in AddBI gates and constant fan-in MultBI gates, we can compute ψ−BJsk1·(Σyi) mod BI from a binary representation (using the bits {0, 1} mod BI) of the terms of the expression.
The proof of Lemma 9.2 involves converting the binary representation of the terms to a more “natural” mod-BI representation, at which point the computation is trivially constant depth. As a toy example for intuition, suppose we have mod-13 gates, where the numbers 0, . . . , 12 are represented by 13 different “frequencies” (not in terms of a binary representation), and Add13 and Mult13 perform addition and multiplication modulo 13 “automatically.” Also suppose that we are given a number b= . . . b1b0 in binary representation, where each of the bi is separately represented by the frequency for ‘0’ or ‘1’ (not by any of the other 11 frequencies). For example, suppose 9 is represented as 1001 rather than by the natural frequency for ‘9’. From the initial representation of b, how do we compute the “natural” representation of b mod 13 as a single frequency (from among the 13 different frequencies)? First, we precompute the frequencies aj←2j mod 13. Next, we output Add13 ( . . . , Multi3(a1, b1), Mult13(a0, b0)). Using polynomial-fan-in Add13 gates, this takes constant depth even if b has a polynomial number of bits. Essentially the same considerations apply in the proof of Lemma 9.2. The simplest case is where I=(2) and the conversion is unnecessary.
Proof. For a slightly simpler case, let us first assume that BJsk1 is a rotation basis, so that the remaining decryption computation is to compute ψ−vJsk1×(Σyi) mod BI for vJsk1∈R. Consider one of the vectors—say, y←y1. How do we compute the “natural” representation of y mod BI?
Currently, the ith coefficient yi of y is represented by the elements yix×e1, . . . , yi0×e1∈{0, 1} mod BI where yi=Σj=0x2j·uij. So, we have




  y
  =
  
    
      ∑
      
        
          i
          ∈
          
            [
            
              1
              ,
              n
            
            ]
          
        
        ,
        
          j
          ∈
          
            [
            
              0
              ,
              x
            
            ]
          
        
      
    
    ⁢
    
      
        2
        j
      
      ×
      
        (
        
          
            y
            ij
          
          ×
          
            e
            1
          
        
        )
      
      ×
      
        e
        i
      
      ⁢
      mod
      ⁢
      
        
      
      ⁢
      
        B
        I
      
    
  




After pre-computing values aj←2j mod BI for j∈[0, x], we can compute this representation of y mod BI by using two levels of MultBI gates (since each term in the sum is the product of three terms) and then logƒ(n) (nx) levels of ƒ(n)-fan-in AddBI gates. Overall, this is constant depth assuming y was initially represented by a polynomial number of bits.

We obtain the natural mod-BI representations of the other vectors in a similar fashion. Thereafter, we compute the result in constant depth, using one level to compute vJsk1×yi mod BI for each i and a constant number of polynomial fan-in mod-BI gates for addition.
The case of a general matrix BJsk1 is only slightly more complicated. Basically, since the matrix inhibits our use of ring multiplication, we first compute the “natural” mod-BI representation of each individual coefficient (rather than the full vector), multiply the coefficients together in the proper fashion to obtain the natural representations of coefficients in the vectors BJsk1·yi, and then multiply the representations by the appropriate ei's, and add the results modulo BI.
At this point, it may be tempting to ask: how is a mod-BI gate implemented, and doesn't this implementation add to the decryption complexity? But we have shown that ring addition and multiplication applied to ciphertexts induces mod-BI operations over plaintexts: e.g., adding two ciphertexts that encrypt π1 and π2 mod BI gives a third ciphertext that encrypts π3=π1+π2 mod BI—i.e., already reduced modulo BI. The mod-BI operations, implicitly applied to plaintexts, come for free with the ring operations applied to ciphertexts (up to a point defined by the permitted circuits ε).
From Lemmas 9.1 and 9.2, we conclude that, aside from the coefficient multiplication operations in the computation of BJsk2·ψ that we have ignored, the depth of our decryption circuit is O(log n), where the hidden constant is greater than 1. By Theorem 7.2, the maximum depth that we can evaluate is d=log log rDec−log log γMult(R)·rEnc. Can we take d to be greater than log n?
Unfortunately, the answer appears to be ‘no.’ Specifically, the dominant computation in decryption is └(BJsk)−1·ψ┐, which occurs within the computation of ψ mod BJsk. Roughly speaking, to ensure that the rounding is correct, one must use a sufficient number of bits of precision. Then, the high precision of each number-number multiplication that occurs within the matrix-vector multiplication forces us to use a high-depth circuit. Specifically, two k-bit numbers can be multiplied together using a O(log k)-depth circuit (with constant fan-in). The precision we seem to need is roughly log det(J)>n·log rDec bits, and therefore we need about a O(log n+log log rDec)-depth circuit.
Unfortunately, for this initial scheme, it seems that no matter how the parameters are set, the decryption circuit is always slightly too complex for the scheme to evaluate.6 This problem is difficult to fix post hoc, in part due to the self-referential nature of the bootstrapability property: intuitively, if one expands the set of circuits that ε can “handle” in an effort to include Dε, one seemingly must increase the complexity of Decryptε to accommodate, thereby making the circuit Dε more complex, possibly such that Dε always elusively falls outside of the expanded set. To obtain a bootstrappable encryption scheme, it seems necessary to change the decryption algorithm fundamentally. 6However, we do not prove this. It remains possible that the decryption circuit of this initial scheme can be expressed in a way that makes the scheme bootstrappable.
10 Squashing the Decryption Circuit
Let ε* be the encryption scheme described in Section 7, modified by Tweak 2 and preferably also Tweak 1 as described in Section 8. In this Section, we describe how to transform ε* so as to lower the complexity of the decryption circuit and achieve a bootstrapable scheme. A crucial point is that this transformation does not reduce the evaluative capacity at all—i.e., the set of permitted circuits remains fixed. Of course, there is a price: in our new scheme ε, we potentially weaken security by including information about the ε* secret key inside the ε public key. We first describe our transformation generically. We prove security of ε (generically) based on ε* and the assumed hardness of a certain abstract distinguishing problem, where the latter arises from the new information included in the ε public key. We then instantiate the transformation, where the distinguishing problem becomes a lattice problem that we discuss in Section 11.
10.1 A Generic Description of the Transformation
At a high level, our transformation works by splitting the original decryption algorithm into two phases—an initial computationally intensive preprocessing phase performed without the secret key (by the encrypter), followed by a computationally lightweight phase using the secret key (by the decrypter). In short, the encrypter preprocesses its own initial ciphertext, leaving less work for the decrypter to do.
Interestingly, this two-phase approach to decryption is precisely what one finds in server aided cryptography. In that setting, a user wants to minimize its cryptographic computation—e.g., because it is using a constrained device, such as a smartcard or handheld. So, it outsources expensive computations to a server. To set up this arrangement, the user (in some schemes) must give the server a tag T that is statistically dependent on its secret key sk, but which is not sufficient to permit the server to decrypt efficiently on its own. The processing that the server performs may expand the size of the ciphertext substantially, but nonetheless the processed ciphertext requires less computation for the user to decrypt. In our setting, the encrypter plays the role of the server. We will also use a secret-key-dependent tag τ and suffer from ciphertext expansion.
Now, we describe the transformation in detail. Let ε* be the initial encryption scheme. We construct a modified scheme ε that uses two new algorithms, SplitKeyε and ExpandCTε, that will remain abstract for now.
KeyGenε(λ). Runs




  
    (
    
      
        pk
        *
      
      ,
      
        sk
        *
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      KeyGen
      
        ɛ
        *
      
    
    ⁡
    
      (
      λ
      )
    
  




and





  
    (
    
      sk
      ,
      τ
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      
        SplitKey
        ɛ
      
      ⁡
      
        (
        
          
            sk
            *
          
          ,
          
            pk
            *
          
        
        )
      
    
    .
  




The secret key is sk. The public key pk is (pk*, τ).

Encryptε(pk, π). Runs ψ*←Encryptε*(pk*, π). It then sets ψ to include ψ* and the output of ExpandCTε(pk, ψ*). (ExpandCTε makes heavy use of τ.)

Decryptε(sk, ψ*). Uses sk and expanded ciphertext to decrypt more efficiently. Decryptε(sk, ψ) should work whenever Decryptε*(sk*, ψ*) works.

Addε(pk, ψ1, ψ2). Extracts (ψ*1, ψ*2) from (ψ1, ψ2), computes ψ*←Addε*(pk*, ψ*1, ψ*2), and sets ψ to include ψ* and the output of ExpandCTε(pk, ψ*). Multε(pk, ψ1, ψ2) is analogous.

The security of the transformation relies on the following problem, which is completely abstract at this point.

Definition 10.1 (SplitKey Distinguishing Problem). The challenger sets





  
    (
    
      
        sk
        *
      
      ,
      
        pk
        *
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    KeyGen
    
      ɛ
      *
    
  




and





  
    b
    ⁢
    
      ←
      R
    
    ⁢
    
      {
      
        0
        ,
        1
      
      }
    
  
  ,




If b=0, it sets





  
    (
    
      sk
      ,
      τ
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    
      SplitKey
      ⁡
      
        (
        
          
            sk
            *
          
          ,
          
            pk
            *
          
        
        )
      
    
    .
  




If b=1, it sets





  
    
      (
      
        sk
        ,
        τ
      
      )
    
    ⁢
    
      ←
      R
    
    ⁢
    
      SplitKey
      ⁡
      
        (
        
          ⊥
          
            ,
            
              pk
              *
            
          
        
        )
      
    
  
  ,




where ⊥ is a special symbol. The problem: guess b given (τ, sk*, pk*).

Theorem 10.2. Suppose that there is an algorithm  that breaks the semantic security of ε above with advantage ∈. Then, there exist algorithms 0 and 1, running in about the same time as , such that either 0's advantage against the SplitKey Distinguishing Problem or 1's advantage against the semantic security of ε* is at least ∈/3.

Proof. Let Game 0 be the real-world semantic security game. Game 1 is like Game 0, except the challenger generates pk differently. Specifically, instead of inputting sk* into SplitKey, it inputs ⊥ to obtain τ, and adds τ to the pk it sends to . By assumption, ∈ is 's advantage in Game 0. Let ∈′ be 's advantage in Game 1.

0 runs as follows. The challenger sets bit




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and sends a SplitKey Distinguishing Problem instance (τ, sk*, pk*) to 0. 0 sends pk←(pk*, τ) to . When  asks for a challenge ciphertext on one of (τ0, τ1), 0 sets





  β
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and sends ψ←Encryptε(pk, τβ). Eventually,  sends a bit β′. 0 sends b′←β⊕β′ to the challenger. Note that the public key pk (and the other aspects of the simulation) is distributed exactly as in Game b. We compute that 0's advantage is at least |∈−∈′|/2.

1 runs as follows. It obtains an ε* public key pk* from the challenger. It runs




  
    (
    
      sk
      ,
      τ
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    SplitKey
    ⁡
    
      (
      
        ⊥
        
          ,
          
            pk
            *
          
        
      
      )
    
  




and sends pk←(pk*, τ) to . When  asks for a challenge ciphertext on one of (τ0, τ1), 1 asks the challenger for a challenge ciphertext on one of (τ0, τ1). The challenger sends back ψ*. 1 sets ψ to include ψ* and the output of ExpandCTε(pk, ψ*) and sends ψ to .  sends a bit b′, which 1 forwards to the challenger. We see that the distribution is the same as in Game 1. Also, 1's bit is correct if 's bit is correct; so 1 has advantage ∈′.

In the next Subsection, we specify how to instantiate SplitKey, ExpandCT, and the new Decrypt algorithm. After that, we will analyze the new decryption circuit, and prove that we finally have a bootstrappable encryption scheme. We will consider the hardness of our concrete version of the SplitKey Distinguishing Problem in Section 11.
10.2 How to Squash, Concretely
Let vJsk* be the secret key vector of our somewhat homomorphic encryption scheme ε* after Tweak 1. (Our concrete transformation below can be adapted to handle the scheme without Tweak 1, but handling a secret matrix rather than a secret vector is less efficient.) Recall that this vector is an element of the fractional ideal J−1. Also, recall our decryption equation:

τ=ψ−└vJsk*×ψ┐ mod BI 

The idea of our abstract transformation was to place a “hint” about the ε* secret key inside the ε public key; what hint do we give about vJsk*?

Our hint will consist of a set of vectors that has a (secret) sparse subset of vectors whose sum is essentially vJsk*. More specifically, the set of vectors τ is t1, . . . , tγsetsize(n)∈J−1, where γsetsize(n) is a parameter that is polynomial in n. S⊂{1, . . . , γsetsize(n)} will be a subset of indices having cardinality γsubsetsize(n). And it will hold that Σi∈Sti=vJsk* mod I. The new secret key sk is a 0/1-matrix encoding the subset S. The SplitKey distinguishing problem becomes essentially: given vJsk* and τ decide whether there is actually a sparse subset whose sum if vJsk* mod I, or whether there is a sparse subset whose sum is 0 mod I.
In the ExpandCT operation, the “encrypter” processes a ciphertext ψ* output by the original scheme ε* by computing all of the products ci←ti×ψ* mod BI and including them in the new ciphertext ψ. To decrypt ψ, the user basically extracts the γsubsetsize(n) ci's that are “relevant”—the ci's for which i∈S. It then uses the decryption equation




  π
  =
  
    
      ψ
      *
    
    -
    
      
        ⌊
        
          
            ∑
            
              i
              ∈
              S
            
          
          ⁢
          
            c
            i
          
        
        ⌉
      
      ⁢
      mod
      ⁢
      
        
      
      ⁢
      
        B
        I
      
    
  




which can easily be verified to be correct.

This transformation will actually end up increasing the computational complexity of decryption. However, the important point is that the ExpandCT operation, which does not need to be performed homomorphically, prepares a ciphertext that can be decrypted by a shallower circuit. The essential reason is that summing up γsubsetsize(n) values (in the new decryption equation) requires much less depth—less than log n, as we will see—when γsubsetsize(n) is much less than n. We now describe the transformation more formally.
Let (sk*, pk*) be an ε* key pair. Let γsetsize(n) and γsubsetsize(n) be functions, where the former is w(n) and poly(n) and the latter is w(1) and o(n). Here are the concrete instantiations of SplitKeyε, ExpandCTε, and Decryptε used to construct ε.
SplitKeyε(sk†, pk*). Takes as input sk†, which may be either sk* or ⊥. If the former, it extracts the vector vJsk* from sk*; if the latter, it sets vJsk*←0. It outputs (sk, τ), where:


    
    
        τ is a set of γsetsize(n) vectors t1, . . . , tγsetsize(n) that are uniformly random in J−1 mod BI, except there exists a subset S⊂{1, . . . , γsetsize(n)} of cardinality γsubsetsize(n) such that Σi∈Sti∈vJsk*+I.
        sk is a matrix γsubsetsize(n)×γsetsize(n) matrix M of 0's and 1's, where Mij=1 if j is the ith member of S.

ExpandCTε(pk,ψ*). Outputs ci←ti×ψ* mod BI for i∈[1, γsetsize(n)].

Decryptε(sk,ψ). Takes as input the secret key sk and a ciphertext ψ. It performs the following steps:

Step 0: Set the vectors wij←Mij·cj 

Step 1: Set the vectors

    
    






  
    x
    i
  
  ←
  
    
      ∑
      
        j
        =
        1
      
      
        
          γ
          setsize
        
        ⁡
        
          (
          n
          )
        
      
    
    ⁢
    
      w
      ij
    
  




Step 2: From x1, . . . , xγsubsetsize(n), generate integer vectors y1, . . . , yγsubsetsize(n)+1 with sum └Σxi┐.

Step 3: Compute Σ←ψ*—(Σyi) mod BI 

Remark 10.3. To generate τ, one may, for example, just set t1, . . . , tγsetsize(n)−1 to be uniformly random vectors in J−1∩(BI). Then, one sets





  
    t
    
      
        γ
        setsize
      
      ⁡
      
        (
        n
        )
      
    
  
  ←
  
    
      v
      J
      
        sk
        *
      
    
    -
    
      
        ∑
        
          i
          =
          1
        
        
          
            
              γ
              subsetsize
            
            ⁡
            
              (
              n
              )
            
          
          -
          1
        
      
      ⁢
      
        
          t
          i
        
        ⁢
        mod
        ⁢
        
          
        
        ⁢
        
          
            B
            I
          
          .
        
      
    
  




Then one permutes the vectors.

Remark 10.4. Without Tweak 2, we could have instead used a γsetsize(n)-sized set of matrices with a hidden γsubsetsize(n)-sized subset whose sum is related to (BJsk)−1. This would have resulted in a larger public key.

10.3 Bootstrapping Achieved: The Decryption Circuit for the Transformed System

We analyzed Steps 2 and 3 in Section 9. It is obvious that Step 0 requires only constant depth. We claim that Step 1 requires only constant depth, but why? Computing





  
    ∑
    
      j
      =
      1
    
    
      
        γ
        setsize
      
      ⁡
      
        (
        n
        )
      
    
  
  ⁢
  
    w
    ij
  




is very cheap because, in the set {wij: j∈[1, γsetsize(n)}, there is only one nonzero vector. Therefore, when we add the vectors, no expensive carry operations are required; we simply “XOR” the vectors together using polynomial-fan-in AddBI operations, using constant depth. At last, we have the following theorem.

Theorem 10.5. The scheme ε is bootstrappable when




  
    
      
        
          γ
          subsetsize
        
        ⁡
        
          (
          n
          )
        
      
      ·
      
        log
        
          c
          1
        
      
    
    ⁢
    
      
        γ
        subsetsize
      
      ⁡
      
        (
        n
        )
      
    
  
  ≤
  
    (
    
      
        log
        ⁡
        
          (
          
            
              r
              Dec
            
            /
            m
          
          )
        
      
      
        
          2
          
            c
            2
          
        
        ·
        
          log
          ⁡
          
            (
            
              
                
                  γ
                  Mult
                
                ⁡
                
                  (
                  R
                  )
                
              
              ·
              
                r
                Enc
              
            
            )
          
        
      
    
    )
  




where logc1 γsetsize (n) is the polylog term arising in Lemma 9.1, m arises from the re-definition of ε in the Tweaks (m=2 when just Tweak 2 is used), and c2 is a constant representing the depth needed in a circuit having AddBI gates with γMult(R)=nΩ(1) fan-in and MultBI gates with constant fan-in to sequentially perform Decryptε Steps 0, 1, and 3, and a NAND gate.

Proof. As in the proof of Theorem 7.2, for a c-level circuit, if the inputs to the generalized circuit are in (r), the outputs are in ((γMult(R)·r)2c). Combining with Lemma 9.1, we have that if the inputs to our generalized NAND-augmented decryption circuit are in (rEnc), the output is in

(γMult(R)·rEnc)2c2·(γsubsetsize(n)·poly log(γsubsetsize(n))) 

The result follows when this value is at most rDec/m.

For example, suppose γMult(R)·rEnc is polynomial in n, and rDec=2nC for C<1. In this case, γsubsetsize(n) can be polynomial in n (but sub-linear). The constants c1 and c2 are not very large, though in practice one would want to optimize them beyond what we have done.
11 Security
From Theorem 10.2, we know that the bootstrappable encryption scheme described in Section 10.2 is semantically secure as long as the SplitKey distinguishing problem (instantiated as described as in Section 10.2) is hard and the somewhat homomorphic encryption scheme of Section 7 (possibly with the tweaks of Section 8) is semantically secure. In other words, the bootstrappable encryption scheme's security is based on two assumptions.
We already addressed the security of the somewhat homomorphic encrypion scheme in Section 7.7, basing it on the decision BDDP. In the remainder of this Section, we will consider the hardness of our concrete version of the SplitKey distinguishing problem. Concretely, the SplitKey distinguishing problem will become the (decision) sparse subset sum problem (SSSP). (See Definition 11.4.) We then show how to reduce search SSSP to decision SSSP using Goldreich-Levin. (See O. Goldreich and L. Levin, “Hard-Core Predicates for Any One-Way Function”, in Proc. of STOC '89, ACM, 1989.)
11.1 Regarding the Hint Given in Our “Squashing” Transformation
For the concrete instantiation of SplitKey given in Section 10.2, the SplitKey distinguishing problem becomes the following.
Definition 11.1 (SplitKey Distinguishing Problem, Concrete Version). Let γsetsize(n) and γsubsetsize(n) be functions as above, and BI a basis of an ideal I. The challenger sets




  
    (
    
      
        sk
        *
      
      ,
      
        pk
        *
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    KeyGen
    
      ɛ
      *
    
  




and





  
    b
    ⁢
    
      ←
      R
    
    ⁢
    
      {
      
        0
        ,
        1
      
      }
    
  
  ,




where sk* includes the secret vector vJsk*∈J−1. If b=1, it sets vJsk*←0. It sets τ to be a set of γsetsize(n) vectors t1, . . . , tγsetsize(n) that are uniformly random in J−1 mod BI subject to the constraint that there exists a subset S ⊂ {1, . . . , γsetsize(n)} of cardinality γsubsetsize(n) such that τi∈Sti∈vJsk*+I. The problem is to guess b given (τ, sk*, pk*).

Here we discuss the hardness of our concrete version of the SplitKey Distinguishing Problem given in Definition 11.1. The problem is somewhat unnatural, in the sense that it depends on our key generation algorithm. Below, we base the hardness of our SplitKey Distinguishing Problem on a sparse subset sum problem modulo an integer that is essentially independent of our encryption scheme. We do this in two steps. First, we relate the SplitKey Distinguishing Problem to a sparse subset vector sum problem modulo the lattice IJ, where the problem is independent of the secret key output by our key generation algorithm (but not the public key). Next, as long as I and J satisfy certain criteria, we remove the dependence on I and J.
Here is the intermediate problem that we use.
Definition 11.2 (Sparse Vector Subset Sum Problem (SVSSP)). Let γsetsize(n) and γsubsetsize(n) be functions as above, and BI a basis of an ideal I. The challenger sets




  
    (
    
      
        sk
        *
      
      ,
      
        pk
        *
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    KeyGen
    
      ɛ
      *
    
  




and





  
    b
    ⁢
    
      ←
      R
    
    ⁢
    
      {
      
        0
        ,
        1
      
      }
    
  
  ,




where the key pair includes bases of an ideal J. It sets BIJ to be the Hermite normal form of IJ. If b=0 it generates τ as a set of γsetsize(n) vectors u1, . . . , uγsetsize(n) that are uniformly random in n∩(BIJ), subject to the constraint that there exists a subset S⊂{1, . . . , γsetsize(n)} of cardinality γsubsetsize(n) such that Σi∈Sui∈ IJ. If b=1, it sets the vectors without the constraint. The problem is to guess b given (τ, sk*, pk*).

Theorem 11.3. Let  be an algorithm that decides the concrete version of the SplitKey Distinguishing Problem with advantage ∈. Then, there is an algorithm , running in about the same time as , that solves the SVSSP with advantage (∈subsetsize(n)/2γsetsize(n))·∈.

Proof. The challenger generates a bit





  b
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and gives  an appropriate instance (τ, sk*, pk*) of SVSSP, where pk* includes a basis for ideal J, and sk* contains vJsk*∈J−1. To generate a tag τ′ for the SplitKey Distinguishing Problem,  does the following. Let BJ−1 be a basis of J−1 and let U be the n×γsetsize(n) matrix formed by the vectors {ui}.  sets T′←BJ−1·U, reducing the columns modulo BI. It sets a bit





  
    b
    ⁢
    
      ←
      R
    
    ⁢
    
      {
      
        0
        ,
        1
      
      }
    
  
  ;




if β=0 it sets v←VJsk*, otherwise it sets v←0. It adds v to a random column (say the lith column) of T′, reducing the column modulo BI, to obtain matrix T. It outputs τ′ as the column vectors of T.  responds with a bit ρ′.  outputs b′←β⊕β′.

We have that

Pr[b′=b]=(1⁄2)·Pr[b′=0|b=0]+(1⁄2)·Pr[b′=1|b=1]=(1⁄2)·Pr[b′=0|b=0]+1⁄4

The last equality follows from the fact that, when b=1, the column vectors of T′ are random and independent in J−1∩(BI) and thus T is independent of β, β′ is independent of β, and b′ is uniformly random. We know that the column vectors of T′ are random and independent, since multiplication by BJ−1 induces a bijection between n∩(BIJ) and J−1∩(BI) that preserves rank: for c∈γsetsize(n), we have

T′·c=0Bj−1·U·c=0U·c=0

In short, the uniformity of U when b=1 implies the uniformity of

Now, assume b=0. For i∈{0, 1}, let ∈i be the probability that  outputs 1 when b†=i in the SplitKey Distinguishing Problem. (We used ‘b†’ to avoid a notation conflict.) We have

Pr[b′=0]=(1⁄2)·(Pr[β′0|β==0]+Pr[β′=1|β=1

If β=1, then indeed T has the same distribution as in the b†=1 case in the SplitKey Distinguishing Problem (i.e., a sparse subset sums to 0 modulo I), so Pr=[β′=1|β=1]=∈1. However, if β=0, then T has the same distribution as in the b†=0 case in the SplitKey Distinguishing Problem (i.e., a sparse subset sums to vJsk*) when k∈S, but when k∉S, the distribution is the same as in the b†=1 case (since vJsk* is added to a vector that is not a part of the sparse subset and thus is lost in the randomness of the other vectors, while the sparse subset sum is unaffected and is thus still 0). Therefore, assuming β=0, we have





  
    
      
        
          Pr
          ⁡
          
            [
            
              
                β
                ′
              
              =
              0
            
            ]
          
        
        =
        
        ⁢
        
          
            
              Pr
              ⁡
              
                [
                
                  
                    β
                    ′
                  
                  =
                  
                    0
                    |
                    
                      k
                      ∈
                      S
                    
                  
                
                ]
              
            
            ·
            
              Pr
              (
              
                k
                ∈
                S
              
              ]
            
          
          +
        
      
    
  
  
    
      
        
        ⁢
        
          
            
              Pr
              ⁡
              
                [
                
                  
                    β
                    ′
                  
                  =
                  
                    0
                    |
                    
                      k
                      ∉
                      S
                    
                  
                
                ]
              
            
            ·
            Pr
          
          ⁢
          
            {
            
              k
              ∉
              S
            
            ]
          
        
      
    
  
  
    
      
        =
        
        ⁢
        
          
            
              (
              
                1
                -
                
                  ε
                  0
                
              
              )
            
            ⁢
            
              (
              
                
                  
                    γ
                    subsetsize
                  
                  ⁡
                  
                    (
                    n
                    )
                  
                
                /
                
                  
                    γ
                    setsize
                  
                  ⁡
                  
                    (
                    n
                    )
                  
                
              
              )
            
          
          +
        
      
    
  
  
    
      
        
        ⁢
        
          
            (
            
              1
              -
              
                ε
                1
              
            
            )
          
          ·
          
            (
            
              1
              -
              
                
                  
                    γ
                    subsetsize
                  
                  ⁡
                  
                    (
                    n
                    )
                  
                
                /
                
                  
                    γ
                    setsize
                  
                  ⁡
                  
                    (
                    n
                    )
                  
                
              
            
            )
          
        
      
    
  




Overall, we have

Pr[b′=0|b=0]=1⁄2+(∈1−∈0)(γsubsetsize(n)/2γsetsize(n))

and thus Pr[b′=b]=1⁄2+(∈1−∈0)(γsubsetsize(n)/4γsetsize(n)). In other words, 's advantage is less than 's advantage by at most a multiplicative advantage of 2γsetsize(n)/γsubsetsize(n).

Now, we provide a problem that is independent of the particular ideal J output by KeyGen.
Definition 11.4 (Sparse Subset Sum Problem (SSSP)). Let γsetsize(n) and γsubsetsize(n) be functions as above, and let q be a prime positive integer. The challenger sets




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    
      {
      
        0
        ,
        1
      
      }
    
    .
  




If b=0 it generates τ as a set of γsetsize(n) integers {a1, . . . , aγsetsize(n)} in [−q/2, q/2] that are uniformly random, subject to the constraint that there exists a subset S⊂{1, . . . , γsetsize(n)} of cardinality γsubsetsize(n) such that Σi∈Sai=0 mod q. If b=1, it sets the elements without the constraint. The problem is to guess b given τ.

The SSSP is a type of knapsack problem; it asks whether there is a sparse knapsack that sums to 0 modulo q. However, the SSSP should not be confused with the low-density knapsack problem. In the latter, γsetsize(n)/log q is small (less than 1). Consequently (though we omit details), one can construct a lattice corresponding to the set of possible knapsack solutions in which the target solution vector corresponding to the subset sum is exponentially shorter than the rest of the solution vectors; this solution vector can then be recovered by a polynomial-time lattice reduction algorithm. In our case, γsetsize(n)/log q will be greater than 1. The consequence of this is that there will be (exponentially) many subsets whose sum is zero modulo q, and known polynomial-time lattice reduction algorithms will fail to extract the sparse solution from the many non-sparse ones.
Theorem 11.5. Assume BI and IdealGen are such that det(I) and det(J) are distinct primes and q/det(IJ) is super-polynomial. Suppose  decides SVSSP with advantage ∈ in this setting. Then, there is an algorithm  that decides the SSSP with advantage ∈/2γsubsetsize(n), up to negligible factors.
The intuition of the proof is that, if there is a sparse subset S such that τi∈Sai=0 mod q, then this set sums to zero over the integers with non-negligible probability, since the only possible sums are k·q for k∈(−γsubsetsize(n)/2, γsubsetsize(n)/2). If this holds, then q is irrelevant; Σi∈Sai=0 mod p holds for any p. In particular, Σi∈Sai=0 mod det(IJ).
Accordingly, 's initial strategy is to set ai←ai·ei mod BIJ for all i, and ask  whether these a, are statistically uniform or there is a sparse subset of them that sum to 0 modulo IJ. There surely is such a sparse subset (namely, S) when Σi∈Sai=0. If the ai's are completely random and independent, then the ai's will be statistically random modulo Bij, since q/det(IJ) is super-polynomial random and thus the ai's are statistically random modulo det(IJ), and because (for technical reasons) multiples of ei run over all of the cosets n/IJ.
The difficult case is when Σi∈Sai is a nonzero multiple of q. For this case, we would like to map the ai's to ai's so that the ai's are statistically uniform, but the initial strategy above does not quite work, since the resulting ai's would have a sparse subset that adds up to k·q·e1 mod BIJ where k∈(−γsubsetsize(n)/2, γsubsetsize(n)/2)\{0}, whereas the ai's would be unlikely to have such a sparse subset if they were uniform. So, we revise 's initial strategy slightly: it chooses a random integer m that is invertible modulo det(IJ) and sets ai←m·ai·e1. This new strategy still works for the cases when the ai's are random or have a sparse subset that sums to 0 over the integers; for the case that Σi∈Sai is a nonzero multiple of q, the new strategy randomizes the sum of the sparse subset so that it equals x·e1 for some random x that is invertible modulo det(IJ). If det(I) and det(J) are both super-polynomial, then an overwhelming fraction of numbers are invertible modulo det(IJ), and the distribution of the ai's is thus statistically uniform. If det(I) is not super-polynomial (det(J) of course must be), then we can use the Leftover Hash Lemma to prove that the distribution is still statistically uniform.
Overall, if  has a non-negligible advantage in the SVSSP, then  can use  to distinguish when an SSSP instance has a sparse subset that sums to 0 over the integers, which is enough to give  a non-negligible advantage in the SSSP.
Proof. The challenger generates a bit




  b
  ⁢
  
    ←
    R
  
  ⁢
  
    {
    
      0
      ,
      1
    
    }
  




and gives  an appropriate instance τ of SSSP. To generate a tag τ′ for the SVSSP,  does the following.  sets





  
    (
    
      
        sk
        *
      
      ,
      
        pk
        *
      
    
    )
  
  ⁢
  
    ←
    R
  
  ⁢
  
    KeyGen
    
      ɛ
      *
    
  




and sets Bij to be the Hermite normal form of IJ. It sets m to be random integer that is invertible modulo det(IJ) and sets τ′ to be ui←m·ai·ei mod BIJ.

There are three cases to consider. If b=1, the ai's are random and independent in [−q/2, q/2]. Since q/det(IJ) is super-polynomial, the ai's are also (statistically) random and independent modulo det(IJ). Since ei generates all of the cosets n/IJ (we will show this momentarily), and m is invertible modulo det(IJ), the ai's are random and independent among the cosets n/IJ.
As to why ei generates all of the det(IJ) cosets of n/IJ, let d be the smallest positive integer such that d·e1∈IJ. If d=det(IJ), then clearly e1 must traverse all of the det(IJ) cosets. Otherwise, d is a proper divisor of det(IJ), either det(I) or det(J). But det(I)·e1 cannot be in J, since det(J)·e1∈J, which would imply e1∈J, since det(I) and det(J) are relatively prime. This is impossible, since e1 generates the entire ring R.
Suppose that b=0 and that Σi∈Sai=0 (over the integers). Let S be the set of indices corresponding to the subset whose sum is 0. In this case, Σi∈Sai=0 mod det(IJ), and so Σi∈s ai=0 mod BIJ. If we consider any subset of γsetsize(n)−1 indices that excludes an index in S, the vectors associated to those indices are random and independent modulo BIJ for the same reasons as in the first case. Thus, in this case, τ′ leads to a (statistically) properly distributed instance of the SVSSP for the b†=0 case.
Suppose that b=0 and that τi∈Sai is a nonzero multiple of q. Consider the distribution of Σi∈S, m·ai mod det(IJ); we claim that it is statistically uniform. If this sum is statistically uniform, then the distribution of {ai} is uniform modulo IJ, since we already know that the distribution is uniform apart from the possibility that there is a sparse subset S with an improbable sum.
First, consider Σi∈s mJ·ai mod det(J), where mJ is the residues of m modulo det(J). We claim that it is statistical uniform and independent of Σi∈SmI·ai mod det(I), where ml is the residues of m modulo det(I). Toward this claim, first we note that Σi∈Sai is nonzero modulo det(J), since it equals k·q for some small k, since det(J) and q are distinct primes, and since k is too small to be divisible by det(J). We also note that, via CRT, mJ is sampled from (/det(J))* randomly and independently of mI, and, since J is necessarily super-polynomial (for basic security reasons), sampling uniformly from (/det(J))* is statistically indistinguishable from sampling uniformly from (/det(J)). The claim follows.
Now, it suffices to show that Σi∈SmI·ai mod det(I) is statistically uniform. If det(I) is also super-polynomial, then uniformity follows for the same reason it was true wrt det(J). Otherwise, we apply the Leftover Hash Lemma. Specifically, let H be a family of hash functions, each hash function h in the family associated a distinct (h1, . . . , hγsetsize(n)−1)∈(/det(I))γsetsize(n)−1. The function maps from the set X of (γsubsetsize(n)−1)-sized subsets of {1, . . . , γsetsize(n)−1} to the set Y=/det(I) via h(x)=−Σi∈x hi mod det(I). This family is clearly 2-universal. By the Leftover Hash Lemma (Lemma 6.5), if h and x are selected uniformly and independently, then (h, h(X)) is




  
    1
    2
  
  ⁢
  
    
      
        
        γ
        
      
      /
      
        
        χ
        
      
    
  
  ⁢
  
    -
  
  ⁢
  
    uniform
    .
  




The statistical difference from uniform is negligible when





  
    
      det
      ⁡
      
        (
        I
        )
      
    
    =
    
      
        (
        
          
            
              
                
                  
                    γ
                    setsize
                  
                  ⁡
                  
                    (
                    n
                    )
                  
                
                -
                1
              
            
          
          
            
              
                
                  
                    γ
                    subsetsize
                  
                  ⁡
                  
                    (
                    n
                    )
                  
                
                -
                1
              
            
          
        
        )
      
      /
      
        n
        
          ω
          ⁡
          
            (
            1
            )
          
        
      
    
  
  ,




which will certainly be true when det(I) is not super-polynomial. The distribution of Σi∈SmI·ai mod det(I) is even closer to uniform than the distribution induced by the above family of hash functions, since this distribution is equivalent to picking a random hash function from the family above, computing (h, h(x)), replacing h(x) with h(x)+z for a uniformly random z∈(/det(I))*, and then permuting the resulting γsetsize(n) elements of (/det(I))*.

Overall, given that Σi∈Sai=0 mod q, the most likely multiple of q, out of less than γsubsetsize(n) possibilities, is 0 (since the expected mean is 0 when q is odd). Thus, the middle case occurs with probability at least 1/γsubsetsize(n) and 's advantage is therefore at least ∈/2γsubsetsize(n), up to negligible factors.
Finally, we reduce search SSSP to decision SSSP.
Definition 11.6 (Search SSSP). Let γsetsize(n) and γsubsetsize(n) be functions as above, and let q be a prime positive integer. The challenger generates τ as a set of γsetsize(n) integers {α1, . . . , aγsetsize(n)} in [−q/2, q/2] that are uniformly random, subject to the constraint that there exists a subset S⊂{1, . . . , γsetsize(n)} of cardinality γsubsetsize(n) such that Σi∈Sai=0 mod q. The problem is to output the set S given τ.

Theorem 11.7. Suppose  decides SSSP with non-negligible advantage in polynomial time. Then, there is an algorithm  that solves search SSSP with probability 1⁄2 in polynomial time.

Here is the intuition of the proof. Suppose that we have a flawless oracle  that decides whether τ′ is uniformly random or has a sparse subset that sums to 0. Suppose that we are also given a set τ=(a1, . . . , aγsetsize(n)) that sums to 0 over a sparse subset S. To decide whether an index i∈[1, γsetsize(n)] is in S, we set




  
    r
    ⁢
    
      ←
      R
    
    ⁢
    
      Z
      /
      
        (
        q
        )
      
    
  
  ,




set a′i←ai+r mod q, and give τ′=(a1, . . . , ai−1, a′i+1, . . . , aγsetsize(n)) to . If i∉S, then τ′ still sums to 0 over S.  will tell us that there is a sparse subset, and we conclude that i∉S. But if i∈S, then τ′ is distributed like a random member of [−q/2, q/2]γsetsize(n) and we conclude from 's response that i∈S.

Instead of a flawless oracle, we are given algorithm , which by assumption solves decision SSSP with non-negligible advantage. However, the Goldreich-Levin Theorem shows us how to use a decision oracle to invert certain functions, even when that oracle is faulty.
Theorem 11.8. (Goldreich-Levin Theorem) Suppose we have oracle access to a random process bx: {0, 1}n→{0, 1} such that, for some unknown x∈{0, 1}n, we have




  
    
      Pr
      
        r
        ∈
        
          
            {
            
              0
              ,
              1
            
            }
          
          n
        
      
    
    ⁡
    
      [
      
        
          
            b
            x
          
          ⁡
          
            (
            r
            )
          
        
        =
        
          b
          ⁡
          
            (
            
              x
              ,
              r
            
            )
          
        
      
      ]
    
  
  ≥
  
    
      1
      2
    
    +
    ε
  




where the probability is taken uniformly over the internal coin tosses of bx and all possible choices of r∈{0, 1}n, and b(x, r) denotes the inner product mod 2 of the binary vectors x and r. Then, we can in time polynomial in n/∈ output a list of strings that with probability at least 1⁄2 contains x.

Proof. (Theorem 11.7)  receives a search SSSP instance τ=(a1, . . . , aγsetsize(n)) from the challenger. Let x∈{0, 1}γsetsize(n) be the (unknown) incidence vector associated to the sparse subset S⊂{1, . . . , γsetsize(n)} over which τ sums to 0 modulo q. We will use Goldreich-Levin to recover x.

For r∈{0, 1}n, define the random process bx(r) as follows. Sample




  c
  ⁢
  
    ←
    R
  
  ⁢
  
    [
    
      
        
          -
          q
        
        /
        2
      
      ,
      
        q
        /
        2
      
    
    ]
  




and





  
    s
    ⁢
    
      ←
      R
    
    ⁢
    
      
        {
        
          
            -
            1
          
          ,
          1
        
        }
      
      
        
          γ
          setsize
        
        ⁡
        
          (
          n
          )
        
      
    
  
  ,




set

τ′←(a1+c·s1·r1 mod q, . . . ,aγsetsize(n)+c·sγsetsize(n)·rγsetsize(n)mod q)

give τ′ to  as its SSSP instance, and output 's response bit b′. We claim that b′/=x, rmod 2 with probability non-negligibly bounded away from 1⁄2, from which the result follows by Goldreich-Levin.

For i∈{0, 1}, let ∈0 be the probability that  outputs 1 when a decision SSSP instance has a sparse subset that sums to 0, and let ∈1 be the probability that  outputs 1 otherwise. By assumption, ∈1−∈0 is non-negligible. Let E1 and E2 be the events that x, r=0 mod 2 and Σi∈Ssi·ri=0, respectively. Note that E2 implies E1. We have




  
    Pr
    ⁡
    
      [
      
        
          b
          ′
        
        =
        
          〈
          
            x
            ,
            r
          
          〉
        
      
      ]
    
  
  =
  
    
      
        
          Pr
          ⁡
          
            [
            
              
                b
                ′
              
              =
              
                0
                |
                
                  E
                  2
                
              
            
            ]
          
        
        ·
        
          Pr
          ⁡
          
            [
            
              E
              2
            
            ]
          
        
      
      +
      
        
          Pr
          ⁡
          
            [
            
              
                b
                ′
              
              =
              
                0
                |
                
                  
                    E
                    1
                  
                  ⋀
                  
                    ⫬
                    
                      E
                      2
                    
                  
                
              
            
            ]
          
        
        ·
        
          Pr
          ⁡
          
            [
            
              
                E
                1
              
              ⋀
              
                ⫬
                
                  E
                  2
                
              
            
            ]
          
        
      
      +
      
        
          Pr
          ⁡
          
            [
            
              
                b
                ′
              
              =
              
                1
                |
                
                  ⫬
                  
                    E
                    1
                  
                
              
            
            ]
          
        
        ·
        
          Pr
          ⁡
          
            [
            
              ⫬
              
                E
                1
              
            
            ]
          
        
      
    
    =
    
      
        
          
            (
            
              1
              -
              
                ε
                0
              
            
            )
          
          ·
          
            Pr
            ⁡
            
              [
              
                E
                2
              
              ]
            
          
        
        +
        
          
            (
            
              1
              -
              
                ε
                1
              
            
            )
          
          ·
          
            (
            
              
                (
                
                  1
                  /
                  2
                
                )
              
              -
              
                Pr
                ⁡
                
                  [
                  
                    E
                    2
                  
                  ]
                
              
            
            )
          
        
        +
        
          
            ε
            1
          
          ·
          
            (
            
              1
              /
              2
            
            )
          
        
      
      =
      
        
          1
          /
          2
        
        +
        
          
            (
            
              
                ε
                1
              
              -
              
                ε
                0
              
            
            )
          
          ·
          
            Pr
            ⁡
            
              [
              
                E
                2
              
              ]
            
          
        
      
    
  




The first equality follows from the fact that, if E2 occurs, then τ′ sums to 0 over S (and is otherwise randomly distributed). However, if E2 does not occur, then τ′ is just a uniformly random member of [−q/2, q/2]γsetsize(n), since the sum over S is uniformly random.

We have that Pr[E2] is non-negligible—in particular, it is at least 1/(2γsubsetsize(n)+1)—since there are only 2γsubsetsize(n)+1 possibilities for Σi∈Ssi·ri and 0 is the most likely.
As mentioned in Section 10, our approach to reducing the complexity of the decryption circuit is abstractly similar to approaches used in server-aided cryptography to outsource some of the decryption work to an untrusted server. In fact, the similarity is more than just abstract; there are concrete server-aided schemes whose security relies on the SSSP. In particular, in the Matsumoto, Kato and Imai server-aided RSA scheme—called, RSA-S1—the private exponent d is decomposed into γsetsize(n) integers {ai} such that there is a set {xi∈[0,2l−1]}, only γsubsetsize(n) of which are nonzero, such that Σixiai=d mod φ(N), where N is the RSA modulus. (In our version of SSSP, we restrict the xi's to {0, 1}, but this is just for simplicity; like RSA-S1, we could permit the xi's to have a slightly larger range.) The SSSP is also similar the “full rank avoidance” problem initially proposed by Mulmuley and Sohoni as part of their program to separate P from NP. The full rank avoidance problem asks: given a matrix X with n rows and kn columns grouped as n blocks of k, is it possible to choose one column from each block so that the resulting n×n matrix M has det(M)=0? In our setting, we need k to be at least γsetsize(n)/n. Gurvitz showed the problem to be NP-hard for k=2.
If the SSSP is hard, what are we to make of all of the published attacks against RSA-S1 and its variants? (See B. Pfitzmann and M. Waidner, “Attacks on protocols for server-aided RSA computation”, in Proc. of Eurocrypt '92, LNCS 658, pages 153-162, Springer, 1993, and P. Q. Nguyen and J. Stern, “The BeguinQuisquater server-aided RSA protocol from Crypto '95 is not secure”, in Proc. of Asiacrypt '98, pages 372-379, Springer, 1998, and J. Merkle, “Multi-round passive attacks on server-aided RSA protocols”, in Proc. of ACM CCS '00, pages 102-107, ACM, 2000, and P. Q. Nguyen and I. Shparlinski, “On the Insecurity of Some Server-Aided RSA Protocol”, Asiacrypt '01, LNCS 2248, pp. 21-35.) These attacks are feasible only for limited choices of RSA-S1 parameters; they are not polynomial-time in general. Some of these are essentially time-space tradeoffs, meet-in-the-middle type attacks, whose complexity is exponential in γsubsetsize(n); these attacks are not polynomial-time when γsubsetsize(n)=w(1).
Nguyen and Shparlinski present a lattice-based cryptanalysis of RSA-S1 that succeeds with advantage at least

1−(γsubsetsize(n)γsetsize(n)+2·α)/q 

where α is a term that is greater than 1, and where q=φ(N) and N is the RSA modulus. We can easily avoid the attack by choosing γsetsize(n) to be larger than log q. Note that Theorem 11.5 only requires log q to be larger than log(det(IJ)) by an additive factor that super-logarithmic in n. So, for example, we could take γsetsize(n) to be about 2·log(det(IJ)). The intuition is that, once γsetsize(n) is sufficiently large, there will be exponentially many subsets in τ (not necessarily sparse) whose vector sum is congruent to vJsk*; lattice reduction techniques have trouble extracting the sparse subset from among the many subset solutions.

11.2 Counterbalancing Assumptions

As discussed above, the best known attack on the SSSP is exponential in γsubsetsize(n), as long as γsetsize(n) is chosen to be large enough to avoid a lattice attack by Nguyen and Shparlinski. I.e., the best attack takes time (roughly) 2γsubsetsize(n).

On the other hand, by Theorem 10.5, our scheme becomes bootstrappable when




  
    
      
        
          γ
          subsetsize
        
        ⁡
        
          (
          n
          )
        
      
      ·
      
        log
        
          c
          1
        
      
    
    ⁢
    
      
        γ
        subsetsize
      
      ⁡
      
        (
        n
        )
      
    
  
  ≤
  
    (
    
      
        log
        ⁡
        
          (
          
            
              r
              Dec
            
            /
            m
          
          )
        
      
      
        
          2
          
            c
            2
          
        
        ·
        
          log
          ⁡
          
            (
            
              
                
                  γ
                  Mult
                
                ⁡
                
                  (
                  R
                  )
                
              
              ·
              
                r
                Enc
              
            
            )
          
        
      
    
    )
  




To allow γsubsetsize(n) to be as large as possible for a fixed value of rDec/rEnc, we let γMult(R), rEnc and m be as small as possible (polynomial in n), and rDec is then approximately 2γsubsetsize(n). We saw in Section 7.7 that the approximation factor of the decision BDDP on which we base security is at least as large as rDec/rEnc—i.e., about 2γsubsetsize(n). We use the rule of thumb that solving 2γsubsetsize(n)-decision BDDP takes time approximately 2n/γsubsetsize(n) using known attacks.

We can set γsubsetsize(n)≈√{square root over (n)} to make known attacks on the two problems “equally” expensive (up to the crudeness of our approximations). Or, to put it another way, we can set γsubsetsize(n)≈λ, where λ is the security parameter of our scheme, and obtain exponential 2λ security against known attacks. Note that this requires our lattice dimension to be quite large: n≈λ2.
Note that in the somewhat homomorphic scheme without bootstrapping, we do not put any “hint” about the original secret key in the public key, and do not need the second computational assumption. In this case, if we (say) only want to evaluate constant depth, then (as far as we know) it suffices to take n quasi-linear in λ to achieve 2λ security against known attacks. On the other hand, if we want to evaluate θ(log n) depth, this forces us to use a sub-exponential approximation factor in decision BDDP, permitting sub-exponential attacks, and forcing us to take n to be a higher-degree polynomial in λ.
12 Performance and Optimizations
In this Section, we analyze the performance of our (leveled) fully homomorphic encryption scheme, and describe a few ways to improve the scheme's computational efficiency.
Even after some simple optimizations described in Subsection 12.1, we find in Subsection 12.2 that if we want to obtain 2λ security against known attacks (on each of the two problems on which the security of our scheme is based), the computation per gate in our unoptimized scheme is quasi-linear in λ9. The computational expense has several sources:

    
    
        Homomorphic Decryption: The fact that we perform decryption homomorphically, rather than just conventionally, essentially “squares” the computational complexity
        Squashing the Decryption Circuit: This procedure minimized the depth of our decryption circuit, but at the expense of substantially increasing the circuit's size, and increasing the size of the secret key and ciphertexts
        Counterbalancing assumptions: Make both of our problems hard requires a large lattice dimension

These problems all go away if we only use the somewhat homomorphic encryption scheme (without bootstrapping); this basic scheme is quite efficient.

    
    


In Subsection 12.3, we provide two optimizations, neither substantially decreasing security, that reduce the computation per gate to quasi-linear in λ6. While still high, this does not seem so unreasonable when one considers that, to get 2λ security against the number field sieve, one should use an RSA modulus whose bit-length is quasi-linear in λ3, in which case a full exponentiation takes time quasi-linear in λ6, even when one uses fast FFT multiplication. We also provide a third optimization, but where security only holds under the assumption that a different SplitKey Distinguishing Problem is hard. For this different version of the problem, we have no reduction from the SSSP.
12.1 Simple Optimizations
First, we note some very simple optimizations, before getting to the more technical ones described in Subsection 12.3.
As a preliminary matter, before we begin discussing the scheme's computation per gate, we note that there is some flexibility in how one defines a gate. (See Section 4, where we defined what it means for an encryption scheme to be bootstrappable with respect to a set of gates Γ.) In particular, a “gate” could be a “normal” boolean circuit of depth greater than 1. If we use “bigger” gates, then we perform expensive Recrypt operations less often, which may improve efficiency. However, for simplicity of exposition, we will assume in the discussion below that we use NAND gates.
For each NAND gate in C, we evaluate two decryption circuits Dε homomorphically, and then compute NAND homomorphically. In our transformation above from ε* (the somewhat homomorphic scheme) to ε (with the squashed decryption circuit), we said that a homomorphic Add consisted of extracting (ψ*1, ψ*2) (the ciphertexts from the somewhat homomorphic scheme) from (ψ1, ψ2) (the ciphertexts from the transformed scheme), adding ψ*1 and ψ*2 within the somewhat homomorphic scheme (using simple ring addition) to obtain ψ*, and then setting the output ψ to include ψ* and the output of ExpandCTε(pk, ψ*). However, it is actually overkill to use ExpandCT for the interior gates of the NAND-augmented decryption circuit that we are computing; really we only need apply ExpandCT at the end, and can use simple ring addition and multiplication for the interior gate homomorphisms.
Another optimization is that, when applying Recrypt to ψ (the encryption of τ under pk1), we do not really need to first encrypt the bits of ψ under pk2. Instead, we can view the bits themselves as ciphertexts under pk2, since there is no requirement that these “ciphertexts” be hiding. In other words, we do not actually need to evaluate the general decryption circuit, but rather merely a non-uniform decryption circuit that takes only the secret key as input and has the ciphertext hard-wired. So, overall, the complexity (per gate in C) is approximately twice the complexity of this simplified version of Recrypt, plus the complexity of ExpandCT.
12.2 Basic Performance
As discussed in Section 11.2, the SplitKey Distinguishing Problem becomes harder as γsubsetsize(n) increases, while the decision BDDP becomes easier, since increasing γsubsetsize(n) increases the approximation factor of the problem. To make both of the problems hard, such that the breaking time of both problems is 2λ, requires us to use a large lattice dimension: n≈γsubsetsize(n)2≈λ2.
Now, let us consider the size of an encrypted secret key in our scheme. The secret key (unencrypted) is a γsubsetsize(n)×γsetsize(n) matrix of bits. We need γsetsize(n) to be rather large—larger than log det(IJ)—for our reduction from the SSSP to work. Since J contains a ball of radius rDec, where the latter is exponential in γsubsetsize(n), we have that log det(IJ)>n log rDec>n·γsubsetsize(n)≈λ3. (And the upper bound log det(IJ)=O(λ3) works as well.) So, the secret key (unencrypted) key is approximately λ4 bits. Encryption multiplies the bit-length by another factor of λ3, since each ciphertext is a coset of J, where log det(IJ)=O(λ3) as described above. Overall, the encrypted secret key is approximately λ7 bits.
Circumstances become even worse when this encrypted secret key is applied to the ciphertext components output by ExpandCT. Consider a single ciphertext component ci. It has n coefficients, though each coefficient only needs to have a very small (poly-logarithmic) number of bits, the minimal number needed to ensure that the rounded sum is computed correctly. Each encrypted secret key bit is multiplied with one ciphertext component. Overall, this computation is quasi-linear in λ7×n≈λ9, and in fact the result of this intermediate computation also has length quasi-linear in λ9. The remaining computation is quasi-linear in λ9, assuming FFT multiplication is used.
12.3 More Optimizations
As our first optimization, we observe that a simplified version of the secret key still works, due to properties of symmetric polynomials.
Optimization 1: Encode the secret key sk as a vector in {0, 1}γsetsize(n), rather than a 0/1 incidence matrix of dimension γsubsetsize(n)×γsetsize(n).
Gain: Computational complexity is reduced by a factor of approximately γsubsetsize(n)≈λ.
In Optimization 1, τ and ExpandCTε are as before; the changes are in the format of sk and in the decryption algorithm, which is as follows.
Decryptε(sk, ψ). Takes as input the secret key sk and a ciphertext ψ. It performs the following steps:
Step 1: Set the vectors xi←ski·ci 
Step 2: From x1, . . . , xγsetsize(n), generate integer vectors y1, . . . , yγsetsize(n)+1 with sum └Σxi┐.
Step 3: Compute π←ψ−(Σyi) mod BI 
The key observation here is that all but γsubsetsize(n) of the xi's are 0, and that, if we have the promise that most of the numbers that we are summing up are 0, then we can compute the output above using a shallower circuit. Why? Recall that, in Lemma 9.1, we basically reduced computing the sum of t numbers to computing the Hamming weight of a vector b∈{0, 1}t. Then, we used the fact that the binary representation of this Hamming weight is precisely

(e2└log t┘(b1, . . . ,bt)mod 2, . . . ,e20(b1, . . . ,bt)mod 2)

where ei is the ith symmetric polynomial. In Optimization 1, we use symmetric polynomials in the same way, but now with the observation that if we have the promise that b has Hamming weight at most k, then there is no need to compute evaluate the polynomials e2i(b1, . . . , bt) for i>└log k┘, since they will all be 0 anyway. So, in optimization 1, despite the more concise encoding of sk, we get by with computing the same low-degree elementary symmetric polynomials that we did originally, albeit now with γsetsize(n) inputs rather than γsubsetsize(n) inputs.

In particular, we have the following lemma, which is analogous to Lemma 9.1.
Lemma 12.1. For i∈[1, t], let ai=( . . . , ai,1, ai,0, ai,−1, . . . ) be a real number given in binary representation mod BI with the promises that Σi ai mod 1∈[−1⁄4, 1⁄4] and at most k of the ai's are nonzero. There is a mod-BI circuit C for generating t+1 integers z1, . . . , zt+1 (also represented in binary) whose sum is └Σiai┐, such that if the generalized circuit g(C)'s inputs are in (rin), then its outputs are in (rout) for:

rout≦k·t·n·∥BI∥·(t·γMult(R)·rin)k·poly log(k) 

For ∥BI∥≦rin, t≦n, and γMult(R)=nΩ(1), we have:

rout≦(γMult(R)·rin)k·poly log(k) 

Proof. The proof is essentially identical to the proof of Lemma 9.1—i.e., we compute the elementary symmetric polynomials up to degree k and use the matrix M−1, now of rank k+1. The only real difference is in the value of rout, which is affected by the fact that the polynomials now take more input variables.

Let C be the mod-BI sub-circuit for computing any bit of the binary representation of the Hamming weight. Using n·∥BI∥ as an upper bound on the length of elements in R mod BI, we have




  
    
      
        
        
          
            g
            ⁡
            
              (
              C
              )
            
          
          ⁢
          
            (
            
              
                x
                1
              
              ,
              ...
              ⁢
              
                
              
              ,
              
                x
                t
              
            
            )
          
        
        
      
      ≤
      
        
          
            γ
            Mult
          
          ⁡
          
            (
            R
            )
          
        
        ·
        n
        ·
        
          
          
            B
            I
          
          
        
        ·
        
          (
          
            
              ∑
              
                i
                ∈
                
                  [
                  
                    0
                    ,
                    k
                  
                  ]
                
              
            
            ⁢
            
              
              
                
                  e
                  i
                
                ⁡
                
                  (
                  
                    
                      x
                      1
                    
                    ,
                    ...
                    ⁢
                    
                      
                    
                    ,
                    
                      x
                      t
                    
                  
                  )
                
              
              
            
          
          )
        
        ·
        t
      
      ≤
      
        
          
            γ
            Mult
          
          ⁡
          
            (
            R
            )
          
        
        ·
        n
        ·
        
          
          
            B
            I
          
          
        
        ·
        
          (
          
            
              ∑
              
                i
                ∈
                
                  [
                  
                    0
                    ,
                    k
                  
                  ]
                
              
            
            ⁢
            
              
                (
                
                  
                    
                      t
                    
                  
                  
                    
                      i
                    
                  
                
                )
              
              ⁢
              
                
                  
                    
                      γ
                      Mult
                    
                    ⁡
                    
                      (
                      R
                      )
                    
                  
                  
                    i
                    -
                    1
                  
                
                ·
                
                  r
                  in
                  i
                
              
            
          
          )
        
        ·
        t
      
    
    =
    
      
        t
        ·
        n
        ·
        
          
          
            B
            I
          
          
        
        ·
        
          (
          
            
              ∑
              
                i
                ∈
                
                  [
                  
                    0
                    ,
                    k
                  
                  ]
                
              
            
            ⁢
            
              
                (
                
                  
                    
                      t
                    
                  
                  
                    
                      i
                    
                  
                
                )
              
              ⁢
              
                
                  (
                  
                    
                      
                        γ
                        Mult
                      
                      ⁡
                      
                        (
                        R
                        )
                      
                    
                    ·
                    
                      r
                      in
                    
                  
                  )
                
                i
              
            
          
          )
        
      
      ≤
      
        t
        ·
        n
        ·
        
          
          
            B
            I
          
          
        
        ·
        
          (
          
            
              ∑
              
                i
                ∈
                
                  [
                  
                    0
                    ,
                    k
                  
                  ]
                
              
            
            ⁢
            
              
                (
                
                  t
                  ·
                  
                    
                      γ
                      Mult
                    
                    ⁡
                    
                      (
                      R
                      )
                    
                  
                  ·
                  
                    r
                    in
                  
                
                )
              
              i
            
          
          )
        
      
      ≤
      
        k
        ·
        t
        ·
        n
        ·
        
          
          
            B
            I
          
          
        
      
    
  
  ⁣
  
    ·
    
      
        (
        
          t
          ·
          
            
              γ
              Mult
            
            ⁡
            
              (
              R
              )
            
          
          ·
          
            r
            in
          
        
        )
      
      k
    
  




At this point, we have generated about log k numbers, each with O(log k) bits, with the same sum as Σbi. There is a O(log log k)-depth constant fan-in boolean circuit for computing this sum, which can be emulated by a O(log log k)-depth mod-BI circuit. Combining the above with results in the proof Theorem 7.2, the result follows.
Since rout is similar to before—i.e., exponential in γsubsetsize(n) (up to polylogarithmic factors)—one obtains a bootstrappable scheme with Optimization 1 with parameters similar to those required by Theorem 10.5.
Now, let us analyze the computation needed after Optimization 1. The more concise representation of the secret key has size quasi-linear in λ6—i.e., γsetsize(n)≈λ3 bits, each encrypted in a ciphertext of size approximately n·γsubsetsize(n)≈λ3. Multiplying the encrypted secret key balloons the result up to size quasilinear in λ8. The dominant remaining computation is computing the elementary symmetric polynomials up to degree γsubsetsize(n). We need to do one such computation for the least significant bits of the least significant coefficients of the ci's, etc.; the total number of such computations is the number of bits in ci, which is quasi-linear in n≈λ2.
The symmetric polynomials are the coefficients of zi, i∈[γsetsize(n)−γsubsetsize(n), γsetsize(n)], in the polynomial p(z)=Πi=1γsetsize(n)(z−bi). Let ƒ(t) be the computation needed to compute the product of t of the (z−bi)'s. Using the recursion that ƒ(t)=2·ƒ(t/2)+poly log(t/2), the total computation needed to compute the symmetric polynomials (non-homomorphically) is γsetsize(n)·poly log(γsetsize(n)). Since the operations are performed homomorphically—i.e., with ciphertexts of size quasi-linear in λ3 instead of with bits—the computation needed is quasilinear in λ6. Since the number of Hamming weight computations is quasi-linear in n≈λ2, the total computation in quasi-linear in λ8.
Remark 12.2. Though it does not affect the asympotics very much, we can optimize Optimization 1 as follows. When a polynomial associated to an interior node has degree d>γsubsetsize(n), we can discard its coefficients for zi for i<d−γsubsetsize(n), since they will not affect the end result; thus, at any node, we never maintain more than γsubsetsize(n)+1 coefficients.

Optimization 2: Preprocess the initial ciphertext ψ* even more, collapsing each n-coefficient ciphertext component ci into a single coefficient.

Gain: Computational complexity is reduced by a factor of approximately n≈λ2. Combining with Optimization 1, the computational complexity per gate is reduced to λ6.

Suppose the plaintext space is {0, 1} and that I=(2).7 A ciphertext ψ* from the somewhat homomorphic scheme has the form m+j, where m∈π·e1+2n is “short” and j∈J. Addition and multiplication of ciphertexts does not change the essential form of the ciphertext. In particular, the plaintext π always hides in the least significant coefficient of ψ*; for all of the other coefficients, the offset from the closest J-vector is even. This suggests that, our decryption equation 7Shai Halevi observed the optimization for this case.

π=ψ*−└vJsk*×ψ*┘ mod 2

we only really care about the least significant coefficient—i.e., π can be recovered from the least significant coefficient of ψ* and the least significant coefficient of





  
    
      v
      J
      
        sk
        *
      
    
    ×
    
      ψ
      *
    
  
  =
  
    
      ∑
      
        i
        ∈
        S
      
    
    ⁢
    
      
        t
        i
      
      ×
      
        ψ
        *
      
    
  




In Optimization 2, we modify ExpandCT to output only the least significant coefficients of the ciphertext components ci=ti×ψ*, and simplify decryption so that it only sums up these coefficients, reducing decryption computation by a factor of n≈λ2.

In certain cases, we can perform this optimization even when I≠(2). For example, the optimization works when det(I) is a small prime p, though the optimization is more complicated in this setting. First, compute a basis B′I of I, where the first column vector b0=(p, 0, . . . , 0), and bi=(ai, 0, . . . , 0, 1, 0, . . . , 0) for i∈[1, n−1], where the ‘1’ is in the ith row and ai∈(−p/2,p/2). (This can easily be done using elementary column operations.) Consider a vector m∈n. Let




  
    
      
        m
        ′
      
      ←
      
        m
        -
        
          
            ∑
            
              i
              =
              1
            
            
              n
              -
              1
            
          
          ⁢
          
            
              m
              i
            
            ·
            
              b
              i
            
          
        
      
    
    =
    
      m
      ⁢
      
        
      
      ⁢
      mod
      ⁢
      
        
      
      ⁢
      
        B
        I
      
    
  
  ,




Then all of the coefficients of m′ are 0, except possibly the least significant coefficient. The idea is that if we could apply this transformation to the value of m hiding inside the ciphertext (i.e., where ψ*=m+j for m∈π·e1+I and j∈J), then it seems that we could ignore all but the least significant coefficient, as when I=(2). But how do we apply this transformation to ciphertexts, when the value m is not accessible?

Before we get to how ExpandCT and Decrypt are modified, let us define a convenient notation. For B′I and p as above and x∈n, let




  
    x
    ⁢
    
      
    
    ⁢
    red
    ⁢
    
      
    
    ⁢
    
      B
      I
      ′
    
  
  =
  
    x
    -
    
      
        ∑
        
          i
          =
          1
        
        
          n
          -
          1
        
      
      ⁢
      
        
          x
          i
        
        ·
        
          b
          i
        
      
    
  




Notice that all of the coefficients of x red B′I are 0, except possibly the least significant one. Also, notice that x+y red B′I=(x red B′I)+(y red B′I). Finally, notice that x red B′I seems to have a close relationship with x mod B′I, which equals





  x
  -
  
    
      ∑
      
        i
        =
        1
      
      
        n
        -
        1
      
    
    ⁢
    
      
        
          ⌊
          
            x
            i
          
          ⌉
        
        ·
        
          b
          i
        
      
      ⁢
      mod
      ⁢
      
        
      
      ⁢
      p
    
  




The following lemma characterizes this relationship.

Lemma 12.3. Let B′I and p be as described above. Let δ and η be positive reals such that (np/2)·δ<η<1⁄2. Suppose the coefficients of x are within δ of integers. Then,

└x mod B′I┘=└x red B′I┘ mod p 

Also, the least significant coefficient of x red B′I has size at most p·Σi|xi| and is within η of an integer.

Proof. The upper bound on the magnitude of the least significant coefficient of x red B′I is obvious.

Since the vectors in B′I are integer vectors, the coefficients of (x mod B′I) are within δ of integers. Also, for some integer k, we have




  
    
      
        
          
            (
            
              x
              ⁢
              
                
              
              ⁢
              mod
              ⁢
              
                
              
              ⁢
              
                B
                I
                ′
              
            
            )
          
          -
          
            (
            
              x
              ⁢
              
                
              
              ⁢
              red
              ⁢
              
                
              
              ⁢
              
                B
                I
                ′
              
            
            )
          
        
        =
        
        ⁢
        
          
            (
            
              x
              -
              
                k
                ·
                p
                ·
                
                  e
                  1
                
              
              -
              
                
                  ∑
                  
                    i
                    =
                    1
                  
                  
                    n
                    -
                    1
                  
                
                ⁢
                
                  
                    ⌊
                    
                      x
                      i
                    
                    ⌉
                  
                  ·
                  
                    b
                    i
                  
                
              
            
            )
          
          -
          
            (
            
              x
              -
              
                
                  ∑
                  
                    i
                    =
                    1
                  
                  
                    n
                    -
                    1
                  
                
                ⁢
                
                  
                    x
                    i
                  
                  ·
                  
                    b
                    i
                  
                
              
            
            )
          
        
      
    
  
  
    
      
        =
        
        ⁢
        
          
            
              -
              k
            
            ·
            p
            ·
            
              e
              1
            
          
          +
          
            
              ∑
              
                i
                =
                1
              
              
                n
                -
                1
              
            
            ⁢
            
              
                (
                
                  
                    x
                    i
                  
                  -
                  
                    ⌊
                    
                      x
                      i
                    
                    ⌉
                  
                
                )
              
              ·
              
                b
                i
              
            
          
        
      
    
  




Aside from the −k·p·e1 term, all the coefficients of this difference have magnitude at most (n−1)·(p/2)·δ. Since δ+(n−1)·(p/2)·δ≦(np/2)·δ<η, the coefficients of (x red B′I) are close (within η) to the same integers that the coefficients of (x mod B′I) are close to (up to a multiple of p for the least significant coefficient).

With that technical lemma in hand, we modify ExpandCTε and Decryptε as follows.

ExpandCTε(pk, ψ*). Computes c′i←ti×ψ* mod BI for i∈[1, γsetsize(n)], and outputs ci←c′i red B′I. (All but the first coefficient of these vectors is 0, so these coefficients do not actually need to be output.)

Decryptε(sk, ψ). Takes as input the secret key sk and a ciphertext ψ. It performs the following steps, which are the same as after Optimization 1, but only the least significant coefficients need to be operated on:

Step 1: Set the vectors xi←ski·ci 

Step 2: From x1, . . . , xγsetsize(n), generate integer vectors y1, . . . , yγsetsize(n)+1 with sum └Σxi┐.

Step 3: Compute π←ψ(Σyi) mod B′I 

To show that decryption is correct, it suffices to show that




  
    ψ
    -
    
      ⌊
      
        
          ∑
          
            i
            ∈
            S
          
        
        ⁢
        
          c
          i
        
      
      ⌉
    
  
  =
  
    ψ
    -
    
      
        ⌊
        
          
            ∑
            
              i
              ∈
              S
            
          
          ⁢
          
            c
            t
            ′
          
        
        ⌉
      
      ⁢
      mod
      ⁢
      
        
      
      ⁢
      I
    
  




where the first expression is what is computed in the new decryption algorithm, and the second expression is what was computed prior to Optimization 2. But this follows from Lemma 12.3 as long as Σi∈Sc′i has coefficients that are sufficiently close to integers.

Modulo I, Σi∈Sc′i equals vJsk*·ψ*. To ensure that this quantity is sufficiently close to an integer vector, we tweak the set of permitted circuits once again, in much the same way as we did in Tweak 2 (see Section 8.4). (Recall that in Tweak 2, we changed the set of permitted circuits to require a ciphertext ψ* to be within rDec/2 of the J-lattice, so that the coefficients of vJsk*·ψ* would be within 1⁄4 of integers, thereby simplifying the rounding step.)
Optimization 3: Use the ring R=[x]/(ƒ(x)) for ƒ(x)=xn+1, where n is a power of 2. (Alternatively, one could use some other irreducible ƒ(x) that equals xn+h(x) for some constant-degree polynomial h(x) with ∥h∥=poly(n).) To set τ, generate 2·γsubsetsize(n) random vectors




  
    x
    j
  
  ⁢
  
    ←
    R
  
  ⁢
  
    J
    
      -
      1
    
  




subject to the constraint that that there exists a vector s∈{0, 1}2·γsubsetsize(n) of Hamming weight γsubsetsize(n), and a vector r∈{0, . . . , n−1}2·γsubsetsize(n) such that





  
    v
    J
    
      sk
      *
    
  
  =
  
    
      ∑
      
        i
        =
        1
      
      
        2
        ·
        
          
            γ
            subsetsize
          
          ⁡
          
            (
            n
            )
          
        
      
    
    ⁢
    
      
        (
        
          
            
              s
              i
            
            ·
            
              x
              i
              
                r
                i
              
            
          
          ⁢
          mod
          ⁢
          
            
          
          ⁢
          
            f
            ⁡
            
              (
              x
              )
            
          
        
        )
      
      ⁢
      mod
      ⁢
      
        
      
      ⁢
      I
    
  




Gain: Computational complexity is reduced by a factor of approximately n≈λ2. With the previous optimizations, the computation per gate is quasilinear in λ4.

To describe the optimization another way, τ does not consist of γsetsize(n) vectors that are random and independent (aside from the subset sum constraint). Instead, it consists of only 2·γsubsetsize(n) vectors that we “unpack” into 2·n·γsubsetsize(n) vectors by using all the “rotations” of the original 2·γsubsetsize(n) vectors; the vectors are random and independent aside from a subset sum constraint on the 2·n·γsubsetsize(n) vectors. The secret key sk consists of 2·γsubsetsize(n) ciphertexts encrypting the bits of s, as well as 2·γsubsetsize(n) ciphertexts that encrypt the rotations; the value ri∈[0, n−1] is encrypted in a ciphertext having the form xri+i+j for i∈I and j∈J. Notice that this secret key is much more concise, by a factor of approximately γsetsize(n)/γsubsetsize(n).
In ExpandCT, we output {xi×ψ*}, much fewer values than before. Combining the secret key with these ciphertext components (in the obvious way) also takes much less computation than before, by a multiplicative factor of approximately λ2.
The drawback of this optimization is that its security is questionable. In particular, the less random choice of τ prevents the reduction from the SSSP.
The optimizations above are directed toward minimizing the total computational complexity of our scheme. But we note that the parallel computational complexity of scheme is already inherently low, precisely because we require the circuit depth of our decryption to be very low. Even with bootstrapping, our scheme could be extremely efficient in a massively parallel implementation.
13 Circuit Privacy
Recall our definition of circuit privacy (Definition 2.6). We say that a homomorphic encryption scheme ε is circuit-private for circuits in ε if, for any key-pair (sk, pk) output by KeyGenε(λ), any circuit C∈ε, and any fixed ciphertexts Ψ=ψ1, . . . , ψt that are in the image of Encryptε for plaintexts π1, . . . , πt, the following distributions (over the random coins in Encryptε, Evaluateε) are (statistically) indistinguishable:

Encryptε(pk,C(π1, . . . ,πt))≈Evaluateε(pk,C,Ψ)

where correctness obviously still must hold.

So far, our scheme may not be circuit private. In fact, ciphertexts output by Evaluate clearly come from a different distribution than those output by Encrypt, since ciphertexts output by Evaluate will tend to be further away from the lattice J (since they are not as “fresh”).
However, obtaining circuit privacy for our scheme is quite straightforward. Our approach is to use a public (i.e., not using the secret key) algorithm RandomizeCTε that, applied post hoc, induces the same distribution (statistically) to ciphertexts output by Encryptε and Evaluateε, while preserving correctness.
The idea is simple: to construct a random encryption ψ′ of π from a particular encryption ψ of π, we simply add an encryption of 0 that has a much larger random “error” vector than ψ—super-polynomially larger, so that the new error vector statistically obliterates all information about ψ's error vector. However, this description is not entirely accurate, since a “proper” encryption of ‘0,’ whether output by Encryptε or Evaluateε, is a vector lying inside J+(rDec/m)—i.e., a vector whose distance from J is at most rDec/m, where m depends on which tweaks we use. On the other hand, our randomizing encryption of ‘0’ will be much further away from J. In particular, it will be chosen from J+(α·rDec/m) where α is super-polynomial, so that the “noise” from this randomizing encryption statistically obliterates any information about the initial ciphertext's offset from J. We need (α·rDec/m)⊂XDec to ensure correct decryption; so, this tweak once again entails increasing m.
14 Other Embodiments
Above, we described (among other things) a bootstrappable encryption scheme, and a method to use a bootstrappable encryption to construct a (leveled, unless circular security is assumed) fully homomorphic encryption scheme. Here, we mention (in a non-limiting fashion) other embodiments of the invention.
We described a bootstrappable encryption scheme that uses ideal lattices. However, the scope of bootstrappable encryption schemes is not limited to lattices; it may be possible to construct one that uses some other mathematical object. (Indeed, in subsequent work, Marten van Dijk, Craig Gentry, Shai Halevi, and Vinod Vaikuntanathan, “Fully Homomorphic Encryption over the Integers”, in Eurocrypt 2010, LNCS 6110, pages 24-43, Springer, 2010, describes a different embodiment of a bootstrappable encryption scheme that uses mere integers, rather than lattices.) The essence of a bootstrappable encryption scheme is defined in Section 4—i.e., that the scheme is able to evaluate its own decryption circuit, as well as an augmentation of its decryption circuit by some set of nontrivial gates, where these gates are preferably sufficient for universal computation (e.g., AND, and NOT). In connection with this invention, we have described the first bootstrappable encryption scheme. We have emphasized how a bootstrappable encryption scheme is useful as a tool to construct a fully homomorphic encryption scheme, but the utility of bootstrappable encryption may not be limited to this application. Indeed, we described how bootstrappable encryption can be used to construct a one-way multi-use proxy re-encryption scheme.
It is easily understood to one versed in the art that the algorithms of the encryption schemes described herein can be represented as programs of executable code, stored in computer memory, and executed by a computer processor. This computer could be a general purpose computer. Alternatively, it could be a computer that is equipped to handle highly parallel processing; indeed, since some of the algorithms in our scheme (such as the homomorphic decryption operation) require a lot of computation, but computation which can be performed in a highly parallel fashion, using such a computer architecture in connection with our scheme would be highly advantageous. Alternatively, the computer architecture and hardware could be designed and optimized specifically to run our encryption scheme as efficiently as possible.

## Claims

1. A method, comprising: receiving a plurality of ciphertexts that encrypt information under a public key of a bootstrappable homomorphic encryption scheme; and applying the Evaluate function of the bootstrappable homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.

2. The method of claim 1, where the bootstrappable homomorphic encryption scheme is a leveled fully homomorphic encryption scheme.

3. The method of claim 1, where the bootstrappable homomorphic encryption scheme is a fully homomorphic encryption scheme.

4. A method, comprising: receiving a plurality of ciphertexts that encrypt information under a public key of a homomorphic encryption scheme, where the homomorphic encryption scheme is operable to compactly evaluate the addition of two values and also operable to compactly evaluate a multiplication of two values, where the homomorphic encryption scheme uses public key information and secret key information, and includes an encryption function, a decryption function and an evaluation function, where the secret key information in the homomorphic encryption scheme comprises a secret representation of an algebraic ideal in a ring, where the encryption function takes input comprising first information and outputs second information comprising an element of the ring that is in a coset of the algebraic ideal, where the distribution of coset conditioned on the first information has high minentropy, where the decryption function operates to decrypt data encrypted under the certain public key by using at least the secret representation of the algebraic ideal in the secret key information; and applying the Evaluate function of the homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.

5. The method of claim 4, where the homomorphic encryption scheme has a proof of semantic security against CPA attacks.

6. The method of claim 4, where the homomorphic encryption scheme uses ideal lattices.

7. The method of claim 4, where the homomorphic encryption scheme uses two relatively prime algebraic ideals.

8. The method of claim 4, where the encryption scheme is operable to compactly evaluate any boolean circuit of depth logarithmic in the security parameter.

9. A program storage device readable by a machine and tangibly embodying a program of instructions executable by the machine for performing operations comprising: receiving a plurality of ciphertexts that encrypt information under a public key of a bootstrappable homomorphic encryption scheme; and applying the Evaluate function of the bootstrappable homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.

10. The program storage device of claim 9, where the bootstrappable homomorphic encryption scheme is a leveled fully homomorphic encryption scheme.

11. The program storage device of claim 9, where the bootstrappable homomorphic encryption scheme is a fully homomorphic encryption scheme.

12. A program storage device readable by a machine and tangibly embodying a program of instructions executable by the machine for performing operations comprising: receiving a plurality of ciphertexts that encrypt information under a public key of a homomorphic encryption scheme, where the homomorphic encryption scheme is operable to compactly evaluate the addition of two values and also operable to compactly evaluate a multiplication of two values, where the homomorphic encryption scheme uses public key information and secret key information, and includes an encryption function, a decryption function and an evaluation function, where the secret key information in the homomorphic encryption scheme comprises a secret representation of an algebraic ideal in a ring, where the encryption function takes input comprising first information and outputs second information comprising an element of the ring that is in a coset of the algebraic ideal, where the distribution of coset conditioned on the first information has high min-entropy, where the decryption function operates to decrypt data encrypted under the certain public key by using at least the secret representation of the algebraic ideal in the secret key information; and applying the Evaluate function of the homomorphic encryption scheme to inputs comprising the ciphertexts and a circuit.

13. The program storage device of claim 12, where the homomorphic encryption scheme has a proof of semantic security against CPA attacks.

14. The program storage device of claim 12, where the homomorphic encryption scheme uses ideal lattices.

15. The program storage device of claim 12, where the homomorphic encryption scheme uses two relatively prime algebraic ideals.

16. The program storage device of claim 12, where the encryption scheme is operable to compactly evaluate any boolean circuit of depth logarithmic in the security parameter.