A FULLY HOMOMORPHIC ENCRYPTION SCHEMEA DISSERTATIONSUBMITTED TO THE DEPARTMENT OF COMPUTER SCIENCEAND THE COMMITTEE ON GRADUATE STUDIESOF STANFORD UNIVERSITYIN PARTIAL FULFILLMENT OF THE REQUIREMENTS
FOR THE DEGREE OF
DOCTOR OF PHILOSOPHY

Craig Gentry
September 2009

c Copyright by Craig Gentry 2009°
All Rights ReservediiI certify that I have read this dissertation and that, in my opinion, it is fully
adequate in scope and quality as a dissertation for the degree of Doctor ofPhilosophy.

(Dan Boneh)

Principal Adviser

I certify that I have read this dissertation and that, in my opinion, it is fully
adequate in scope and quality as a dissertation for the degree of Doctor ofPhilosophy.

(John Mitchell)

I certify that I have read this dissertation and that, in my opinion, it is fully
adequate in scope and quality as a dissertation for the degree of Doctor ofPhilosophy.

(Serge Plotkin)

Approved for the University Committee on Graduate Studies.

iii

Abstract
We propose the first fully homomorphic encryption scheme, solving a central open problem
in cryptography. Such a scheme allows one to compute arbitrary functions over encrypted
data without the decryption key – i.e., given encryptions E(m1 ), . . . , E(mt ) of m1 , . . . , mt ,one can efficiently compute a compact ciphertext that encrypts f (m1 , . . . , mt ) for any efficiently computable function f . This problem was posed by Rivest et al. in 1978.
Fully homomorphic encryption has numerous applications. For example, it enables
private queries to a search engine – the user submits an encrypted query and the searchengine computes a succinct encrypted answer without ever looking at the query in theclear. It also enables searching on encrypted data – a user stores encrypted files on aremote file server and can later have the server retrieve only files that (when decrypted)
satisfy some boolean constraint, even though the server cannot decrypt the files on its own.
More broadly, fully homomorphic encryption improves the efficiency of secure multiparty
computation.
Our construction begins with a somewhat homomorphic “boostrappable” encryption
scheme that works when the function f is the scheme’s own decryption function. We thenshow how, through recursive self-embedding, bootstrappable encryption gives fully homomorphic encryption. The construction makes use of hard problems on ideal lattices.

iv

Acknowledgments
This thesis would have been impossible without the support and mentoring of my advisor,
Dan Boneh. Even after several years of working with him, I am constantly surprised by his
amazing intelligence, infinite energy, boundless optimism, and genuine friendliness. I wish
I could incorporate more of his qualities. I have limited optimism about my chances.
In a presentation to my fellow Ph.D. admits four years ago, Dan highlighted fully homomorphic encryption as an interesting open problem and guaranteed an immediate diploma
to anyone who solved it. Perhaps I took him too literally. He certainly neglected to mention
how much writing would be involved. But I have never gone wrong following his advice.
I have also received a lot of input and support from my friends in the IBM Crypto
Group, where I’ve interned for the past couple of summers, and where I will be working
permanently – namely, Ran Canetti (now at Tel Aviv University), Rosario Gennaro, Shai
Halevi, Charanjit Jutla, Hugo Krawczyk, Tal Rabin, and Vinod Vaikuntanathan (postdoc).
These discussions have led to significant performance optimizations. Also, Tal Rabin has
been particularly helpful in terms of optimizing my own performance, so that I could finallyfinish the thesis.
I have had helpful discussions and received comments and suggestions from many otherpeople, including (non-exhaustively): Boaz Barak, Marten van Dijk, Shafi Goldwasser,
Iftach Haitner, Michael Hamburg, Susan Hohenberger, Yuval Ishai, Yael Tauman Kalai,
Vadim Lyubashevsky, Daniele Micciancio, Chris Peikert, Oded Regev, Alon Rosen, Amit
Sahai, Adam Smith, Salil Vadhan, and Brent Waters.
This work was supported by the NSF, a Stanford Graduate Fellowship and an IBM PhD
fellowship.

v

Contents
Abstractiv

Acknowledgmentsv

1 Introduction

1

1.1

A Very Brief and Informal Overview of Our Construction . . . . . . . . . .

2

1.2

What is Fully Homomorphic Encryption? . . . . . . . . . . . . . . . . . . .

5

1.3

Bootstrapping a Scheme that Can Evaluate its Own Decryption Circuit . .

7

1.4

Ideal Lattices: Ideally Suited to Construct Bootstrappable Encryption . . .

10

1.5

Squashing the Decryption Circuit: The Encrypter Starts Decryption! . . . .

15

1.6

Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

18

1.7

Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

1.8

Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

21

2 Definitions related to Homomorphic Encryption

27

2.1

Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

27

2.2

Computational Security Definitions . . . . . . . . . . . . . . . . . . . . . . .

31

3 Previous Homomorphic Encryption Schemes34

4 Bootstrappable Encryption

43

4.1

Leveled Fully Homomorphic Encryption from Bootstrappable Encryption, Generically 43

4.2

Correctness, Computational Complexity and Security of the Generic Construction 48

4.3

Fully Homomorphic Encryption from KDM-Secure Bootstrappable Encryption 51

4.4

Fully Homomorphic Encryption from Bootstrappable Encryption in the Random Oracle Model 5vi5 An Abstract Scheme Based on the Ideal Coset Problem

57

5.1

The Ideal Coset Problem. . . . . . . . . . . . . . . . . . . . . . . . . . . .

58

5.2

An Abstract Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

59

5.3

Security of the Abstract Scheme . . . . . . . . . . . . . . . . . . . . . . . .

62

6 Background on Ideal Lattices I: The Basics

63

6.1

Basic Background on Lattices . . . . . . . . . . . . . . . . . . . . . . . . . .

63

6.2

Basic Background on Ideal Lattices . . . . . . . . . . . . . . . . . . . . . . .

65

6.3

Probability Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

68

7 A Somewhat Homomorphic Encryption Scheme

69

7.1

Why Lattices? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

69

7.2

Why Ideal Lattices? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

70

7.3

A Geometric Approach to Maximizing the Circuit Depth that Can Be Evaluated 70

7.4

Instantiating the Ring: The Geometry of Polynomial Rings . . . . . . . . .

72

7.5

Instantiating Encrypt and Minimizing rEnc . . . . . . . . . . . . . . . . . . .

75

7.6

Instantiating Decrypt and Maximizing rDec . . . . . . . . . . . . . . . . . . .

75

7.7

Security of the Concrete Scheme . . . . . . . . . . . . . . . . . . . . . . . .

77

7.8

How Useful is the Somewhat Homomorphic Scheme By Itself? . . . . . . . .

79

8 Tweaks to the Somewhat Homomorphic Scheme

81

8.1

On the Relationship between the Dual and the Inverse of an Ideal Lattice .

82

8.2

Transference Lemmas for Ideal Lattices . . . . . . . . . . . . . . . . . . . .

85

8.3

Tweaking the Decryption Equation . . . . . . . . . . . . . . . . . . . . . . .

86

8.4

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

9 Decryption Complexity of the Tweaked Scheme

90

10 Squashing the Decryption Circuit

98

10.1 A Generic Description of the Transformation . . . . . . . . . . . . . . . . .

98

10.2 How to Squash, Concretely . . . . . . . . . . . . . . . . . . . . . . . . . . .

100

10.3 Bootstrapping Achieved: The Decryption Circuit for the Transformed System 102
11 Security

104

11.1 Regarding the Hint Given in Our “Squashing” Transformation . . . . . . .

vii

104

11.2 Counterbalancing Assumptions . . . . . . . . . . . . . . . . . . . . . . . . .
12 Performance and Optimizations

113
115

12.1 Simple Optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

116

12.2 Basic Performance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

117

12.3 More Optimizations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

117

13 Background on Ideal Lattices II

125

13.1 Overview of Gaussian Distributions over Lattices . . . . . . . . . . . . . . .

12513.2 The Smoothing Parameter . . . . . . . . . . . . . . . . . . . . . . . . . . . .

126

13.3 Sampling a Lattice According to a Gaussian Distribution . . . . . . . . . .

128

13.4 Ideal Factorization in Polynomial Rings . . . . . . . . . . . . . . . . . . . .

129

14 The Somewhat Homomorphic Scheme Revisited132

14.1 Using Gaussian Sampling in Encrypt . . . . . . . . . . . . . . . . . . . . . .

132

14.2 Generating an Ideal with Very Small Norm . . . . . . . . . . . . . . . . . .

133

14.3 Proof of Security Based on the Inner Ideal Membership Problem (IIMP) . .

135

14.4 Success Amplification: Proof of Security Based on the Modified IIMP (MIIMP)136
14.5 Basing Security on a Search Problem: Bounded Distance Decoding Via Hensel Lifting138
14.6 Toward Reducing the SIVP to the BDDP: Regev’s Quantum Reduction . .

141

14.7 Summary of Security Results for this Construction So Far . . . . . . . . . .

143

14.8 Looking Forward . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

143

15 Background on Ideal Lattices III

145

15.1 Lemmata Regarding Vectors Nearly Parallel to e1. . . . . . . . . . . . . .

145

15.2 Distribution of Prime Ideals . . . . . . . . . . . . . . . . . . . . . . . . . . .

148

16 Random Self-Reduction of Ideal Lattice Problems

151

16.1 A New Type of Worst-Case / Average-Case Connection for Lattices . . . .

151

16.2 Our Average-Case Distribution . . . . . . . . . . . . . . . . . . . . . . . . .

153

16.3 How to “Randomize” a Worst-Case Ideal . . . . . . . . . . . . . . . . . . .

154

16.4 Why Does the Reduction Require a Factoring Oracle? . . . . . . . . . . . .

157

16.5 Application to our Fully Homomorphic Encryption Scheme . . . . . . . . .

159

viii

17 How to Randomize a Worst-Case Ideal

161

17.1 The RandomizeIdeal Algorithm . . . . . . . . . . . . . . . . . . . . . . . . .

161

17.2 Is the Ideal Random? The Proof of Theorem 16.3.4 . . . . . . . . . . . . . .

162

17.3 Reduction of WBDDP to HBDDP and Worst-case IVIP to Average-Case IVIP164
17.4 An Alternative Way to Randomize an Ideal . . . . . . . . . . . . . . . . . .
18 KeyGen per the Average Case Distribution

166
175

18.1 The Secret Key . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

175

18.2 Adapting Kalai’s Algorithm to Generate a Random Factored Ideal . . . . .

177

19 Basing Security on Worst-case SIVP in Ideal Lattices

181

19.1 Relationship Among Instances of IVIP . . . . . . . . . . . . . . . . . . . . .

182

19.2 Reduction of SIVP to IVIP . . . . . . . . . . . . . . . . . . . . . . . . . . .

183

20 Circuit Privacy

188

Bibliography

190

ix

List of TablesxChapter 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 [120] shortly after the invention of RSA by Rivest, Shamir,and Adleman [121]. 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
Q
Q
compute i ψi = ( i πi )e mod N , a ciphertext that encrypts the product of the originalplaintexts. One imagines that it was RSA’s multiplicative homomorphism, an accidental
but useful property, that led Rivest et al. [120] to ask a natural question: What can one dowith an encryption scheme that is fully homomorphic: a scheme E with an efficient algorithm EvaluateE that, for any valid public key pk, any circuit C (not just a circuit consistingof multiplication gates as in RSA), and any ciphertexts ψi ← EncryptE (pk, πi ), outputs
ψ ← EvaluateE (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 anapplication, 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 theserver can express this query as a circuit to be applied to the data, and use the EvaluateE
algorithm to construct an encrypted response to the user’s query, which the user thendecrypts. We obviously want the server’s response here to be more concise than the trivial

1CHAPTER 1. INTRODUCTION

2solution, 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 Section 1.8.) However, until now, we did nothave 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 N À n. Furthermore,
imagine you have algorithms Add and Mult that can take ciphertexts E(a) and E(b) andcompute 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 canhandle circuits of depth roughly log log N − log log n.
Now suppose that you have an algorithm Recrypt that takes a ciphertext E(a) withnoise N 0 < N and outputs a “fresh” ciphertext E(a) that also encrypts a, but which has√
noise parameter smaller than 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 soon recursively.
In our construction, we give a somewhat homomorphic encryption scheme. We thenshow how to modify it so that its decryption circuit has multiplicative depth at mostlog log N − log log n − 1 – i.e., less depth than what the scheme can handle. It turns outthat 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 toobtain the Recrypt algorithm, and thereby fully homomorphic encryption! In Chapter 1.3
and Chapter 4, we give more details on why bootstrappability is enough.
Our somewhat homomorphic encryption scheme, described in Chapters 5 and 7, uses
“ideal lattices”. In our exposition, we try to defer the need for technical details about
lattices for as long as possible. For now, we mention that we looked to ideal lattices as

CHAPTER 1. INTRODUCTION

3

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 justas 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 canhandle. In Chapters 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 inserver-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 decrypton 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 multipleof 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 settingb ← (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 thatcomputing 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

CHAPTER 1. INTRODUCTION

4

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(b1 x2 + b2 x1 + 2x1 x2 ) + 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 beused 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 issecurity 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 thebad 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 A that can break semantic security, B uses A to decide which
distribution an integer m comes from as follows: give A the challenge ciphertext c =b + 2m + kp for random k. If m is close to a multiple of p, then so is 2m, and theclosest p-multiple is an even distance away; in particular, b + 2m ∈ [−N, N ] mod p andb + 2m mod p = b, the challenge ciphertext decrypts correctly to b, and A should guess bwith non-negligible advantage. But if m is uniform modulo p, then so is 2m (since p is odd),
c is independent of b, and A has no advantage. Basically, B can distinguish the distributionthat m came from by observing whether A guesses correctly with non-negligible advantage.
In Chapter 5, we provide a conceptually similar proof of our ideal lattice scheme based on
the ideal coset problem (ICP).
Over the next few Sections, we provide more details about our construction, its security
and applications, but still somewhat informally.

CHAPTER 1. INTRODUCTION

1.2

5

What is Fully Homomorphic Encryption?

Our ultimate goal is to construct a fully homomorphic encryption scheme E. 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 f (π1 , . . . , πt ) for any desired function f ,as long as that function can be efficiently computed. No information about π1 , . . . , πt orf (π1 , . . . , πt ), or any intermediate plaintext values, should leak; the inputs, output andintermediate values are always encrypted.
Formally, there are different ways of defining what it means for the final ciphertext to“encrypt” f (π1 , . . . , πt ). The minimal requirement is correctness. A fully homomorphic
encryption scheme E should have an efficient algorithm EvaluateE that, for any valid E key
pair (sk, pk), any circuit C, and any ciphertexts ψi ← EncryptE (pk, πi ), outputs
ψ ← EvaluateE (pk, C, ψ1 , . . . , ψt )such that DecryptE (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 EvaluateE algorithm
does not “process” the input ciphertexts at all.
There are a couple of different ways of excluding the trivial solution. One way is torequire circuit privacy – i.e., (roughly) that the output of EvaluateE reveals nothing (atleast 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 [129, 130]. Typically two-flow OT protocols use an additively
homomorphic encryption scheme, and the OT query consists of a ciphertext ψ in thisencryption 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 [122] and Beaver [14] show how to achieve statistical circuit
privacy, but only for limited classes of circuits – namely, NC1 and NLOGSPACE.

CHAPTER 1. INTRODUCTION

6

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 asC(π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 dependon C. We focus on this definition. Actually, we use a stronger requirement: that DecryptE be
expressible by a circuit DE , 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 (Chapter 20).
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 f to Alice’s film when he develops it – i.e., thesequence of steps to develop the film. In principle, he does not need to see anything toapply 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 ofthe 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 everyonein 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 encryptionthat 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 finishedproducts, 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 thegloves, an employee can manipulate the items inside the box. Moreover, an employee canput 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 takesomething out of the box, not that he is unable to see it.) After the employee is done,CHAPTER 1. INTRODUCTION

7

Alice can recover the finished product at her leisure by using her key. This analogy isinadequate 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
steppingstone. Suppose that, a priori, we have a scheme E that is only guaranteed to becorrect for some subset CE of circuits – i.e.,
DecryptE (sk, EvaluateE (pk, C, ψ1 , . . . , ψt )) = C(π1 , . . . , πt )is guaranteed to hold only if C ∈ CE (and, as before, ψi ← EncryptE (pk, πi )). Can we use E
to construct a scheme E ∗ that is fully homomorphic?
In Chapter 4, we show that the answer is yes. Suppose that CE contains just two circuits:
DE and the augmentation of DE by NAND (i.e., a NAND gate connecting two copies of DE ),where DE is the circuit associated to the decryption algorithm.1 If E has this self-referential
property of being able to evaluate its own (augmented) decryption circuit, we say that E
bootstrappable. We show that bootstrappable encryption implies leveled fully homomorphic
encryption – i.e., that DE plus the NAND-augmentation of DE constitute a “complete” setof circuits:
Theorem 1.3.1 (Informal). If E is bootstrappable, then, for any integer d, one can constructa scheme E (d) that can evaluate any circuit (consisting of NAND gates) of depth d. The
decryption circuit for E (d) is the same as for E, and the complexity of encryption is also
the same. E (d) ’s public key size is O(d) times that of E’s. The complexity of EvaluateE (d)is polynomial in the security parameter and linear in the circuit size. If E is semanticallysecure against chosen plaintext attacks, then so is EvaluateE (d) .
One drawback of E (d) is that its public key is O(d) times that of E’s public key. Since
1
We 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.

CHAPTER 1. INTRODUCTION

8

E (d) has this unwanted dependence on d, we say that it is merely leveled fully homomorphic.
Under certain assumptions, we can make the E (d) public key size be independent of d, inwhich case we say the derived scheme is fully homomorphic.
Why should the fact that E can evaluate (augmentations of) DE be so powerful? Supposethat the distributions of EvaluateE (pk, C, ψ1 , . . . , ψt ) and EncryptE (pk, C(π1 , . . . , πt )) are
different. In particular, suppose that there is an “error” associated with each ciphertext,that ciphertexts output by EncryptE have small error, that ciphertexts output by EvaluateE
have larger error that increases with the depth of the circuit being evaluated, and thateventually (as the depth of the circuit being evaluated increases) the “error” becomes solarge that applying DecryptE 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 circuitand the implicit “error” becomes large, we would like to “refresh” the ciphertext so that theerror 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 thesame thing, but we want a way to refresh that does not require the secret key. This is theidea behind bootstrapping: we do decrypt the ciphertext, but homomorphically!
Specifically, suppose E is bootstrappable, with plaintext space P = {0, 1}, and thatcircuits are boolean. Suppose we have a ciphertext ψ1 that encrypts π under pk1 , which wewant to refresh. So that we can decrypt it homomorphically, suppose we also have sk1 , thesecret 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.
RecryptE (pk2 , DE , hsk1j i, ψ1 ).
R

Set ψ1j ← EncryptE (pk2 , ψ1j )Output ψ2 ← EvaluateE (pk2 , DE , hhsk1j i, hψ1j ii)
Above, Evaluate takes in the bits of sk1 and ψ1 , each encrypted under pk2 . Then, E is used
to evaluate the decryption circuit homomorphically. The output ψ2 is thus an encryption
under pk2 of DecryptE (sk1 , ψ1 ) = π.2 In other words, Recrypt decrypts homomorphicallyusing the encrypted secret key, thus obtaining a new ciphertext that encrypts the samething as the original one.
2

Recrypt implies a one-way multi-use proxy re-encryption scheme [19]. We discuss this in more detail in
Section 1.8.

CHAPTER 1. INTRODUCTION

9

Notice how π is doubly encrypted at one point, and we use EvaluateE to remove theinner encryption. Applying the decryption circuit DE removes the “error” associated to
the first ciphertext under pk1 , but EvaluateE simultaneously introduces a new “error” while
evaluating the ciphertexts under pk2 . Intuitively, we have made progress as long as thesecond error is shorter. Note that revealing the encrypted secret key bits hsk1j i does notcompromise semantic security; these encrypted secret key bits are indistinguishable fromencryptions of 0 as long as E is semantically secure by a standard hybrid argument. Thishybrid argument breaks down if pk1 = pk2 . However, if E securely encrypts key-dependent
messages (is KDM-secure) [18, 68, 22] – 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” ofencrypted secret keys.
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 canevaluate a d-depth circuit of NANDs. If E is KDM-secure, the derived scheme is fully homomorphic (rather than leveled fully homomorphic). In the random oracle model, we showthat a bootstrappable encryption scheme implies a scheme that is both bootstrappable andKDM-secure, and thus implies a fully homomorphic encryption scheme.
Constructing an efficient (leveled) fully homomorphic encryption scheme without usingbootstrapping, or using some relaxation of it, remains an interesting open problem.
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, thegloves 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, shegives 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

CHAPTER 1. INTRODUCTION

10

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 bitof progress on the assembly, all before the gloves of box #(i + 1) stiffen. This is analogous
to the requirement for a bootstrappable encryption scheme E – that the complexity of E’s(augmented) decryption circuit is less than what E 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 masterkey 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 insidebox #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 growas 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 avalid attack for the employee to copy the master key based on what he can see through thetransparent 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 thebox, 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 makemuch 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

CHAPTER 1. INTRODUCTION

11

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 multiplicativehomomorphisms to evaluate general circuits. This consideration leads us to focus on ideal
lattices.
In Chapter 7, we describe our 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 Z (the integers) and the polynomial ring Z[x]/(f (x)), consisting of the residues ofinteger polynomials modulo a monic polynomial f (x). Rings are closed under addition ‘+’,multiplication ‘×,’ and additive inverse, and have an additive identity ‘0’ and multiplicativeP
identity ‘1.’ An ideal I of a ring R is a subset I ⊆ R such that tj=1 ij × rj ∈ I for any
i1 , . . . , it ∈ I and r1 , . . . , rt ∈ R. For example, (2) is an ideal of Z consisting of the setof even numbers. An example ideal in Z[x]/(f (x)) is (a(x)), the set of multiples of a(x)(reduced modulo f (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 theprevious constructions of (partially) homomorphic encryption use rings and ideals, at least
implicitly; see Chapter 3.
As a first approximation, here is how a fully homomorphic encryption scheme based onrings and ideals might work. The public key pk contains an ideal I and a plaintext space P,
where the latter basically consists of a set of “distinguished representatives” of the cosetsof I; the secret key sk consists of some “secret knowledge” concerning I. To encrypt π ∈ P,R

the encrypter sends ψ ← π + I, a “random” member of the coset π + I. The decrypter
uses its secret knowledge to recover the “distinguished representative” π (distinguished withrespect to P) of the coset π + I. To add and multiply ciphertexts, we simply use the ring

CHAPTER 1. INTRODUCTION

12

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
EvaluateE (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 π 0 and ψ, is ψ − π 0 ∈ I? This is the approach of the Polly Cracker scheme by
Fellows and Koblitz, described in Chapter 3.
The first approximation above does not work for ideal lattices, unfortunately, since theideal membership problem is not hard. An ideal lattice, as used in this paper, is simply
an ideal in Z[x]/(f (x)), f (x) of degree n; each such ideal I can be represented by a latticegenerated by the columns of a lattice basis BI , an n × n matrix. It so happens that, forany basis BI of any lattice (not just an ideal lattice) I and any v ∈ Zn , there is a unique,efficiently-computable distinguished representative v mod BI . In particular, it holds that−1v mod BI = v − BI · bB−1
I · ve, where BI is the matrix inverse of BI and b·e rounds to thenearest 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 ofI, 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 secretpk
and public bases Bsk
J and BJ , that is relatively prime to I (i.e., I + J = R). As before, theplaintext space P consists of distinguished representatives of the cosets of I. The public
key pk also includes the description of a distribution D. To encrypt π ∈ P, the encrypterDsets π ∗ ← π + I, and sends ψ ← π ∗ mod Bpk
J . 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 Bsk
J ) mod BI

CHAPTER 1. INTRODUCTION

13

For decryption to work, the secret key Bsk
J should be chosen so as to be compatible withthe distribution D, so that π + i is always the distinguished representative of π + i + J
skwith respect to Bsk
J . In this case, the mod-BJ operation returns π + i, after which π

is recovered easily. This decryption criterion becomes more complicated as we add andmultiply ciphertexts using the basic ring operations. For arithmetized circuit C that uses
addition and multiplication modulo I (w.r.t. basis BI ), we have:
EvaluateE (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 gatesthat add and multiply the underlying plaintexts modulo I, while in the middle and on theright C uses the ring operations ‘+’ and ‘×’, but we will use this for now.) In this case, fordecryption to work, we need C(π1 + i1 , . . . , πt + it ) to be the distinguished representativeof C(π1 + i1 , . . . , πt + it ) + J w.r.t. Bsk
J . We can reverse this statement, and say that the
set CE of circuits that the scheme E evaluates correctly consists of those circuits for whichC(π1 + i1 , . . . , πt + it ) is always the distinguished representative of C(π1 + i1 , . . . , πt + it ) + J
skw.r.t. Bsk
J when BJ is generated according to KeyGenE and πk and ik are chosen according

to EncryptE . In this case, the mod-Bsk
J operation recovers C(π1 + i1 , . . . , πt + it ), after which
the decrypter easily recovers C(π1 , . . . , πt ) by reducing modulo BI .
This characterization of CE becomes less nebulous when, in the context of lattices, wegive 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 representan
tives of the cosets of J w.r.t. the basis Bsk
J are precisely the points in Z that are containedPninside the parallelepiped P(Bskxi · bi , xi ∈ [−1/2, 1/2)} associJ ) = {x ∈ R : x =ated to the basis Bsk
J = {bi }. Decryption works as long as the “error vector” is never
3 Once we specify some radius r
so long that it falls outside of P(Bsk
Dec such that theJ ).

parallelepiped P(BskJ ) 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 EncryptE ) the vectorDπ ∗ ← π + I always falls within a ball of radius rEnc , the bootstrappability question becomes: is C(x1 , . . . , xt ) ∈ B(rDec ) whenever xi ∈ B(rEnc ) for all i and C is an (augmented)
3

sk
If the error vector does fall outside P(Bsk
J ), the mod-BJ 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. Interestingly, NTRU [69] uses relatively prime ideals ina similar way.

CHAPTER 1. INTRODUCTION

14

decryption circuit?
We can upper-bound the length of C(x1 , . . . , xt ) for arithmetic circuit C recursively
by upper-bounding 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, wherekx1 + x2 k ≤ kx1 k + kx2 k 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 thatkx1 × x2 k ≤ γMult (R) · kx1 k · kx2 k; γ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-fanin Add gates. In the worst case, Mult gates cause the length of the error vector essentially tosquare with each additional level of the circuit, limiting the circuit depth that the scheme
can evaluate to (roughly) log log rDec .
Theorem 1.4.1 (Informal). Suppose X ⊆ B(rX ) and Y ⊇ B(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 tolog log rY − log log(γMult (R) · rX )I.e., 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. Specif−1 · ψe, which occurs within theically, the dominant computation in decryption is b(BskJ )computation of ψ mod Bsk
J . Roughly speaking, to ensure that the rounding is correct, onemust use a sufficient number of bits of precision. Then, the high precision of each numbernumber 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 aO(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
4

However, we do not prove this. It remains possible that the decryption circuit of this initial scheme canCHAPTER 1. INTRODUCTION

15This problem is difficult to fix post hoc, in part due to the self-referential nature of thebootstrapability property: intuitively, if one expands the set of circuits that E can “handle”
in an effort to include DE , one seemingly must increase the complexity of DecryptE toaccommodate, thereby making the circuit DE more complex, possibly such that DE 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 thescheme at all, our approach, given in Chapter 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, theencrypter itself plays the server’s role.
Abstractly, if E ∗ is our original homomorphic encryption scheme, with public and secretkeys (pk∗ , sk∗ ), the modified scheme E uses an algorithm that we call SplitKey to generatea “hint” τ about sk∗ , which it puts in the E public key. Also, E uses a new algorithm
ExpandCT. The encrypter uses this algorithm, in combination with the hint τ , to transform apreliminary ciphertext ψ ∗ output by E ∗ into an “expanded ciphertext” that can be decryptedby 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.
R

R

KeyGenE (λ). Runs (pk∗ , sk∗ ) ← KeyGenE ∗ (λ) and (sk, τ ) ← SplitKeyE (sk∗ , pk∗ ). The secret
key is sk. The public key pk is (pk∗ , τ ).
EncryptE (pk, π). Runs ψ ∗ ← EncryptE ∗ (pk∗ , π). It then sets ψ to include ψ ∗ and the output
of ExpandCTE (pk, ψ ∗ ). (ExpandCTE makes heavy use of τ .)DecryptE (sk, ψ). Uses sk and expanded ciphertext to decrypt more efficiently. DecryptE (sk, ψ)
should work whenever DecryptE ∗ (sk∗ , ψ ∗ ) works.
AddE (pk, ψ1 , ψ2 ). Extracts (ψ1∗ , ψ2∗ ) from (ψ1 , ψ2 ), computes ψ ∗ ← AddE ∗ (pk∗ , ψ1∗ , ψ2∗ ), andsets ψ to include ψ ∗ and the output of ExpandCTE (pk, ψ ∗ ). MultE (pk, ψ1 , ψ2 ) is analogous.
be expressed in a way that makes the scheme bootstrappable.

CHAPTER 1. INTRODUCTION

16

We (half facetiously) say that the “encrypter starts decryption” because it uses the secretkey-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 thesecret key sk of the original scheme E ∗ . However, it is easy to see that E is semanticallysecure as long as E ∗ is, as long as the following SplitKey distinguishing problem is hard:
given (pk∗ , sk∗ , τ ), distinguish whether τ was generated as the output of SplitKeyE (sk∗ , pk∗ )(as it should be), or as the output of SplitKeyE (⊥, pk∗ ), where ⊥ is some distinguishedsymbol that is independent of sk∗ . In the latter case, τ gives no additional information
about sk∗ that could weaken security.
Theorem 1.5.1 (Informal). If there is an algorithm A that breaks the squashed schemewith non-negligible probability, then there is either an algorithm B1 that breaks the originalscheme or an algorithm B2 that solves the SplitKey distinguishing problem with non-negligible
advantage.
Concretely, we actually apply a couple of technical “tweaks” to our original ideal-latticebased construction before we apply the above transformation. In one tweak, we show how
to simplify the decryption equation in the original scheme from (ψ ∗ mod Bsk
J ) mod BI =sk −1 ∗∗sk∗(ψ ∗ −Bsk
J ·b(BJ ) ·ψ e) mod BI to (ψ −bvJ ×ψ e) mod BI where ‘×’ is ring multiplicationand vJsk ∈ Qn . 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 theset 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 ofthe 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 bvJsk × ψ ∗ e yields thecorrect 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 SplitKeyE , τ is a random set S (with ω(n), butpoly(n), members) of vectors {ui } that has a sparse subset T (with ω(1), but o(n), members)

CHAPTER 1. INTRODUCTION

17

whose sum is vJsk modulo I; the new secret key sk is the subset T , encoded as a 0/1-vectorin {0, 1}|S| . Distinguishing whether or not the vectors in S are completely uniform andindependent of sk∗ is a lattice-related problem, whose search version (actually finding thesubset) has been studied in the context of server-aided cryptography [91, 114, 106, 96, 105].
We discuss this problem a bit more in the next Section.
In the modified scheme, ExpandCTE outputs {ci ← ui × ψ ∗ mod BI : ui ∈ S}. To
oversimplify, DecryptE 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 (whichis 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 isrounded 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 thepromise 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 |S|, when we have the promise that only |T | ofthe |S| vectors are nonzero (and the other promises, like the fact that we only need theresult 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 ofa vector in x ∈ {0, 1}|S| and expressing the final result in binary – i.e., in {0, 1}s+1 fors = blog |S|c. 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 beat most |T |, we need not bother computing the polynomials of degree higher than 2blog |T |c ,and consequently need less depth.
Theorem 1.5.2 (Informal). The decryption circuit of E with the tweaks followed by theabove transformation 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) −CHAPTER 1. INTRODUCTION

18

log log(γMult (R) · rEnc ).
c0

For example, suppose rDec = 2n for some c0 < 1 and γMult (R) · rEnc = poly(n). In this0case, the scheme becomes bootstrappable when |T | ≤ n(c /c)−o(1) .
Devising a physical analogy for our technique for squashing the decryption circuit israther difficult, but suppose that, in Alice’s jewelry store, a key opens a glove box througha 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 rightbefore 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 chemicalcomposition of the accelerant provides some information about the chemical compositionof 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 ofbox #(i + 1); to apply it while box #i is inside box #(i + 1) would pointlessly waste theusability of the gloves for box #(i + 1).

1.6

Security

The semantic security of our scheme against chosen plaintext attacks relies on the hardnessof 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 in two ways. The
first way is provided for simplicity. Specifically, in Chapter 5 (and more concretely in
Chapter 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 vectort, 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 isin the first category, the simulator can use t to construct a valid ciphertext vector (whichis also quite close to the lattice, but a little bit further away than t), but if t is in theCHAPTER 1. INTRODUCTION

19

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.
This reduction, while simple, is not entirely satisfying. First, the problem is not worstcase, but rather average-case: in particular, J is generated using an algorithm IdealGen thatis part of the scheme’s KeyGen algorithm. Second, it would be preferable to base security
on a search problem rather than a decision problem. Finally, although the problem seems
natural, it is not as well-established as other problems over lattices.
So, beginning in Chapter 14, we describe a slightly different version of the scheme, alongwith a chain of security reductions that bases security on a search version of BDDP. Given
access to a factoring oracle, we also base security on the worst-case shortest independentvector problem (SIVP) over ideal lattices. Since a factoring oracle can be instantiatedefficiently using quantum computation, this result says that if there is an efficient algorithm
that breaks the semantic security of scheme with non-negligible advantage, then there is anefficient quantum algorithm that solves ideal-lattice SIVP.
Theorem 1.6.1 (Informal). If there is an algorithm that breaks the somewhat homomorphic
scheme with probability ², then there is a classical algorithm that solves average-case BDDP
over ideal lattices for an approximation factor (rDec /rEnc ) · poly(n, γMult (R), 1/²), where
the average-case distribution is the same as the distribution of ideals output by KeyGenE .
There is also a quantum algorithm (or a classical algorithm that uses a factoring oracle)that solves worst-case SIVP over ideal lattices for an approximation factor (rDec /rEnc ) ·poly(n, γMult (R), 1/²). In both cases, the ring R over which ideals are defined remains fixed.
The introduction of τ into the public key induces a second problem that we must assumeis hard, an instance of the SplitKey distinguishing problem: roughly, given vJsk , distinguishwhether 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 | istoo small, there are obvious brute force attacks on the SVSSP, along with some moresophisticated time-space tradeoffs [114, 128, 33], 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 [106, 105].
However, if |T | = ω(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.

CHAPTER 1. INTRODUCTION

20Interestingly, 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 isroughly 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 depthO(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 forapproximation factor 2k takes time about 2n/k , the breaking time for the first problem is√√roughly 2n/|T | . Setting |T | ← n ensures that it takes time at least 2 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 ourphysical 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-homomorphicallytimes 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-lengthis quasi-linear in λ3 , in which case a full exponentiation takes time quasi-linear in λ6 , even

CHAPTER 1. INTRODUCTION

21

when one uses fast FFT multiplication. See Chapter 12 for more details.
The story is very different if we only require super-polynomial security: in this case, ncan be quasi-linear in the security parameter λ, |T | can be polylogarithmic in n, S quasilinear in n, and ciphertexts can be represented by a quasi-linear (in n) number of bits. In thiscase, 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 homomorphicallyevaluating 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 ofmultiplicative 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, andgenerates 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 searchfunction. 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 Ci∗
and Cj∗ 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, Alicestores 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CHAPTER 1. INTRODUCTION

22

server, which expresses it as a circuit C. The server sets ψi∗ ← 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 upperbound.)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. Withfully 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 sizeof 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 filteringof 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, Alicedecrypts 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

CHAPTER 1. INTRODUCTION

23

function. More specifically, one can construct efficient secure protocols for any multiparty
computation in which there is an honest majority [56], assuming only the existence of
trapdoor permutations. 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 somefactor 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[103] 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 toa factor polynomial in the security parameter? With fully homomorphic encryption, theanswer is essentially ‘yes.’ More precisely, the answer is ‘yes’ if we relax the definitionof 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 thecomputation 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 [45], andfurther developed by Cramer, Damgard and Nielsen [35] (see also [39]) – 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; thisintroduces additive communication and computational overhead that is independent of theinsecure 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

CHAPTER 1. INTRODUCTION

24

protocol, it is also able to in the secure protocol. Afterwards, they use some scheme forsecure computation to perform threshold decryption on the encrypted outputs; again, thisoverhead is independent of the insecure protocol, except insofar as it depends on the bitlengths of the function outputs. Cramer et al.’s scheme is dependent on the number ofmultiplication gates in the circuit because these could not be performed homomorphically.
With a fully homomorphic encryption scheme, we avoid this problem, and fully realize theirhigh-level concept of an “arithmetic black box.”
To handle malicious parties, we can use Naor and Nissim’s [103] transformation from a
protocol for multiparty SFE with semi-honest parties to a protocol for malicious ones via acompiler 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, thework 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 [78, 79] and Arora et al.’s PCP theorem [8].
The literature mentions numerous other applications where fully homomorphic encryption would be useful. For example, Goldreich and Ostrovsky [57] consider software protection, show that any program can be converted to a pair consisting of an encrypted programand a CPU with λ 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 andvalues 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 [59] introduce the concept of one-time programs, inwhich 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 havea 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

CHAPTER 1. INTRODUCTION

25

size is proportional to the original program. Essentially, one simply encrypts the programusing the fully homomorphic encryption scheme, and runs it homomorphically, using thedevice 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 [78, 79].
Ostrovsky and Skeith [109] propose the notion of public-key obfuscation – i.e., where asort 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 isa lot of excitement about applications such as web services and cloud computing, where
fully homomorphic encryption would permit remote computations on encrypted data withcomplete privacy.
We have already mentioned the notion of proxy re-encryption in Chapter 1.3. In a proxyre-encryption [19, 29, 71, 70], 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 havesome shortcomings. They either are not unidirectional (i.e., Alice’s tag can also be used toconvert 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 oftags τ1 , τ2 , . . . 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 )}, andthe output ciphertext ψ ∗ ← Evaluate(pk, C, ψ1 , . . . , ψt ). The NIZK that her assignment issatisfying consists of NIZK proofs, under any NIZK scheme, that pk, {ψi } and ψ ∗ are wellformed, where well-formedness for the ciphertexts means that each ψi is a valid encryptionof ‘0’ or ‘1’, and ψ ∗ is a valid encryption of ‘1’. The verifier checks the NIZKs for wellformedness, 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CHAPTER 1. INTRODUCTION

26

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 canevaluate such shallow circuits using the somewhat homomorphic scheme that we sketchedin Chapter 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 essentiallyan 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 relationshipbetween fully homomorphic encryption and obfuscation is unclear. We know that generalobfuscation is impossible under a certain definition of obfuscation [12], but obfuscation may
be possible under a weaker, but still meaningful, definition. We also know that generalobfuscation (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 guessthat 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 fromfully homomorphic encryption, the question becomes: how can one provide, as part of theobfuscated circuit, some sort of decryption key that allows recovery of the final output, insuch a way that this decryption key does not permit decryption of interior nodes of thecircuit, thereby unraveling the entire obfuscation.

Chapter 2

Definitions related to
Homomorphic Encryption
2.1

Basic Definitions

A conventional public-key encryption scheme E consists of three algorithms: KeyGenE ,EncryptE , and DecryptE . KeyGenE 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 P
and ciphertext space C. EncryptE is a randomized algorithm that takes pk and a plaintext
π ∈ P as input, and outputs a ciphertext ψ ∈ C. DecryptE takes sk and ψ as input, andoutputs the plaintext π. The computational complexity of all of these algorithms must beRpolynomial in λ. Correctness is defined as follows: if (sk, pk) ← KeyGenE , π ∈ P, andRψ ← EncryptE (pk, π), then DecryptE (sk, ψ) → π.
In addition to the three conventional algorithms, a homomorphic encryption scheme E
has a (possibly randomized) efficient algorithm EvaluateE , which takes as input the public key pk, a circuit C from a permitted set CE of circuits, and a tuple of ciphertexts
Ψ = hψ1 , . . . , ψt i for the input wires of C; it outputs a ciphertext ψ ∈ C. Informally,
the functionality that we want from EvaluateE is that, if ψi “encrypts πi ” under pk, thenψ ← EvaluateE (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.

27

CHAPTER 2. DEFINITIONS RELATED TO HOMOMORPHIC ENCRYPTION

28

Definition 2.1.1 (Correctness of Homomorphic Encryption). We say that a homomorphic encryption scheme E is correct for circuits in CE if, for any key-pair (sk, pk) output by KeyGenE (λ), any circuit C ∈ CE , any plaintexts π1 , . . . , πt , and any ciphertexts
Ψ = hψ1 , . . . , ψt i with ψi ← EncryptE (pk, πi ), it is the case that:if ψ ← EvaluateE (pk, C, Ψ) , then DecryptE (sk, ψ) → C(π1 , . . . , πt )except with negligible probability over the random coins in EvaluateE .
By itself, mere correctness fails to exclude trivial schemes. In particular, suppose we define EvaluateE (pk, C, Ψ) to just output (C, Ψ) without “processing” the circuit or ciphertexts
at all, and DecryptE 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 EvaluateE . One way to do this is by placing an upperbound on the size of the decryption circuit DE for the scheme E that depends only on the
security parameter, as in the following definition.
Definition 2.1.2 (Compact Homomorphic Encryption). We say that a homomorphic encryption scheme E is compact if there is a polynomial f such that, for every value of the
security parameter λ, E’s decryption algorithm can be expressed as a circuit DE of size at
most f (λ).
Definition 2.1.3 (“Compactly Evaluates”). We say that a homomorphic encryption scheme
E “compactly evaluates” circuits in CE if E is compact and also correct for circuits in CE .
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 stillinteresting 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 callsuch schemes “quasi-compact.”
Now, we define fully homomorphic encryption as follows.
Definition 2.1.4 (Fully Homomorphic Encryption). We say that a homomorphic encryption scheme E is fully homomorphic if it compactly evaluates all circuits.
One may consider this definition to be too strong, because, as mentioned above, quasicompactness could suffice; we avoid using quasi-compactness in our definition both because

CHAPTER 2. DEFINITIONS RELATED TO HOMOMORPHIC ENCRYPTION

29

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.1.5 (Leveled Fully Homomorphic Encryption). We say that a family of homomorphic encryption schemes {E (d) : d ∈ Z+ } is leveled fully homomorphic if, for all d ∈ Z+ ,they all use the same decryption circuit, E (d) compactly evaluates all circuits of depth at
most d (that use some specified set of gates), and the computational complexity of E (d) ’s
algorithms is polynomial in λ, d, and (in the case of EvaluateE ) 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 toachieve, one still might consider our definition to be too weak, since it does not require
circuit privacy.
Definition 2.1.6 ((Statistical) Circuit Private Homomorphic Encryption). We say thata homomorphic encryption scheme E is circuit-private for circuits in CE if, for any keypair (sk, pk) output by KeyGenE (λ), any circuit C ∈ CE , and any fixed ciphertexts Ψ =hψ1 , . . . , ψt i that are in the image of EncryptE for plaintexts π1 , . . . , πt , the following distributions (over the random coins in EncryptE , EvaluateE ) are (statistically) indistinguishable:
EncryptE (pk, C(π1 , . . . , πt )) ≈ EvaluateE (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 ourlattice-based fully homomorphic encryption scheme circuit private. Our technique will be
to use a public (i.e., not using the secret key) algorithm RandomizeCTE that, applied posthoc, induces the same distribution (statistically) to ciphertexts output by EncryptE and
EvaluateE , while preserving correctness. (See Chapter 20.)
The motivating setting for statistical circuit privacy is two-party computation in thehonest-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 RandomizeCTE to the ciphertext
output by EvaluateE before sending result to Bob. When sk is shared, one may also defineCHAPTER 2. DEFINITIONS RELATED TO HOMOMORPHIC ENCRYPTION

30

a computational version of circuit privacy, but this is covered by the semantic security ofencryption scheme, defined in the next Section.
For most applications, it is acceptable to reveal some limited information about thecircuit, 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 thateach wire extends from one gate to a gate with a higher level number.) Accordingly, wedefine the following slight relaxation of circuit privacy.
Definition 2.1.7 (Leveled Circuit Private Homomorphic Encryption). Like circuit private
homomorphic encryption, except that there can be a different distribution associated toeach level, and the distributions only need to be equivalent if they are associated to thesame 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 thecase in some previous circuit-private schemes, such as SYY [122].
An interesting open question is the extent to which fully homomorphic encryption, as wehave 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 anon-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 niceto state some natural minimal generic property, in addition to full homomorphism, thatwould 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CHAPTER 2. DEFINITIONS RELATED TO HOMOMORPHIC ENCRYPTION

31

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 constructa 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 [73] describe a scheme in which Evaluate takes abranching 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.
R

Setup. The challenger runs (sk, pk) ← KeyGenE (λ) and gives pk to the adversary A. It setsψ ∗ ← ⊥.
Queries. A issues decryption queries on ciphertexts ψi 6= ψ ∗ . The challenger responds withthe output of DecryptE (sk, ψi ). Queries can occur before or after the challenge.
Challenge. A generates two plaintexts π0∗ , π1∗ ∈ P and sends these to the challenger. The
R

R

challenger sets b ← {0, 1} and ψ ∗ ← EncryptE (pk, πb∗ ). It sends ψ ∗ to A.
Guess. A sends b0 ∈ {0, 1} to the challenger. A wins the game if b0 = b.
Security against “lunchtime attacks” – i.e., CCA1 security – is modeled by a game similar toabove, except that A may make queries only before the challenge. In the game for semantic
security, A is not permitted to make any queries.
In each case, we define A’s advantage in attacking the scheme E as
¯
¯
¯
1 ¯¯
0
¯
Adv(A, E, λ) = ¯Pr[b = b ] − ¯
2The probability is over the random bits used by the challenger and the adversary.

CHAPTER 2. DEFINITIONS RELATED TO HOMOMORPHIC ENCRYPTION

32

Definition 2.2.1 (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 A breaks E 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 spaceis potentially larger – i.e., the support of EvaluateE rather the support of EncryptE ; A
can draw its queries from this larger space. Also, A has more freedom in requesting
its challenge. The natural way to define the Challenge phase is that A sends the challenger some circuit C ∈ CE with some number k = poly(λ) of inputs, and two sets ofRplaintexts, (π01 , . . . , π0k ), (π11 , . . . , π1k ) ∈ P k ; the challenger sets b ← {0, 1} and outputs
RRψ ∗ ← EvaluateE (pk, C, ψb1 , . . . , ψbk ) where ψbi ← EncryptE (pk, πbi ). However, since the adversary can run EvaluateE 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 [16], an algorithm
A that that breaks the semantic security in the game above with advantage ² can be used
to construct an algorithm B that breaks the semantic security in the original game withadvantage ²/k; B’s is roughly k times that of A [52]. Thus, to prove semantic security of ahomomorphic 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
B to forward A’s decryption queries to the challenger, and forward the responses back to
A.)
Unfortunately, a scheme that has nontrivial homomorphisms cannot be CCA2 secure,because it is malleable. Benign malleability [6] and replayable CCA [30], two relaxed notions of CCA2 security, permit only transformations that preserve the underlying plaintext.
Prabhakaran and Rosulek [115] 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

CHAPTER 2. DEFINITIONS RELATED TO HOMOMORPHIC ENCRYPTION

33

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” [36] is CCA1 andhomomorphic (for one operation). However, we restrict our focus to semantic security, andleave finding a CCA1-secure fully homomorphic encryption scheme as an interesting open
problem.

Chapter 3

Previous Homomorphic
Encryption Schemes
Basic RSA [121] 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.
Rivest, Adleman, and Dertouzos [120] were the first to explore the possibilities of fully
homomorphic encryption, which they called a “privacy homomorphism”, and they proposedseveral candidate schemes. However, these early candidates have been broken [25].
Homomorphic encryption schemes that are not semantically secure, like textbook RSA
and some proposals in [120], may also have stronger attacks on their one-wayness. In
particular, Boneh and Lipton [23] proved that any algebraic privacy homomorphism overa ring Zn can be broken in sub-exponential time under a (reasonable) number theoretic
assumption, if the scheme is deterministic or offers an equality oracle. See also [92]. In thequantum setting, the situation is even worse. van Dam, Hallgen and Ip [37] proved that,with quantum computation, any deterministic algebraic privacy homomorphism with anequality oracle can be broken in polynomial time.
The first scheme with a proof of semantic security based on a well-defined assumption

34

CHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES

35

was proposed by Goldwasser-Micali [61] in the paper that introduced the notion of semantic security. Some other additively homomorphic encryption schemes with proofs of semantically security are Benaloh [17], Naccache-Stern [102], Okamoto-Uchiyama [108], Paillier [110], and Damgard-Jurik [38]. ElGamal [42] is multiplicatively homomorphic. Somesemantically secure schemes that allow both addition and multiplication include BonehGoh-Nissim [21], which permits computation of quadratic formulas (e.g., 2-DNFs) overciphertexts, and “Polly Cracker” by Fellows and Koblitz [44], which permits computationof arbitrary circuits over ciphertexts, but where the ciphertext size blows up exponentiallywith the depth of the circuit. For expository purposes, and since one can easily find othersurveys of homomorphic encryption, we characterize these “conventional” homomorphic encryption schemes (although perhaps Polly Cracker is less conventional) as all falling withina 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 Chapter 7.
It is also known that one can construct additively homomorphic encryption schemes
from lattices or linear codes [60, 113, 77, 94, 95, 7]. The lattice-based scheme [95] and theReed-Solomon-code-based scheme by Armknecht and Sadeghi [7] 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, thehomomorphism is sometimes referred to as a “pseudohomomorphism” [77, 94, 95] or a“bounded homomorphism” [113]. (We use different terminology; see Chapter 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 [40] describes a technique that they call “interval obfuscation” which can beviewed 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 forsome x ∈ [1, a], where a is a “small” integer, while a ‘1’ is encrypted as s· x mod M for someCHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES

36

x ∈ [b + 1, b + a], where b is a “large” integer (but still small in comparison to M ). One cancryptocompute a homogeneous polynomial of degree d logarithmic in the security parameterby simply adding or multiplying the ciphertexts modulo M . The recipient decrypts c bysetting c0 ← c/sd mod M (to remove the blinding factor) and then outputting bc0 /bd e; theidea is that each monomial which is a product of 1’s will be represented by some integerthat approximately equals bd after the blinding factor is removed, while the monomials forwhich 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 Chapter 7 is conceptuallysomewhat 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 ourscheme) 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 canbe 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 [122, 73].
Sanders, Young and Yung (SYY) [122] 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 thecircuit. Their scheme can therefore feasibly evaluate NC1 circuits.
Ishai and Paskin [73] 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 ofthe branching program is very large – e.g., super-polynomial. However, the computational
complexity of their scheme is proportional to the size; Barrington [13] tells us that boundedwidth polynomial-size branching programs recognize exactly those languages in NC1.
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 Chapter 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 outgoingedges labeled 0 and 1, and where the terminal nodes also have labels. To compute P (x)where the binary representation of x is x1 · · · x` , one starts at the distinguished node, andCHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES

37

traverses the DAG in the natural way dictated by x1 · · · x` to reach a terminal node, andoutputs 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, suchthat 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, andordered 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 ` levels, and Bob has an input x = x1 · · · x` ∈{0, 1}` for which he wants to obtain P (x). Bob constructs ` 1-out-of-2 string OT queries qi ,which respectively correspond to his bits xi . Using Bob’s queries, Alice evaluates her BPfrom the bottom-up. In particular, suppose N is a node at level ` − 1 with children N 0 and
N 1 with labels L0 and L1 . Alice uses q` , L0 and L1 to construct a string-OT response R
that implicitly “encrypts” label Lx` ; she then sets R to be the label of N . In this fashion,
she gives labels to all of the nodes at level ` − 1, and then (recursively) to nodes at higher
levels using Bob’s other OT queries. Alice’s ultimate response is the label associated tothe 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 x1 x2 , and so on. The length of Alice’s response grows (at least) linearly with ` foressentially 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 [38, 84] – 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 current state of affairs as far we know, in terms of schemes thatoffer more than a single homomorphism and offer a proof of semantic security, we havethe schemes by Fellow and Koblitz [44], Melchor et al. [95], Armknecht and Sadeghi [7],and Sanders et al. [122], and related work [14, 83, 85, 86] where ciphertext size grows
exponentially with the multiplicative (and sometimes also additive) depth of the circuit.
In Boneh-Goh-Nissim [21] and Ishai-Paskin [73], Evaluate outputs small ciphertexts but
handles a limited class of circuits – quadratic formulas, or circuits which correspond to
branching programs of manageable size.

CHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES

38

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 previous schemes implicitly use these objects. By describing previous 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 memberof 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 amultiplicative inverse. Examples include the integers Z, or the integers modulo a composite
integer N : Z/N Z. 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 withelements of R. An example is the ideal (2) of Z, the set of even numbers; multiplying anelement of (2) with an element of Z gives an element in (2). For ideal I ⊂ R, R/I is thering of cosets of I in R; e.g., if R = Z and I = (2), R/I consists of the cosets 0 + (2) (theeven 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 previous homomorphic encryption schemes
fall within the following framework. (Essentially, this abstract framework is explicit in Fellows’ and Koblitz’s description of Polly Cracker [44].)
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
P is a set of distinguished representatives of R/I. The secret key is a function f : R → P
such that f (r) is the distinguished representative of r + I. The public key pk includes theencoding of R and an algorithm SampI to sample (efficiently) from I.
R

Encrypt(pk, π). Set i ← SampI (R) and ψ ← π + i.
Decrypt(sk, ψ). Output f (ψ).
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 = 2p0 + 1³ ´ ³ ´and q = 2q 0 +1, and a number x ∈ (Z/N Z)∗ whose Legendre symbols are xp = xq = −1.
In terms of the abstract framework, the underlying ring R is Z/(2p0 q 0 ), which corresponds toCHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES

39

the powers of x modulo N . The underlying ideal I is (2), the set of quadratic residues, evenpowers of x. The plaintext space is {0, 1}, represented as {x0 , x1 }. The function f : R → P
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.0.2. 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 theencrypter can easily map the latter representation to the former. This is the case with theother schemes as well.
Remark 3.0.3. Of course, a lot of complexity is hidden in the function f . GoldwasserMicali uses Legendre symbols. Paillier uses a more elaborate approach. Some schemes, suchas Boneh-Goh-Nissim (described below) can use only a small (polynomial-sized) subsetof the potential plaintext space because the function f 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.0.4 (Ideal Membership Problem (IMP)). According to a prescribed distribution, the challenger generates an encoding of R, an ideal I, and an algorithm SampI thatRR

samples from I. It sets a bit b ← {0, 1}. If b = 0, it sets x ← SampI (R). If b = 1, it setsR

x ← 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.0.5. If there is an algorithm A that breaks the semantically security of theabstract scheme with advantage ², then there is an algorithm B that solves the IMP withadvantage ²/2.
Proof. Given instance (x, R, SampI ) of IMP, B includes (R, SampI ) in pk, which it sends to
R

A. A requests a challenge ciphertext on one of π0 , π1 ∈ P. B sets β ← {0, 1}, and sends
the challenge ψ ← πβ + x to A. A sends guess β 0 , and B sends guess b0 ← β ⊕ β 0 to thechallenger.
If b = 0, then B’s simulation is perfect; in particular, the challenge is a valid encryptionof πβ . In this case, A should guess β with advantage ², and thus b0 = b with advantage ².

CHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES40

If b = 1, x is random in R, and thus the challenge ciphertext is a random element of R,
independent of β. In this case, β 0 is independent of β, and so b0 is independent of b, so that
B’s advantage is 0. Overall, B’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 6= 2 where mdivides φ(N ). In Paillier, the ring is Z/(p0 q 0 N ), the ideal is (N ), and it is based on the N -th
residuosity problem. Damgard-Jurik extends Paillier to the ring is Z/(p0 q 0 N k ) and uses theideal is (N k ). Okamoto-Uchiyama uses a modulus of the form N = p2 q, and uses the ringZ/(pp0 q 0 ) and the ideal Z/(p).
The above schemes can all be said to be based on a subgroup (or subset) membershipproblem [?], 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 [44] and Boneh-Goh-Nissim (BGN) [21].
The Polly Cracker scheme was proposed by Fellows and Koblitz [44]. They state essentially the abstract framework above and propose an instantiation of it using the polynomial ring R = Fq [x1 , . . . , xn ]. The ideal I is presented as a set of generating polynomials
P = {pi (x1 , . . . , xn )} having a common (secret) root (a1 , . . . , an ); the ideal I is the set ofP
all polynomials of the formpi (x) · ri (x) for ri (x) ∈ R. To sample from I, one uses thegenerators, though there is plenty of freedom here in setting the sampling distribution since
R and I are infinite. The plaintext space is Fq . The abstract function f is instantiatedas 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 [43, 46] – roughly speaking,parameters for which the underlying IMP is not hard because it is possible to recover thecommon root using Groebner bases. Modified versions of Polly Cracker have been proposed[83, 85, 86], also with attacks [126]. But there does not seem to be an efficient general
attack. See [82] 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

CHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES

41

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 aninteresting case because it uses multiple different representations of its underlying ring R.
Specifically, KeyGen generates a modulus N = pq, two groups G, G1 of order N with anefficiently computable non-degenerate bilinear map e : G × G → G1 (where typically G isan elliptic curve group and G1 is a multiplicative subgroup of a finite field), a generator gof G, and an element h = g p . In terms of the abstract framework, the underlying ring R
is Z/(N ), which is represented in the public key both by (G, g) and implicitly (G1 , e(g, g));we will call these the G-representation and the G1 -representation. The ideal I is (p), thep-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 elementx ∈ R, given in G-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 ismore interesting. Mult uses the pairing operation, meaning that it can only be applied
to two ciphertexts in G-representation, and the output has a G1 -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 G1 -representation); concretely, thismultiplication in the exponent occurs by computing e(g x , g x ) → e(g, g)xy . Since there is no
known way to efficiently map from the G1 -representation back to the G-representation, thescheme is limited to one level of multiplication.
To decrypt a ciphertext g π+tp in G in BGN, the decrypter computes (g π+tp )q = g πq ,and then DLgq (g πq ) = π; it decrypts ciphertexts in G1 similarly. For the discrete logarithm
computation to be feasible, π must be from a set of polynomial size – say, a polynomialsized interval centered at 0. However, subject this constraint on the input ciphertexts {ψi }from G, 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, Fp ), the general linear group of 2 × 2 matrices over Fp , and an ideal Ib ⊂ R as thesubset of matrices whose second row is b times the first column. Basically, Ib corresponds

CHAPTER 3. PREVIOUS HOMOMORPHIC ENCRYPTION SCHEMES

42

to the set of valid DDH tuples (g, g a , g b , g ab ) 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 theadditive homomorphishm. Multiplication in R is right-multiplication; one can see thatright-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 morecoincidental than essential. For example, one can modify BGN in a way that preserves theability 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 overciphertexts with a hypothetical n-linear map; for this more robust homomorphism, it would
seem more efficient to use BGN’s original ideal-membership approach.

Chapter 4

Bootstrappable Encryption
4.1

Leveled Fully Homomorphic Encryption from Bootstrappable Encryption, Generically

Assume we have an encryption scheme E that compactly evaluates some set of circuits
CE . We want to use E to construct a homomorphic encryption scheme that can handle
arbitrary circuits. In this Chapter we prove a fundamental result: that if CE contains(slight augmentations of) E’s own decryption circuit DE – i.e., if E “compactly evaluates”
its (augmented) decryption circuit – then we can use E to construct an efficient scheme that
handles circuits of arbitrary depth.
A bit more specifically, for any integer d, we use E to construct a scheme E (d) that cancompactly evaluate circuits of depth up to d. The decryption circuit for E (d) is still DE ; thesecret key and ciphertexts are the same size as in E. The public key in E (d) consists of d + 1
public keys from E, together with a chain of encrypted E secret keys – the first E secret key
encrypted under the second E public key, and so on. In short, the family of schemes {E (d) }is leveled fully homomorphic. We base the semantic security of E (d) on that of E using a
hybrid argument; as usual with hybrid arguments, the reduction loses a factor linear in d.
In Chapter 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 toevaluate) by assuming key-dependent-message (KDM) security, specifically circular-security– i.e., that one can safely encrypt a E secret key under its associated public key.

43

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

44

Since this critical property of E – 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 ahigh 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 levelsin the circuit, and thus can evaluate circuits of arbitrary depth. To “refresh” a ciphertext
that encrypts a plaintext π under E public key pki , we re-encrypt it under pki+1 and thenhomomorphically 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 withinhomomorphic 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 ofencryption. 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 P is {0, 1} and DE is a boolean
circuit in CE . Let (sk1 , pk1 ) and (sk2 , pk2 ) be two E key-pairs. Let ψ1 be an encryption ofπ ∈ P 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 encryptionof π under pk2 .
Recrypt(pk2 , DE , hsk1j i, ψ1 ).
R

Set ψ1j ← EncryptE (pk2 , ψ1j ) where ψ1j is the j-th bit of ψ1
Set ψ2 ← EvaluateE (pk2 , DE , hhsk1j i, hψ1j ii)
Output ψ2
Above, the Evaluate algorithm takes in all of the bits of sk1 and all of the bits of ψ1 , eachencrypted under pk2 . Then, E is used to evaluate the decryption circuit homomorphically.
The output ψ2 is thus an encryption under pk2 of DecryptE (sk1 , ψ1 ) → π.
Remark 4.1.1. The Recrypt algorithm implies a proxy one-way re-encryption scheme [19].
Roughly speaking, a one-way proxy re-encryption scheme allows the owner of sk1 to generatea 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 hsk1j i, the encrypted

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

45

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 E, however, this double
encryption might be overkill. Suppose WeakEncryptE is an algorithm such that the imageof WeakEncryptE (pk, π) is always a subset of the image of EncryptE (pk, π). Then we canreplace the first step of RecryptE with:R

Set ψ1j ← WeakEncryptE (pk2 , ψ1j ) where ψ1j is the j-th bit of ψ1
Let us call this relaxation Recrypt0E . The main point of this relaxation is that WeakEncrypt
does not need to be semantically secure for Recrypt0E to be a secure one-way proxy reencryption scheme, or for Recrypt0E to be useful toward bootstrapping (as we will see below).
Thus, depending on E, WeakEncryptE can be very simple – e.g., for some schemes, and inparticular for the ideal-lattice-based scheme that we describe later, WeakEncryptE mightleave the input “bits” entirely unmodified. This will unfortunately not help us much interms of making the encryption scheme bootstrappable; essentially, it will add one circuit
level to what E can evaluate. However, it will affect the eventual computational complexityof 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, E 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.1.2 (Augmented Decryption Circuit). Let DE be E’s decryption circuit, whichtakes a secret key and ciphertext as input, each formatted as an element of P `(λ) , where P is
the plaintext space. Let Γ be a set of gates with inputs and output in P, which includes thetrivial gate (input and output are the same). We call a circuit composed of multiple copies

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

46

of DE 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 DE (Γ).
Definition 4.1.3 (Bootstrappable Encryption Scheme). As before, let CE denote the set ofcircuits that E can compactly evaluate. We say that E is bootstrappable with respect to Γ if
DE (Γ) ⊆ CE .
For example, if Γ includes the trivial gate and NAND, E is bootstrappable with respectto Γ if CE contains DE and the circuit formed by joining two copies of DE with a NAND
gate. Remarkably, as we will show, if there is a scheme E that can compactly evaluate only
these two circuits, then there is a scheme that is leveled fully homomorphic.
Remark 4.1.4. We could relax the bootstrappability definition slightly to say that E only
needs to be able to homomorphically evaluate its (augmented) decryption circuit when
the input ciphertext is weakly encrypted, similar to the relaxation Recrypt0E above. But,
this makes the definition of bootstrappable more cumbersome; we will continue with thedefinition above, and remind the reader occasionally that the relaxation can be used.
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 E be bootstrappable with respect to a set of gates
Γ. For any integer d ≥ 1, we use E to construct a scheme E (d) = (KeyGenE (d) , EncryptE (d) ,EvaluateE (d) , DecryptE (d) ) that can handle all circuits of depth d with gates in Γ. Note thatin 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 thelevel of a wire in C, we mean the level of the gate for which the wire is an input. We use
the notation DE (Γ, δ) to refer to the set of circuits that equal a δ-depth circuit with gatesin Γ augmented by DE (copies of DE become inputs to the δ-depth circuit).
KeyGenE (d) (λ, d). Takes as input a security parameter λ and a positive integer d. For` = `(λ) as in Definition 4.1.2, it setsR(ski , pki ) ← KeyGenE (λ)

for i ∈ [0, d]R

for i ∈ [1, d], j ∈ [1, `]skij ← EncryptE (pki−1 , skij )CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

47

where ski1 , . . . , ski` is the representation of ski as elements of P. It outputs the secret key
sk(d) ← sk0 and the public key pk(d) ← (hpki i, hskij i). Let E (δ) refer to the sub-system thatuses sk(δ) ← sk0 and pk(δ) ← (hpki ii∈[0,δ] , hskij ii∈[1,δ] ) for δ ≤ d.
EncryptE (d) (pk(d) , π). Takes as input a public key pk(d) and a plaintext π ∈ P. It outputs aR

ciphertext ψ ← EncryptE (pkd , π).
DecryptE (d) (sk(d) , ψ). Takes as input a secret key sk(d) and a ciphertext ψ (which should be
an encryption under pk0 ). It outputs DecryptE (sk0 , ψ).
EvaluateE (δ) (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 ) ← AugmentE (δ) (pk(δ) , Cδ , Ψδ ).
†• Sets (Cδ−1 , Ψδ−1 ) ← ReduceE (δ−1) (pk(δ−1) , Cδ−1, Ψ†δ−1 ).

• Runs EvaluateE (δ−1) (pk(δ−1) , Cδ−1 , Ψδ−1 ).
AugmentE (δ) (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δ ). It augments Cδ with DE ; call the resulting circuit Cδ−1
. Let Ψ†δ−1 bethe tuple of ciphertexts formed by replacing each input ciphertext ψ ∈ Ψδ by the tuple
hhskδj i, hψj ii, where ψj ← WeakEncryptE (δ−1) (pk(δ−1) , ψj ) and the ψj ’s form the properly†
formatted representation of ψ as elements of P. It outputs (Cδ−1, Ψ†δ−1 ).

ReduceE (δ) (pk(δ) , Cδ† , Ψ†δ ). Takes as input a public key pk(δ) , a tuple of input ciphertextsΨ†δ (where each input ciphertext should be in the image of EncryptE (δ) ), and a circuit Cδ† ∈DE (Γ, δ + 1). It sets Cδ to be the sub-circuit of Cδ† consisting of the first δ levels. It sets(w)Ψδ to be the induced input ciphertexts of Cδ , where the ciphertext ψδassociated to wire

(w)
(w)
(w)
w at level δ is set to EvaluateE (pkδ , Cδ , Ψδ ), where Cδ is the sub-circuit of Cδ† with(w)
(w)
output wire w, and Ψδ are the input ciphertexts for Cδ . 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

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

48

encrypted under pkd . We are also given an encryption scheme E that compactly evaluates
circuits in DE (Γ).
Note that we have not assumed that E can evaluate gates in Γ; we have only assumed
it can evaluate gates in Γ that are augmented by the decryption circuit. So, our first stepis to augment Cd by placing copies of DE at the leaves of Cd (as in Augment), thereby††?
. Now, what are the input ciphertexts for our new circuit Cd−1
constructing Cd−1

Reconsider the algorithm Recrypt0E . In Recrypt0E , we begin with a ciphertext ψ1 encrypting π under pk1 for the single wire w, and an “empty” circuit C1 (since Recrypt0E 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 DE to obtain C2 ← DE . The input
ciphertexts Ψ2 to C2 included the encrypted secret key bits, and the weakly encrypted bitsof ψ1 . We then showed that the ciphertext generated by ψ2 ← EvaluateE (pk2 , C2 , Ψ2 ), whichis also associated to wire w, also encrypts π, but now under pk2 .
In the full scheme above, the ciphertexts that we associate to the decryption circuitthat was attached to wire w are analogous to the ones we used in Recrypt0E : 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 EvaluateE )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 (byassumption) E 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 associatedto 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.1.5. Previously, we said that Evaluate takes as input ciphertexts that are “fresh”
outputs of Encrypt. However, we note EvaluateE (δ) also operates correctly on ciphertexts
output by Evaluate. (For δ < d above, this is precisely what EvaluateE (δ) 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.

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

49

Theorem 4.2.1. Let E be bootstrappable with respect to a set of gates Γ. Then E (d) compactly evaluates all circuits of depth d with gates in Γ – i.e., if Γ is a universal set of gates,
the family E (d) is leveled fully homomorphic.
Proof. (Theorem 4.2.1) First, we define a convenient notation: let D(δ, w, C, Ψ) denotethe plaintext value for wire w in circuit C induced by the decryptions (under skδ ) of theciphertexts Ψ 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 thesingle ciphertext ψ ∈ Ψ associated to w. To prove correctness, it suffices to show that
D(d, wout , Cd , Ψd ) = D(0, wout , C0 , Ψ0 )(4.1)

for every output wire wout of C0 (at level 0).
†
First, when (Cδ−1, Ψ†δ−1 ) ← AugmentE (δ) (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δ , Ψδ ) ← ReduceE (δ) (pk(δ) , Cδ† , Ψ†δ ), we have D(δ, w, Cδ† , Ψ†δ ) = D(δ, w, Cδ , Ψδ )for any wire at level at most δ. This follows from the correctness of EvaluateE over circuitsin DE (Γ), and the fact that circuits Cδ† and Cδ are identical up to level δ.
From these two claims, Equation 4.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.2.1 implies the scheme
correctly evaluates boolean circuits up to depth d · m.
We need to check that the computational complexity of EvaluateE (d) is reasonable – e.g.,that recursive applications of Augment do not increase the effective circuit size exponentially.
Theorem 4.2.2. For a circuit C of depth at most d and size s (defined here as the numberof wires), the computational complexity of applying EvaluateE (d) to C is dominated by atmost s · ` · d applications of WeakEncryptE and at most s · d applications of EvaluateE tocircuits in DE (Γ), where ` is as in Definition 4.1.2.
Proof. (Theorem 4.2.2) 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CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

50

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 s0 · ` applications of Encryptand at most s0 applications of EvaluateE to circuits in DE (Γ), where s0 is the size of the
pre-processed circuit.
The complexity of AugmentE (δ) (pk(δ) , Cδ , Ψδ ) is dominated by replacing each ciphertextψ ∈ Ψδ by the ciphertexts hhskδj i, hψj ii; generating the hψj i’s involves |Wδ | · ` applicationsof WeakEncryptE , where Wδ is the set of wires at level δ. Summing over all δ, there are at
most s0 · ` applications of WeakEncryptE .
(w)

The complexity of ReduceE (δ) (pk(δ) , Cδ† , Ψ†δ ) is dominated by the evaluation of Cδ

foreach w ∈ Wδ , which involves |Wδ | applications of EvaluateE to circuits in DE (Γ). Summingover all δ, there are at most s0 such applications. The theorem follows.

Finally, assuming the semantic security of E, we prove the semantic security of E (d) .
Theorem 4.2.3. Let A be an algorithm that (t, ²)-breaks the semantic security of E (d) .
Then, there is an algorithm B that (t0 , ²0 )-breaks the semantic security of E for t0 ≈ t · ` and²0 ≥ ²/`(d + 1), for ` as in Definition 4.1.2.
Proof. (Theorem 4.2.3) Let (E)` be equivalent to E, but with plaintext space P ≤` , where
Encrypt(E)` involves up to ` invocations of E and a concatenation of the results. We use ahybrid argument to show that B (t00 , ²00 )-breaks the semantic security of (E)` for t00 ≈ t and²00 ≥ ²/(d + 1), from which the result follows.
For k ∈ [0, d], let Game k denote a game against E (d) in which everything is exactly asin the real-world game, except that for all i ∈ [1, k] the challenger sets
RR

(sk0i , pk0i ) ← KeyGenE (λ) and skij ← EncryptE (pki−1 , sk0ij )In other words, for i ∈ [1, k], skij is the encryption (under pki−1 ) of the j-th bit of arandom secret key sk0i unrelated to ski . Game d + 1 is identical to Game d, except thatthe 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 ² byassumption. Also, ²d+1 = 0, since the challenge is independent of b. Consequently, for someCHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

51k ∈ [0, d], it must hold that |²k − ²k+1 | ≥ ²/(d + 1); fix this value of k.
B uses A to break (E)` as follows. B receives from the challenger a public key pk.
B generates the secret and public values exactly as in Game k, except that it replaces its
R

original value of pkk with pk. Also, if k < d, it generates a dummy key pair (sk0k+1 , pk0k+1 ) ←KeyGenE (λ), sets π0 ← skk+1 and π1 ← sk0k+1 , and requests a challenge ciphertext (underRpk) encrypting either π0 , π1 ∈ P ` . The challenger generates β ← {0, 1} and sends a tuple ofciphertexts hψj i encrypting the bits hπβj i. B replaces its original tuple hsk(k+1)j i with thetuple hψj i. One can verify that the public values are generated exactly as in Game k + β.
B sends the public values to A.
R

Eventually, A requests a challenge ciphertext on π0 or π1 . B sets b ← {0, 1}. If k < d,RR

B sends the values ψj ← EncryptE (pkd , πbj ). If k = d, B generates random π ← P and asksRthe challenger for a challenge ciphertext on πb or π. The challenger generates β ← {0, 1}
and encrypts πb or π accordingly, and B forwards the challenge to A. A sends a bit b0 . B
sends bit β 0 ← b ⊕ b0 to the challenger. One can verify that the challenge is generated as inGame k + β.
Since B’s simulation has the same distribution as Game k + β, and the probability that
B outputs 0 is ²k+β . The result follows.

4.3

Fully Homomorphic Encryption from KDM-Secure Bootstrappable Encryption

The length of the public key in E (d) is proportional to d (the depth of the circuits that canbe evaluated). It would be preferable to have a construction E ∗ 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 E ∗ short: for E 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 E ∗ is correct: therecursive algorithm EvaluateE ∗ 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 ofencrypted secret keys allowed us to base the security of E (d) on E using a hybrid argument;

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

52

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.3.1. Canetti [27] proposed the acyclic, leveled approach as a way to remove
the need for KDM-security. Our initial approach had actually been to use E ∗ (with theself-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 E is
KDM-secure if all polynomial-time adversaries A have negligible advantage in the following
KDM-security game.
KDM-Security Game.
R

Setup(λ, n). The challenger sets (ski , pki ) ← KeyGen(λ) for i ∈ [0, n − 1] for integer n =Rpoly(λ). It chooses a random bit b ← {0, 1}. If b = 0, then for i ∈ [0, n − 1] and j ∈ [1, `],R

it sets skij ← EncryptE (pk(i−1) mod n , skij ), 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 A.
Challenge and Guess. Basically as in the semantic security game.
This definition of KDM-security is a restriction of the general setting [18, 68, 22], where
A can select multiple functions f , and request the encryption of f (sk0 , . . . , skn−1 ). However,when E is a bootstrappable encryption scheme, A can use the cycle of encrypted secret keys
in our game to generate the encryption of f (sk0 , . . . , skn−1 ) under any pki , as long as f canbe computed in polynomial time. Hence, we only need to consider our restricted setting[65]. We have the following theorem.
Theorem 4.3.2. Suppose E is KDM-secure and also bootstrappable with respect to a universal set of gates Γ. Then, E ∗ , obtained from E as described above (with the self-loop), issemantically secure (and fully homomorphic).
The theorem is a straightforward consequence of the fact that, from any loop of publickeys and encrypted secret keys that includes (pk0 , sk0 ), one can compute an encryption of

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

53

sk0 under pk0 . There does not seem to be any advantage in having pk∗ contain any cycleof 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 abootstrappable encryption scheme – indeed, one may view this as the essence of bootstrappability – we do not see any actual attack on a bootstrappable encryption scheme thatprovides a self-encrypted key.

4.4

Fully Homomorphic Encryption from Bootstrappable Encryption in the Random Oracle Model

Above, we constructed a fully homomorphic encryption E ∗ from a bootstrappable encryption scheme E basically by adding a “self-loop” – a E secret key sk encrypted under its
corresponding public key pk – to the E ∗ public key pk∗ . We showed that E ∗ should inherit
the semantic security of E, under the assumption that E 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 E ∗ is semantically secure without thisassumption?
Here we provide some evidence in the random oracle model. First, given a leveled fully†

homomorphic scheme E (d) and a hash function, we define an intermediate scheme E (d) .
†E (d) is the same as E (d) , except for the following. The public key includes a hash function
R

0

R

0

H : P ` → P ` . Also, in KeyGen, one generates r ← P ` , sets rj ← EncryptE (d) (pk(d) , rj )for j ∈ [1, `0 ], sets σ ← H(r) ? sk0 , and includes (hrj i, σ) in the public key. (Assume ? issome invertible operation such that a ? b would completely hide b ∈ P ` if a ∈ P ` were a†

one-time pad.) In other words, the E (d) public key includes some additional information:an encryption of the the secret key sk0 , where the encryption uses a hash function that willbe treated as a random oracle in the security analysis.
Next, we prove the following theorems.
†

Theorem 4.4.1. If E (d) is semantically secure, then E (d) is semantically secure in the
random oracle model.

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

54

Theorem 4.4.2. Suppose E is leveled circuit-private (in addition to being bootstrappable)††

and let E (d) and E ∗ be constructed from E as described above. Then, if E (d) is semanticallysecure (in the plain model), and the circuit required to compute the hash function H andinvert the ? operation is at most d levels, then E ∗ is semantically secure.
The result here should be quite surprising. The scheme E ∗ does not even contain a hashfunction, 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, eventhough the second scheme does not use a hash function.
How is this possible? First, let us consider Theorem 4.4.1. This theorem basicallyjust states the previously known result [18] 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, suchthat 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, E (d) has a loop among (sk0 , pk0 ), . . . , (skd , pkd ), because†

E (d) reveals direct encryptions of ski under pki−1 for i ∈ [1, d], and E (d) also reveals anindirect encryption (hrj i, σ) of sk0 under pkd (“indirect,” because encryption in E does notnormally use a hash function). However, the reduction algorithm in the proof of Theorem
4.4.1 will construct σ simply as a random string – i.e., it does not actually need to know
anything about sk0 .
Theorem 4.4.2 is perhaps the more surprising result. But the result is actually a simple†

consequence of the fact that: given a correctly constructed E (d) public key, the reduction
algorithm can generate an E-encryption of sk0 under pk0 , as needed for the E ∗ public
key. How do we generate the latter ciphertext? The reduction algorithm is given hrj i,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 theciphertext 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 thanwith the hash function. We assumed that the hash function H and the ? operation can becomputed with a circuit of depth at most d; therefore, our leveled homomorphic scheme E (d)has enough levels to evaluate this circuit. Consequently, we obtain a “natural” encryptionof sk0 (i.e., under E) under some public key pki for i ≥ 0, and we can use Recrypt operations

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

55

to obtain a natural encryption of sk0 under pk0 . This ciphertext is an output of EvaluateE ,but circuit privacy guarantees that the ciphertext is distributed as if it were output directly
by EncryptE .
Remark 4.4.3. Although one can view (hrj i, σ) 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 DE . In particular, we cannot assume that its decryption
circuit is in CE . 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 E ∗ 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 [28]. A bit more specifically,
however, the obstacle is that the proof of Theorem 4.4.2 depends crucially on the correctness†of the ciphertext (hrj i, σ) in E (d) to construct (homomorphically) an encryption of sk0 under
pk0 as needed for the E ∗ public key; however, in the proof of Theorem 4.4.1 the ciphertext
is not correct (except with negligible probability): the adversary finds out that it was fakeonly after it has queried r to the random oracle, giving the reduction all the information it
needs.
†

Proof. (Theorem 4.4.1) Let A be an algorithm that attacks the semantic security of E (d) ;from A, we construct an algorithm B that attacks the semantic security of E (d) . B will
actually request `0 + 1 challenge ciphertexts; thus, the reduction loses a factor of `0 + 1
under the usual hybrid argument.
R

The challenger gives B a E (d) public key. It also sets a bit b ← {0, 1}. B selects
R0

two messages r(0) , r(1) ∈ P ` and sends them to the challenger. The challenger sets Ψ ←(b){Encrypt(pkd , rj ) : j ∈ [1, `0 ]} and sends back Ψ. The following is included in the public
key that B sends to A: the public key for E (d) sent by the challenger, the set of ciphertextsRΨ, and σ ← P ` .
A requests a challenge ciphertext on one π0 , π1 ∈ P. B forwards the query to thechallenger, who responds with a ciphertext encrypting πb , which B forwards to A.
Eventually, either A queries some r0 ∈ {r(0) , r(1) } to the random oracle, or A finishes0with a guess b0 . In the former case, B sets b0 so that r0 = r(b ) . In either case, B sends b0 as
its guess to the challenger.

CHAPTER 4. BOOTSTRAPPABLE ENCRYPTION

56

Let p be the probability that A queries some r0 ∈ {r(0) , r(1) } to the random oracle. B’ssimulation appears perfect to A if it does not query some r0 ∈ {r(0) , r(1) }; in this case, which
occurs with probability 1 − p, A’s advantage is at least ². Since A’s view is independent0of r(1−b) , the probability that it queries r(b) to the random oracle is at least p − qH /|P|` ,where qH is the number of random oracle queries make by A. Overall B’s advantage in00

guessing b0 is at least (1 − p)² + p − qH /|P|` ≥ ² − qH /|P|` .

Proof. (Theorem 4.4.2) The proof is essentially a simple consequence of the fact that, given†a public key for E (d) , it is easy to generate the public key for E ∗ homomorphically.
Let A be an algorithm that breaks the semantic security of E ∗ . We use A to construct†

an algorithm B that breaks the semantic security of E (d) .
†B receives a E (d) public key from the challenger. This public key consists of hpki ii∈[0,δ] ,hskij ii∈[1,δ] , hrj ij∈[1,`0 ] , and σ = H(r) ? sk0 . From hrj i, B uses the homomorphism of E (d) tocompute 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 σ (invertingthe ? 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 canperform Recrypt operations until we have the desired encryption of sk0 under pk0 . By circuit
privacy, this ciphertext is distributed properly. B includes the encryption of sk0 under pk0
as the encrypted secret key contained in the public key for E ∗ that it provides to A.
A requests a challenge ciphertext on one π0 , π1 ∈ P. B forwards the query to thechallenger, who responds with a ciphertext encrypting πb . B uses Recrypt operations to
obtain an encryption of πb under pk0 and forwards the result to A. A sends a guess b0 ,which B forwards to the challenger.
Clearly, B’s advantage is the same as A’s.

Chapter 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, “plussome.” 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 ofbootstrapability gives us a different way of attacking the problem – by minimizing thecomplexity of the scheme’s decryption circuit.
Our strategy for minimizing the circuit complexity of decryption is to construct ourscheme using ideal lattices, since decryption in lattice-based cryptosystems is typically dominated by a simple operation, such as an easily parallelizable matrix-vector multiplication(in contrast to, say, RSA, where decryption involves exponentiation, an operation not even
known to be in NC). We begin describing the ideal-lattice-based scheme in Chapter 7, after
providing some basic background on ideal lattices in Chapter 6.
In this Chapter, we describe our strategy for maximizing the “evaluative capacity” ofthe 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 techniquesfrom server-aided cryptography to “squash the decryption circuit” – maybe applicable toschemes that use different underlying mathematics – e.g., linear codes, or something lesssimilar to lattices.
57

CHAPTER 5. AN ABSTRACT SCHEME BASED ON THE IDEAL COSET PROBLEM58

5.1

The Ideal Coset Problem

We saw in Chapter 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 [44], the public key consists of some multivariate polynomials that generate the ideal I of polynomials having a common root x, and π is encrypted by outputtingRa sample ψ ← π + 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.
Since we will ultimately use 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 ∈ Rn ,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 thata ring R is an algebraic object that is closed under addition ‘+’ and multiplication ‘×’ andadditive inverse, with an additive identity ‘0’ and multiplicative identity ‘1’. An ideal I ofa 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 = Z, 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.1 (Ideal Coset Problem (ICP)). Fix R, BI , algorithm IdealGen, and an alRRpk
gorithm Samp1 that efficiently samples R. The challenger sets b ← {0, 1} and (Bsk
J , BJ ) ←R

IdealGen(R, BI ). If b = 0, it sets r ← Samp1 (R) and t ← r mod Bpk
J . If b = 1, it samples t
pk
uniformly from R mod Bpk
J . The problem: guess b given (t, BJ ).

Basically the ICP asks one to decide whether t is uniform modulo J, or whether it waschosen according to a known “clumpier” distribution induced by Samp1 . Of course, theICP will be impossible if Samp1 also samples uniformly modulo J, but the security of ourencryption scheme will rely on the ICP being hard for a “clumpier” 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.

CHAPTER 5. AN ABSTRACT SCHEME BASED ON THE IDEAL COSET PROBLEM59

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 E, 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, andsk
an algorithm IdealGen(R, BI ) that outputs public and secret bases Bpk
J and BJ 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 uniqueand 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 tothe particular basis BM of M . We also use an algorithm Samp(BI , x) that samples fromthe 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.
R

pk
KeyGen(R, BI ). Takes as input a ring R and basis BI of I. It sets (Bsk
J , BJ ) ← IdealGen(R, BI ).

The plaintext space P is (a subset of) R mod BI . The public key pk includes R, BI , Bpk
J ,and Samp. The secret key sk also includes Bsk
J .
Encrypt(pk, π). Takes as input the public key pk and plaintext π ∈ P. It sets ψ 0 ←Samp(BI , π) and outputs ψ ← ψ 0 mod Bpk
J .
Decrypt(sk, ψ). Takes as input the secret key sk and a ciphertext ψ. It outputs
π ← (ψ mod Bsk
J ) mod BI
Evaluate(pk, C, Ψ). Takes as input the public key pk, a circuit C in some permitted set CEof 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 CE when we consider correctness below. If desired, one could use different
arithmetic gates.)Add(pk, ψ1 , ψ2 ). Outputs ψ1 + ψ2 mod Bpk
J .
Mult(pk, ψ1 , ψ2 ). Outputs ψ1 × ψ2 mod Bpk
J .

CHAPTER 5. AN ABSTRACT SCHEME BASED ON THE IDEAL COSET PROBLEM60

sk
Remark 5.2.1. Concerning IdealGen, it is fine if the secret basis Bsk
J defines a lattice L(BJ )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 theciphertexts; this circuit uses the ring operations (not modulo I).
Definition 5.2.2 (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 withaddition ‘+’ and multiplication ‘×’ in the ring R.
Here are a few more definitions relevant to Theorem 5.2.6 below, which concerns correctness.
Definition 5.2.3 (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 Bsk
J , the set of distinguishedrepresentatives of cosets of J wrt the secret basis Bsk
J .
Definition 5.2.4 (Permitted Circuits). Let
CE 0 = {C : ∀(x1 , . . . , xt ) ∈ XEnc t , g(C)(x1 , . . . , xt ) ∈ XDec }In other words, CE 0 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 CE ⊆ CE 0 , wesay that CE is a set of permitted circuits.
Definition 5.2.5 (Valid Ciphertext). ψ is a valid ciphertext wrt E public key pk andpermitted circuits CE if it equals Evaluate(pk, C, Ψ) for some C ∈ CE , where each ψ ∈ Ψ isin 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 CE .
Theorem 5.2.6. Assume CE is a set of permitted circuits containing the identity circuit.
E is correct for CE – i.e., Decrypt correctly decrypts valid ciphertexts.

CHAPTER 5. AN ABSTRACT SCHEME BASED ON THE IDEAL COSET PROBLEM61

Proof. For ciphertexts Ψ = {ψ1 , . . . , ψt }, ψk = πk + ik + jk , where πk ∈ P, ik ∈ I, jk ∈ J,
and πk + ik ∈ XEnc , we have
Evaluate(pk, C, Ψ) = g(C)(Ψ) mod Bpk
J ∈ g(C)(π1 + i1 , . . . , πt + it ) + J
If C ∈ CE , we have g(C)(XEnc , . . . , XEnc ) ∈ XDec and therefore
Decrypt(sk, Evaluate(pk, C, Ψ)) = g(C)(π1 + i1 , . . . , πt + it ) mod BI= g(C)(π1 , . . . , πt ) mod BI= C(π1 , . . . , πt )as required.

The bottom line is that we have proven that E is correct for permitted circuits, and ourgoal 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 EncryptE . When we
begin to instantiate the abstract scheme with lattices and give geometric interpretations of
XEnc and XDec , the problem of maximizing CE will have a geometric flavor.
Again, we note the rather confusing fact that C “automatically” reduces the resultmodulo 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 thecomputation. 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 thesense that they are emulated (without any intermediate reduction steps) by the usual ring
operations.

CHAPTER 5. AN ABSTRACT SCHEME BASED ON THE IDEAL COSET PROBLEM62

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.
R

Samp(BI , x). Run r ← Samp1 (R). Output x + r × s.
Obviously, the output is in x + I since s ∈ I.
Theorem 5.3.1. Suppose that there is an algorithm A that breaks the semantic security of
E with advantage ² when it uses Samp. Then, there is an algorithm B, running in about thesame time as A, that solves the ICP with advantage ²/2.
Proof. The challenger sends B a ICP instance (t, Bpk
J ). B sets s, and sets the other components of pk in the obvious way using the ICP instance. When A requests a challenge cipherR

text on one of π0 , π1 ∈ P, B sets a bit β ← {0, 1} and sends back ψ ← πβ + t × s mod Bpk
J .
A sends back a guess β 0 , and B guesses b0 ← β ⊕ β 0 .
If b = 0, we claim that B’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 Bpk
J ; the ciphertext isthus well-formed. In this case A should have advantage ², which translates into an advantageof ² for B.
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 Bpk
J that is independent of β. In this case A’s advantage is 0. Overall,
B’s advantage is ²/2.

Chapter 6

Background on Ideal Lattices I:
The Basics
From the abstract construction in Chapter 5, among the objects that we need to makeconcrete 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 Chapter, we provide somebasic 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 R denote the real numbers, and Z the integers. We write vectors in column form usingbold lower-case letters, e.g. v; We write matrices as bold capital letters, e.g., B; bi is theith column. We use kvk to denote the Euclidean length of a vector v. For matrix B, we
use kBk to denote the length of the longest column vector in B.
An n-dimensional lattice of rank k ≤ n isno
L = L(B) = Bc : c ∈ Zk , B ∈ Rn×k
where the k columns b1 , . . . , bk ∈ Rn of the basis are linearly independent. All lattices inthis paper are full rank – i.e., k = n. Usually lattices in this paper are sub-lattices of Zn –i.e., the lattice vectors have integer coefficients.
Every lattice has an infinite number of lattice bases. If B1 and B2 are two lattice63

CHAPTER 6. BACKGROUND ON IDEAL LATTICES I: THE BASICS

64

bases of L, then there is some matrix U that is unimodular (i.e., U has integer entries anddet(U) = ±1) satisfying B1 · U = B2 . Since U is unimodular, | det(Bi )| is invariant fordifferent bases of L. Since it is invariant, we may refer to det(L). This value is precisely
the size of the quotient group Zn /L if L is an integer lattice.
To basis B of lattice L we associate the half-open parallelepiped P(B) ← {Pn

i=1 xi bi :xi ∈ [−1/2, 1/2)}. The volume of P(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.
Q
Of course, for any basis B = {b1 , . . . , bn }, it must hold that ni=1 kbi k ≥ det(L); roughly
speaking, good bases come closer to reaching equality than bad ones.
For t ∈ Rn , we use t mod B to denote the unique vector t0 ∈ P(B) such that t − t0 ∈ L.
Given t and B, t mod B can be computed efficiently as t − B · bB−1 · te, where b·e rounds
the coefficients of a vector to the nearest integer. Let dist(L, t) denote minv∈L {kt − vk}.
Clearly, for any basis B, kt mod Bk ≥ 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 kBk). Thus, HNF(L) does not “reveal” more about L’s structure thanany other basis, making HNF(L) a good choice for the public lattice basis to be included
in a public key [97].
The dual lattice of L, denoted L∗ , is defined as L∗ = {x ∈ span(L) : ∀v ∈ L, hx, vi ∈ Z}.
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 leasti linearly independent vectors of norm at most r. In particular λ1 (L) is the length of theshortest 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) andclosest vector problem (CVP). Here are their approximate versions.
Definition 6.1.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.1.2 (γ(n)-Closest Vector Problem (CVP)). Given a basis for a lattice L of
dimension n and a vector t ∈ Rn , output a nonzero vector v ∈ L such that kt − vk ≤γ(n) · dist(L, t).

CHAPTER 6. BACKGROUND ON IDEAL LATTICES I: THE BASICS

65

A close variant of the SVP is the shortest independent vector problem (SIVP), defined
as follows.
Definition 6.1.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 muchcloser than any other – e.g., by a factor of γ(n).
Definition 6.1.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 thelattice L, and that in fact the solution v is unique. The solution is unique, since if kt − vk <λ1 (L)/(γ(n)+1), then kt−wk ≥ kv−wk−kt−vk > λ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 ourformulation) 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. [81] orBabai’s nearest plane algorithm [13]; these algorithms only work for essentially-exponential(e.g., 2O(n(log log n)/ log n) [5]) approximation factors. As a rough rule of thumb, approximating these lattice problems to within a factor of 2k takes time about 2n/k , using known
algorithms [123].

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. [69],1 though the connection to lattices was made explicit later incryptanalysis [34, 93, 47]. None of this cryptanalysis has broken the core average-caseproblem underlying the scheme. NTRU’s main selling point is efficiency; encryption and1
Strictly speaking, NTRU’s lattice has a 2n × 2n basis, where each n × n quadrant generates an ideal
lattice.

CHAPTER 6. BACKGROUND ON IDEAL LATTICES I: THE BASICS

66

decryption very fast – much faster than RSA, for example – since the operations involved
are simple (multiplications in the ring Zq [x]/(xn − 1) for small integer q), and since n canbe reasonably small (several hundreds) since the best known lattice attacks on NTRU taketime essentially exponential in n.
Recent cryptography involving ideal lattices [98, 111, 112, 88, 99] 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.
Our construction will use the polynomial ring R = Z[x]/(f (x)), where f (x) is a monicpolynomial of degree n. We view an element v ∈ R both as a ring element and as a vector –specifically, the coefficient vector v ∈ Zn . The ideal (v) generated by v directly corresponds
to the lattice generated by the column vectors {vi ← v × xi mod f (x) : i ∈ [0, n − 1]}; wecall this the rotation basis of the ideal lattice (v). Specifically, any w ∈ (v) is in the latticegenerated by the rotation basis {vi }, since there must be some a for which w = v × a, andPPthen w = i ai vi . Conversely, if w is in the lattice generated by {vi }, then w = i ai viPfor some integers {ai }, which implies that w = v × a in the ring R, where a = i ai · xi . In
general, the rotation basis for the product of two elements a, b ∈ Q[x]/(f (x)) is the rotationbasis of a × b. Also the matrix-vector product of a rotation basis a with the vector b is thevector 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 byv 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, thevectors 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 Q[x]/(f (x)). In this case, to avoid complications, we assume f (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 ∈ Q[x]/(f (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).

CHAPTER 6. BACKGROUND ON IDEAL LATTICES I: THE BASICS

67

For principal ideal (v), the fractional ideal (v)−1 is generated by 1/v, where the inverse isin Q[x]/(f (x)). The determinant associated to the ideal lattice for (v) (we may occasionallyrefer to this determinant as the norm of the ideal, denoted Nm(I)) is the inverse of thedeterminant 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 arecalled monogenic number rings, or simple algebraic extensions, because they are isomorphic
to Z[α] where α is a root of f (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 anumber field. A number field is a finite extension K = Q(α) of the rationals Q, isomorphic
to Q[x]/(f (x)) for some polynomial f (x) irreducible over Q for which f (α) = 0. The ringof integers of a number field K is:
OK = {x ∈ K : fQx ∈ Z[x]} , where fQx is the (monic) minimal polynomial of x in Q[x]While it may not be immediately obvious that OK is even a ring, OQ(α) generally has better
algebraic properties than Z[α], 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 OK are “invertible”– i.e., I −1 · I = OK when the inverse I −1 is taken in OK ; this is not necessary true inZ[α], where I −1 · I may be a subset of R if Nm(I) is divisible by one of a small numberof singular primes whose squares divide the discriminant ∆(f ) of f (x) [127]. Peikert andRosen [112] show that ideal lattices associated to the ring of integers in fields with verysmall 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 Z[α] 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 Z[α].
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 Z[x]/(xn − 1). Asidefrom efficiency, this choice in some sense maximizes the multiplicative depth of circuits that
our scheme can evaluate, since one can bound the Euclidean length ku×vk by γMult (R)·kuk·CHAPTER 6. BACKGROUND ON IDEAL LATTICES I: THE BASICS

kvk for γMult (R) =68√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 thisring may be weaker than others. One fairly obvious attack by Gentry [47] works when n
is composite; essentially, it reduces a lattice problem over Z[x]/(xcm − 1) to a much more
tractable m-dimensional lattice problem over Z[x]/(xm − 1) for small constant c. Generally,
one would prefer f (x) to be irreducible. Even when n is prime, Gentry and Szydlo [50] gavean algorithm that can be adapted to take an n-dimensional basis of a principal ideal lattice
I of R = Z[x]/(xn − 1), and construct a (n + 1)/2-dimensional lattice basis that contains√
at least one nonzero I-vector of length at most 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 Z[x]/(xn − 1). If one simply takes n prime and (easily) avoids ideals withorthonormal bases, the Gentry-Szydlo attack only gives an attack whose running time isat best square root of the original time of attack, which is fine (in principle) if the originaltime of attack is super-polynomial.

6.3

Probability BackgroundA family H of hash functions from X to Y , both finite sets, is said to be 2-universal if
Pr R [h(x) = h(x0 )] = 1/|Y | for all distinct x, x0 ∈ X. A distribution D is ²-uniformh←H

if its statistical distance from the uniform distribution is at most ², where the statisticalP
difference between two distributions D1 , D2 is 21 x∈X |D1 (x) − D2 (x)|.
Lemma 6.3.1 (Leftover Hash Lemma [72]). Let H be a family of 2-universal hash functions
R

R

from X to Y . Suppose that h ← H and x ← X are chosen uniformly and independently.
pThen, (h, h(x)) is 12 |Y |/|X|-uniform over H × Y .

Chapter 7

A Somewhat Homomorphic
Encryption Scheme
7.1

Why Lattices?

To bootstrap our new notion of bootstrappability, we ask a natural question: where do wefind encryption schemes that have decryption algorithms with low circuit complexity?
We note that this is not an essential question. Conceivably, E could be tailored so thatit evaluates only its (augmented) decryption circuits DE (Γ), or very few gates outside ofthis small set, even though its decryption circuit is “complex” [58]. 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 factoringor variants of Diffie-Hellman, even though there are several homomorphic schemes here –RSA [121], Goldwasser-Micali [61], ElGamal [42], Paillier [110], Boneh-Goh-Nissim [21], 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 theseschemes, 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 donot 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, the dominantdecryption operation is typically an inner product or matrix-vector multiplication, which is69

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

70

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 schemesthat can evaluate circuits in NC1. In fact, unless one wants circuit privacy (as in SandersYoung-Yung [122]), “evaluating” circuits of logarithmic depth is completely trivial: one
simply outputs the circuit and the “unprocessed” input ciphertexts. So, why is it nottrivial to construct a bootstrappable encryption scheme from a lattice-based scheme thathas 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 havea multiplicative structure that will enable us to evaluate deep arithmetic circuits (though
we will need more tricks before we ultimately obtain a bootstrappable scheme).

7.3

A Geometric Approach to Maximizing the Circuit Depththat Can Be Evaluated

In Section 5, where we described the abstract scheme, we saw that E correctly evaluates
circuit C if the generalized circuit g(C) satisfies g(C)(x1 , . . . , xt ) ∈ XDec for all (x1 , . . . , xt ) ∈XEnc t . For example, it correctly evaluates the gate AddBI if XEnc + XEnc ⊆ XDec , and thegate 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 thatlattices permit a clean analysis of XEnc and XDec in terms of Euclidean length. When weCHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

71

implement the abstract scheme using a polynomial ring Z[x]/(f (x)) and ideal lattices assummarized above, the sets XEnc and XDec become subsets of Zn . We re-characterize thesesets geometrically as follows.
Definition 7.3.1 (rEnc and rDec ). Let rEnc be the smallest value such that XEnc ⊆ B(rEnc ),where B(r) is the ball of radius r. Let rDec be the largest such that XDec ⊇ B(rDec ).
Now, let us define a set of permitted circuits CE as follows:
CE = {C : ∀(x1 , . . . , xt ) ∈ B(rEnc )t , g(C)(x1 , . . . , xt ) ∈ B(rDec )}CE is defined like the maximal set CE 0 of permitted circuits in Definition 5.2.4, but we have
replaced XEnc and XDec with B(rEnc ) and B(rDec ). Clearly, CE ⊆ CE 0 . (At several points
later in the paper, we narrow our set of permitted circuits again so as to enable a lesscomplex decryption algorithm.)
For fixed values of rEnc and rDec , what is CE ? This is a geometric problem, and we
can bound the Euclidean length kg(C)(x1 , . . . , xt )k by bounding the lengths of ku + vk
and ku × vk in terms of kuk and kvk. For addition, this is easy: using the triangle
inequality, we have ku + vk ≤ kuk + kvk for u, v ∈ R. For multiplication, we can provethat ku × vk ≤ γMult (R) · kuk · kvk, where γMult (R) is some factor that is dependent only
on the ring R. (See [89] for a different definition of the expansion factor for multiplication.)
The following theorem characterizes the “error expansion” that a circuit can cause basedon the circuit’s depth.
Theorem 7.3.2. Suppose rE ≥ 1 and that circuit C’s additive fan-in is γMult (R), multiplicative fan-in is 2, and depth is at mostlog log rD − log log(γMult (R) · rE )Then, C(x1 , . . . , xt ) ∈ B(rD ) for all x1 , . . . , xt ∈ B(rE ).
In particular, E 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 kvk ≤ γMult (R) · ri . A multiplication gate at level i

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

72

outputs some v ∈ R such that kvk ≤ γMult (R) · ri2 . In either case, ri−1 ≤ γMult (R) · ri2 , anddthus r0 ≤ (γMult (R) · rE )2 . The result follows.

An (oversimplified) bottom line from Theorem 7.3.2 is that, to maximize the depth ofcircuits that E can correctly evaluate (see Theorem 5.2.6), we should minimize γMult (R) andrEnc , 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.3.2, it seems important to set f (x) so that R = Z[x]/(f (x)) has a reasonably small value of γMult (R). (Recall that γMult (R) is a value such that ku × vk ≤γMult (R) · kuk × kvk.) The following results show that there are many f (x) for which theassociated γMult (R) is only polynomial in n. Lyubashevsky and Micciancio [89] actually
already have results of a similar flavor to those in this Section in a full version of a paperusing ideal lattices for hash functions [89], for a definition of “expansion factor” (analogous
to our γMult (R)) that is a bit more cumbersome to generalize to high-degree products.
Theorem 7.4.1. Let f (x) be a monic polynomial of degree n. Let F (x) = xn · f (1/x) andg(x) = F (x)−1 mod xn−1 . Then, ku × vk ≤ γMult (R) · kuk · kvk for someγMult (R) ≤√2n · (1 + 2n · kf k · kgk)

Proof. (Theorem 7.4.1) Let t(x) ← u(x) · v(x) be the (unreduced) degree 2n − 2 product ofu and v. Let t(x) = q(x)f (x) + r(x), where r(x) = t(x) mod f (x) is a polynomial of degreen − 1, and q(x) is a polynomial of degree n − 2. We have ku × vk = krk, 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 kuk · kvk; overall, ktk ≤ 2n · kuk · kvk.
Let T (x) = x2n−2 t(1/x), Q(x) = xn−2 q(1/x), and R(x) = x2n−2 r(1/x). Then, T (x) =Q(x)F (x) + R(x), where T, Q, F are all integer polynomials with the same degrees andnorms as t, q, f . R, which has the same norm as r, is divisible by xn−1 , implying that

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

73

Q(x) = T (x)g(x) mod xn−1 . Since Q(x) has degree n − 2, this equation implies kQk ≤√2n · kT k · kgk. We haveku × vk = krk = kRk ≤ kT k + kQ · F k√≤ kT k + 2n · kQk · kF k
≤ kT k + 2n · kT k · kgk · kF k
= ktk · (1 + 2n · kf k · kgk)√
≤ kuk · kvk · 2n · (1 + 2n · kf k · kgk)

as required.

To find a suitable ring R = Z[x]/(f (x)) for which γMult (R) is small, it suffices to find an
f (x) for which both F (x) and F (x)−1 mod xn−1 have small norms, where F (x) = xn ·f (1/x).
This gives us a lot of freedom in choosing f (x).
For example, we can sample f (x) from the large class of polynomials such that f (x) has
small norm and f (x) = xn − h(x) where h(x) is a polynomial of degree at most (n + 1)/2.
√
In this case, for R = Z[x]/(f (x)), one can prove that γMult (R) ≤ 2n · (1 + 2n · kf k2 ). One
can generalize this to the case that h(x) has degree at most n − (n − 1)/k for k > 2.
Theorem 7.4.2. Suppose f (x) = xn − h(x) where h(x) has degree at most n − (n − 1)/k forp√
k ≥ 2. Then, for R = Z[x]/(f (x)), it holds that γMult (R) ≤ 2n·(1+2n·( (k − 1)nkf k)k ).
Proof. Let F (x) = xn · f (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)) =(1 − (H(x))k )/(1 − H(x)) mod xn−1 , and we have:kg(x)k ≤ 1 + kHk + · · · + kH k−1 k≤ 1 + kHk + · · · + ((k − 1)n)(k−1)/2 kHkk−1≤ 1 + kf k + · · · + ((k − 1)n)(k−1)/2 kf kk−1
´ ³p
´
³p
≤
( (k − 1)nkf k)k − 1 / ( (k − 1)nkf k) − 1

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

74

p
p
√
Since kf k < ( (k − 1)nkf k) − 1, we have γMult (R) ≤ 2n · (1 + 2n · ( (k − 1)nkf k)k ).

Undoubtedly there are suitable f (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 andbi = (1−xri si )/(1−xri ) for some {ri }, {si } where ri ·si ≥ n−1 and ri < n−1. Then, for each i,ai bi = 1 mod xn−1 (nontrivially) and kai k and kbi k are both quite small. We could set F (x)Qand g(x) by picking a random subset S ⊆ {1, . . . , k} and setting F (x) ← i∈S ai mod xn−1
Q
and g(x) ← i∈S bi 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 messierthan the approach above; the point here is that the approach above is not the only approach.
A simple case is to set f (x) ← xn − 1. For the ring R = Z[x]/(xn − 1), it is easy to show√that γMult (R) ≤ n.
Lemma 7.4.3. Suppose x, y ∈ R = Z[x]/(xn − 1), and let z ← x × y. Then kzk ≤√n · kxk · kyk.
Proof. Consider the i-th coefficient zi of z; we havezi =X

xj · yi−j mod nj

In particular, since zi is an inner product of (rotated versions of) x and y, we have that|zi | ≤ kxk · kyk (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 thisparticular ring.
We also prefer f (x) to be irreducible, so that K = Q(x)/(f (x)) is a field. In this case,Z[x]/(f (x)) inherits the nice properties of its overlying ring of integers OK , with somequalifications. (See Section 6.) Using irreducible f (x) also seems to make R less vulnerable
to cryptanalytic attacks, such as that in [47]. If desired, we can get many of the benefitsof using Z[x]/(xn − 1) by instead using Z[x]/(f (x)) for f (x) = (xn − 1)/(x − 1), which isirreducible when n is prime.

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

7.5

75

Instantiating Encrypt and Minimizing rEnc

From Theorem 7.3.2, we would like to set rEnc to be as small as possible, consistent withsecurity. Recall that XEnc ⊆ B(rEnc ) is the image of the Samp algorithm used in Encrypt,
where our security proof (Theorem 5.3.1) holds when Samp(BI , x) runs r ← Samp1 (R) andoutputs x + r × s, where s is a generator of the ideal I. Let `Samp1 be an upper bound on
the length of r, drawn according to Samp1 . We haverEnc = max{kx + r × sk} ≤ n · kBI k +√n · `Samp1 · kBI k

Toward minimizing rEnc , we can choose s to be short – e.g., use s = 2 · e1 .
The size of `Samp1 is a security issue. We need it to be large enough so that the minentropy of t mod Bpk
J in the ICP is large. As a concrete example, one could set `Samp1 = n,
and have Samp1 sample a uniformly random integer vector in B(`Samp1 ).
Overall, we can take rEnc to be polynomial in n. We note that, even in this case, theplaintext 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 theHermite normal form will always hold when det(I) is prime.) This gives a plaintext spaceisomorphic to Zdet(I) , which may be more useful than the space Zn2 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. In Section 14.1, we discussa different way to instantiate Samp is using Gaussian distributions over lattices.

7.6

Instantiating Decrypt and Maximizing rDec

From Theorem 7.3.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 circumscribedby BskJ . Also, recall our decryption equation.
sk −1
π = ψ − Bsk· ψe mod BI
J · b(BJ )To maximize rDec , one strategy is simply to scale up the parallelepiped Bsk
J . But this does

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME76

not really buy us anything. For a fixed ratio rDec /rEnc , one can verify that our maximum
depth (per Theorem 7.3.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 theapproximation factor of the associated bounded distance decoding lattice problem, whichhurts security. See Section 7.7.) The important property of Bsk
J is its shape – i.e., we want
the parallelepiped P(BskJ ) to be “fat” enough to contain a large sphere. This property is−1easier to formalize in terms of the inverse matrix (Bsk
J ) , whose transpose is a basis (orindependent set) of the dual lattice L(Bsk
J ).
Lemma 7.6.1. Let B be a lattice basis and B∗ = (B−1 )T . Let r be the radius of thelargest sphere, centered at 0, circumscribed by P(B) (permitting tangential overlap). Then,r = 1/(2 · kB∗ k). In particular,−1 T
rDec = 1/(2 · k((BskJ ) ) k)Suppose ktk < rDec ; then each coefficient of B−1 · t has magnitude at most 1/2.
Proof. Suppose kxk < 1/(2 · kB∗ k). Each coefficient of B−1 · x is an inner product ofx with a column vector of B∗ , and therefore has magnitude at most kxk · kB∗ k < 1/2.
This implies that bB−1 · xe = 0, that x = (x mod B), and that x ∈ P(B). Now, suppose
kxk > 1/(2 · kB∗ k) and is parallel to the longest vector bi in B∗ . Then, |hbi , xi| > 1/2,
implying that bB−1 · xe =6 0, and that x 6= (x mod B), and that x ∈/ P(B).

The relevance of Lemma 7.6.1 is that the decryption equation above is correct when ψ−1 T
is at most rDec = 1/(2 · k((BskJ ) ) k) away from a lattice point in J.

It is easy to imagine ad hoc ways of instantiating IdealGen so that the parallelepipedP(BskJ ) is “fat” – i.e., contains a sphere whose radius is only polynomially shorter than theparallelepiped’s diameter. For example, one could generate a random vector v and simply
pk
set Bsk
J to be the rotation basis of v, and set BJ 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.6.2. Let t ≥ 4 · n · γMult (R) · s. Suppose v ∈ t · e1 + B(s) – i.e., v is in the ballof radius s centered at t · e1 . Let B be the rotation basis of v. Then, P(B) circumscribes a

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

77

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 kzi k = kz0 × xi k ≤γMult (R) · kz0 k ≤ γ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 P(B), there is an i such thata = (±1/2) · vi +X

xj · vj

j6=i

for xj ∈ [−1/2, 1/2]. So,|ha, ei i| ≥ t/2 − n · γMult (R) · s
In particular, kak ≥ t/2 − n · γMult (R) · s and the lemma follows.

Perhaps lattice problems over principal ideal lattices generated in the above ad hoc
fashion are easy, though currently no efficient attacks are known. A “better” instantiationof IdealGen, which permits a security reduction from worst-case SIVP, is given in Section
18.

7.7

Security of the Concrete Scheme

When instantiated with ideal lattices, the ideal coset problem (ICP) becomes the following
problem.
Definition 7.7.1 ((Decision) Bounded Distance Decoding Problem (Decision BDDP) for
Ideal Lattices). Fix a polynomial ring R = Z[x]/(f (x)), algorithm IdealGen that samples abasis of an ideal in R, and an algorithm Samp1 that efficiently samples Zn . The challenger
R

R

R

pk
sets b ← {0, 1} and (Bsk
J , BJ ) ← IdealGen(R, BI ). If b = 0, it sets r ← Samp1 (R) andpkt ← r mod Bpk
J . If b = 1, it samples t uniformly from R mod BJ . The problem: guess bgiven (t, Bpk
J ).
In short, the problem is to decide whether t is uniform modulo the ideal lattice J, orwhether t was sampled according to a known “clumpier” distribution induced by Samp1 .

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

78

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 sampledaccording 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 radiusn, or when r is sampled according to a discrete n-dimensional Gaussian distribution with√a standard deviation parameter s = ω( log n). We defer details regarding discrete Gaussian distributions until Section 13; for now, as a concrete example, let’s suppose that r is
sampled uniformly from a sphere of radius `Samp1 = 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 `Samp1 . In particular, if
λ1 (J)/`Samp1 ≥ 2n (and we could replace the rhs with a slightly sub-exponential value),then Babai’s nearest plane algorithm [13] or variants of the lattice reduction algorithm LLL[81] 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) < `Samp1 ; if dist(J, t) > `Samp1 , it is a certain bet that t was generated√

uniformly. However, there are no known attacks when, for example, λ1 (J) = 2O( n) (and`Samp1 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 theinduced decision BDDP.
In Section 7.5, we observed that rEnc is at most n · kBI k +√n · `Samp1 · kBI k, where

BI can be chosen so that kBI k is polynomial in n (or even constant). In short, we canhave rEnc only polynomially larger than `Samp1 . In Section 7.6, we observed that one caninstantiate IdealGen so that it outputs a secret basis Bsk
J for J such that, if rDec is theradius of the largest ball circumscribed by P(Bsk
J ), then rDec is only polynomially smaller
than λ1 (J). Overall, we can make rDec /rEnc be within a polynomial factor of λ1 (J)/`Samp1 ,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( n) and rEnc = poly(n) seems to be a reasonable setting ofccparameters. When rDec = 2n 1 and γMult (R) · rEnc = 2n 2 , then Theorems 5.2.6 and 7.3.2

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

79

imply that the scheme can correctly evaluate circuits of depth (c1 − c2 ) log n.
Remark 7.7.2. Setting rDec to be small permits a weaker assumption, but leads to ascheme 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
f (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 [50] have apolynomial-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 provide an alternative IdealGen algorithm in
Section 18, and provide a worst-case / average-case connection for IdealGen’s distribution
in Section 17.
We stress that our analysis below regarding the decryption circuit does not rely on thead 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.3.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 thatcwe can take rDec to be of the form 2n for some constant c < 1, and γMult (R) and rEnc to
be polynomial in n. In this case, we can evaluate logarithmic depth.

CHAPTER 7. A SOMEWHAT HOMOMORPHIC ENCRYPTION SCHEME

80

Already this is a significant improvement on prior work. For example, the Boneh-GohNissim (BGN) pairing-based cryptosystem [21] was the first to permit efficient evaluationof 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 [63] used their system to construct a perfectly NIZK system for general circuits(with length proportion to the size of the circuit). 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 schemewith communication complexity O(λ·log m), where λ is the security parameter and m is bitlength of the database s1 , . . . , sm . The querier encrypts the binary representation π1 , . . . , πMof the index that it wants, constructing the ciphertexts ψ1 , . . . , ψM , where M = blog mc + 1.
Homomorphically, the server homomorphically evaluates the formulaf (π1 , . . . , πM , s1 , . . . , sm ) =

X

st ·

t∈{0,1}MM
Y(ti − πi + 1) mod 2

j=1

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 haveoffsets in B(rEnc ), then the offset of the output is in B(r) for r = O(m · (γMult (R) ·√rEnc )M ) = O((2 · γMult (R) · rEnc )M ). If one permits rDec = 2θ( n) , then one can permit√
M = θ( 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 (superpolynomial) 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.

Chapter 8

Tweaks to the Somewhat
Homomorphic Scheme
At this point, we have described our somewhat homomorphic scheme in enough detail tobegin 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 canevaluate.
As the first tweak, we modify the secret key of our scheme so that the decryption
equation simplifies fromsk −1
π = ψ − Bsk· ψe mod BI
J · b(BJ )toπ = ψ − bvJsk × ψe 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 theinverse of an ideal lattice (a vector from which is used as the decryption key in our revised
decryption equation).

81

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

8.1

82

On the Relationship between the Dual and the Inverseof an Ideal Lattice

Recall the definition of the dual of an ideal lattice J: J ∗ = {x ∈ Rn : ∀v ∈ J, hx, vi ∈ Z}.
The inverse in R = Z[x]/(f (x)) of an ideal has a superficially similar definition: J −1 = {x ∈Q[x]/(f (x)) : ∀v ∈ J, x × v ∈ R}.
If BJ happens to be a rotation basis of J = (v), then the inverse J −1 = (1/v) isgenerated by the rotation basis of 1/v, the columns of B−1
J . However, the dual of J isgenerated by the inverse transpose of BJ . So it is certainly not true in general that theideal lattice associated to J −1 is generated by the dual of the ideal lattice associated to J.1
However, for rotation bases, since the bases of the dual and the inverse are just transposesof each other, we have the following easy lemma, which is analogous to Lemma 7.6.1.
√
Lemma 8.1.1. Let B be a rotation basis and B∗ be its inverse transpose. Then, kB∗ k· n ≥
√
√
sk −1
kB−1 k ≥ kB∗ k/ n. In particular, if Bsk
J is a rotation basis, we have 1/(2 n · k(BJ ) k) ≤√−1
rDec ≤ n/(2 · k(BskJ ) k).
Proof. Let bij be the highest-magnitude coefficient in the matrix B−1 . Then,√√kB−1 k ≥ bij ≥ kB∗ k/ n and kB∗ k ≥ bij ≥ kB−1 k/ nUsing Lemma 7.6.1, we have
√
√
−1
−1
n/(2 · k(Bsk
1/(2 n · k(BskJ ) k) ≤ rDec ≤J ) k)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 ashort basis of J −1 . The answer to both of these questions is yes.
Lemma 8.1.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
1

Contrary to what we stated in [48]. Lyubashevsky [87] indicated this error.

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

83

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.1.
The second question – i.e., whether one can generate a short basis of J −1 from a shortvector in J ∗ is more challenging, but we have the following lemma.
Lemma 8.1.2. Let w ∈ J ∗ , where J ∗ is the dual of the ideal lattice J. Let
v=

n−1
X
i=0

n
X

xi

fj · wj−i−1

j=i+1

Then, v ∈ J −1 . Let Bv be the rotation basis of v. Then, kBv k ≤√n · kf k · kwk. Thisapplies 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 basisof a vector in J −1 . Together, the vector w and the polynomial f (x) dictate what the restof the matrix must be.
Proof. We claim that the bottom row of Bv is (w0 , w1 , . . . , wn−1 ). In other words, in somesense, 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 f (x). We claim thatv(k) =

n−1
X
i=k

xi

n
X
j=i+1

fj · wj−i−1+k −

k−1
X
i=0

xi

i
X

fj · wj−i−1+kj=0from which it follows that the coefficient of xn−1 in v(k) is indeed wk . This is clearly true

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

84

for k = 0; assume it is true for k 0 − 1. We have that

v

(k0 )

n−1
X

= x

xi

i=k0 −1

=

=

n
X

i

x

j=i+1

fj · wj−i−1+k0

−

0 −1
kX

j=i

i=1

n
X

0 −1
kX

i

x

n
X

i

x

n
X

fj · wj−i−1+k0 −

j=i

i=1

n
X

0 −1
kX

fj · wj−i−1+k0 −

j=i

i

x

xi −fi · wk0 −1 +

n
X

i−1
X

−

i

x

i−1
X

fj · wj−i−1+k0 −1  mod f (x)j=0

fj · wj−i−1+k0 mod f (x)fj · wj−i−1+k0 − (fn · wk0 −1 ) · f (x)

j=0
i

x

i−1
X

fj · wj−i−1+k0 −

j=0



X

i

x

i=k0

n
X

n
X

xi · wk0 −1 · fi

i=0fj · wj−i−1+k0 xi fi · wk0 −1 +

i=1

=



j=i
k0 −1

n
X

xi

i
X

j=0

i=1



i=k0

0 −2
kX

i=0

n
X

i=k0

=

fj · wj−i−1+k0 −1 −

i=k0

i=k0

=

n
X

n
X

i−1
X


fj · wj−i−1+k0  − wk0 −1 · fi

j=0

fj · wj−i−1+k0 −

j=i+1

0 −1
kX

x

i=1

i

i
X

fj · wj−i−1+k0 − wk0 −1 · fi

j=0

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 thatthe 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 f (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 f (x) is monic,∗∗z(n−i −1) = xn−i −1 · z − a(x) · f (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 .

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

85

Regarding kBv k, we have established that each entry of this matrix is an inner productof two vectors – one vector with coefficients in {f0 , . . . , fn }, the other with coefficients in{w0 , . . . , wn−1 } (up to sign). The magnitude of each coefficient in Bv is therefore at most√
kf k · kwk, implying that kBv k ≤ n · kf k · kwk.

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 thesense that it is not always the case that J −1 · J = R. (See Section 13.4 for more details on
this.) But we bound the discrepancy in the following lemma.
Lemma 8.2.1. Let J be a (possibly fractional) ideal of R = Z[x]/(f (x)). Then, λn (J −1 ) ≤√n · kf k · λ1 (J ∗ ) ≤ n · kf k/λn (J). Also, det(J −1 ) < nn · kf kn / 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.1.2, and let Bv be its rotation basis. By Lemma 8.1.2, kBv k ≤ n · kf k ·√kwk. By the transference theorem λ1 (L) · λn (L∗ ) ≤ n for general lattices, we have√that kwk ≤ n/λn (J), which implies the first statement. Since det(J ∗ ) = 1/ det(J),√kwk ≤ n/ det(J)1/n by Minkowski, we have det(Bv ) ≤ nn · kf kn / det(J).
Using Lemma 8.2.1, we can upper bound λn (J) in terms of n, |f | and det(J).
Lemma 8.2.2. Let J be an ideal of R = Z[x]/(f (x)). Then, λn (J) < n · kf k · det(J)1/n .
Proof. We haveλn (J)≤ n · kf k/λn (J −1 ) (by Lemma 8.2.1)≤ n · kf k/ det(J −1 )1/n
≤ n · kf k · det(J)1/n

We have a similar result regarding the product of two general ideals (not necessarily
inverses of each other).

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

86

Lemma 8.2.3. Let J and K be two (possibly fractional) ideals of R. Then, λn (JK) <n · kf k(det(J) · det(K))1/n . Also, det(JK) ≤ nn · kf kn · det(J) · det(K).
Proof. This would follow trivially from Lemma 8.2.2, except that it is possible that det(J ·K) > det(J) · det(K) when J and K are divisible by singular primes (see Chapter 13.4).
By Lemma 8.2.1, we have that
λn (JK) ≤√n · kf k · λ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 (see Chapter 13.4). So, by Minkowski,
λn (JK) < n · kf k(det(J) · det(K))1/n .
By Lemma 8.2.1, we have that det(JK) · det((JK)−1 ) < nn · kf kn . So, we havenn · kf kn ≥ 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 ourfirst tweak.
sk−1 and redefine
Tweak 1: From BI and secret key Bsk
J , compute a certain short vJ ∈ J

decryption to output π = ψ − bvJsk × ψe mod BI . Also, redefine CE , so that it instead uses
B(rDec /(n2.5 · kf k · kBI k) instead of B(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.

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

87

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 |f | and kBI k are
only polynomial in n, and rDec /rEnc is super-polynomial (as it will need to be to make ourscheme bootstrappable).
Toward understanding how this simplification works, suppose that it is the case that Bsk
Jsk
is the rotation basis for some vector wJsk ∈ Z[x]/(f (x)). Let xsk
J = 1/wJ ∈ Q[x]/(f (x)).
sk −1Then, since the rotation basis of xsk
J is precisely (BJ ) , and by properties of rotation bases(see Chapter 6.2) we have thatsk −1
π = ψ − Bsk· ψe mod BI = ψ − wJsk × bxsk
J · b(BJ )J × ψe mod BI

As for generating the initial Bsk
J as a rotation basis, for now we just mention that the ad
hoc instantiation of IdealGen given in Chapter 7.6 suffices. However, as the lemmas below
establish, Tweak 1 works even when Bsk
J is not a rotation basis.
Lemma 8.3.1. Let Bsk
J be an initial secret basis that decrypts correctly for parameter rDec .
sk−1 such that the
From Bsk
J and BI , we can compute in polynomial time a vector vJ ∈ J

rotation basis of 1/vJsk circumscribes a ball of radius at least rDec /(n2.5 · kf k · kBI k). 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 ∈ B(rDec /(n2.5 · kf k · kBI k), then π = ψ −(vJsk )−1 × bvJsk × ψe mod BI . For our particular value of vJsk ∈ J −1 , it will also hold thatπ = ψ − bvJsk × ψe mod BI .
Proof. Since Bsk
J be an initial secret basis that decrypts correctly for parameter rDec , Lemma−1 T∗
7.6.1 tells us that k((BskJ ) ) k ≤ 1/2rDec . Let w ∈ J be a vector in this basis. By Lemma

8.1.2, we can use w to generate a vector x ∈ J −1 whose rotation basis Bx has length at√√
most n · kf k · kwk ≤ n · kf k/2rDec . From Bx and a vector in I of length at mostkBI k, we can generate an independent set BJ −1 I of (x) · I ⊂ J −1 I of length at most√n · kBx k · kBI k ≤ n · kf k · kBI k/2rDec . We set vJsk ← e1 mod BJ −1 I . It has length at mostn2 · kf k · kBI k/2rDec .
Let B†J 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 B†J fulfills therequirement of generating a super-lattice of J, since vJsk generates a sub-lattice of J −1 . It0
be the radiusremains to show that a large enough sphere is circumscribed by B†J . Let rDec

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

88

of the largest such sphere. We have√0rDec
≥ 1/(2 n · k(B†J )−1 k) ≥ rDec /(n2.5 · kf k · kBI k)
where the first inequality follows from Lemma 8.1.1, and the second substitutes in the upperbound 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 thedecryption 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 −1 I, we haver ∈ 1 + I. Since, by the correctness of decryption, we know that (vJsk )−1 × bvJsk · ψe ∈ R(even though vJsk )−1 may not be in R, we have the following congruences modulo I:(vJsk )−1 × bvJsk · ψe

= r × (vJsk )−1 × bvJsk · ψe
= j × bvJsk · ψe
= bvJsk · ψe

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 CE , replacing B(rDec ) with B(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.4.1. If using Tweak 1 and Tweak 2, then use B(rDec /(2n2.5 · kf k · kBI k) in theredefinition of permitted circuits – i.e., a radius half as small as the one used in Tweak 1.
For simplicity, in this Section, we will abuse notation and use rDec to refer to the value ofthe permitted radius before Tweak 2.

CHAPTER 8. TWEAKS TO THE SOMEWHAT HOMOMORPHIC SCHEME

89

The purpose of the tweak will become clearer as we delve into the details of the decryption
sk2 −1 · ψe. (If Tweak 1 iscircuit. But, briefly, recall that Decrypt computes Bsk1
J · b(BJ )sk2 −1 is the rotation basis of vsk .) If weused, then Bsk1
J is just the identity matrix and (BJ )J−1 · ψ to be very close to half-integers, we would needpermitted the coefficients of (Bsk2J )high precision to ensure correct rounding. However, after Tweak 2, we have the following
lemma:−1 · ψ
Lemma 8.4.2. If ψ is a valid ciphertext after Tweak 2, then each coefficient of (Bsk2J )is within 1/4 of an integer.
Proof. Observe that ψ ∈ B(rDec /2)+J. Let ψ = x+j for x ∈ B(rDec /2) and j ∈ J. We have
−1 · ψ = (Bsk )−1 · x + (Bsk )−1 · j, where the former term has coefficients of magnitude
(Bsk
J )
J
J

at most 1/4 by Lemma 7.6.1 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.3.2, is log log(rDec /2) − log log(γMult (R) · rEnc ), which is less than the original amount by
only a sub-constant additive factor.
Again, to use Tweaks 1 and 2 simultaneously, use B(rDec /(2n2.5 · kf k · kBI k).

Chapter 9

Decryption Complexity of the
Tweaked Scheme
To decrypt, we computesk2(ψ − Bsk1
J · bBJ · ψe) mod BI
n×n , Bsk2 ∈ Qn×n , and B is a basis of an ideal I of R = Z[x]/(f (x)).
where ψ ∈ Zn , Bsk1
I
J ∈Z
J

From Tweak 2, we have the promise that the coefficients of Bsk2
J · ψ are all within 1/4 of ansk2
integer. Optionally, Tweak 1 ensures that Bsk1
J is the identity matrix and BJ 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 Bsk2
J · ψ.
Step 2: From the n vectors x1 , . . . , xn , generate integer vectors y1 , . . . , yn+1 with sumPb xi e.
P
Step 3: Compute π ← ψ − Bsk1
yi ) mod BI
J ·(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 constantdepth using a circuit with polynomial fan-in addition gates. (In Theorem 7.3.2, we sawthat constant fan-in multiplication gates were as bad as, or worse than, polynomial fanin 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 Chapter 10.) Step 1 could be doneby multiplying the n columns of Bsk2
by the n coefficients of ψ. But our method forJ
90CHAPTER 9. DECRYPTION COMPLEXITY OF THE TWEAKED SCHEME

91

squashing the decryption circuit will eliminate Step 1. So, we will concentrate on analyzing
the complexity of Steps 2 and 3 in this Chapter.
To better understand the circuit complexity issues here, consider the problem of addingn 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 [76]survey of parallel algorithms): given 3 numbers in binary representation, there is a constantdepth (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 replacen numbers with 2 numbers having the same sum in depth approximately c · log3/2 n. As foradding the final two numbers, there is certainly no general guarantee that this can be donein constant depth. The problem is that the least significant bit of the addends could affectthe most significant bit of the sum. One needs Ω(log k) depth to ensure the final sum iscomputed 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 caneliminate all but O(log n) bits of precision in each of the n addends, and still obtain thecorrect result. This integer can be computed in c log3/2 n + O(log log n) depth; there is nolonger any dependence on k. Indeed, this was the purpose of Tweak 2 – to obtain exactly
this promise.
However, the c log3/2 n 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 lessthan 1, whereas the c induced by the 3-for-2 trick (combined with the constant log3/2 2) iscertainly greater than 1, and thus prevents bootstrapping. Also, even after we apply our“squashing the decryption circuit” technique to make our scheme bootstrappable, a constantfactor in the depth of the decryption circuit makes a huge difference in the performanceand 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 inefficienciesof the 3-for-2 technique. Also, although we have been saying (as shorthand) that we want
to minimize the “depth” of the decryption circuit DE , this is an oversimplification; we are
actually trying to minimize kDE (x1 , . . . , xt )k where the inputs xi are in B(rEnc ). The value

CHAPTER 9. DECRYPTION COMPLEXITY OF THE TWEAKED SCHEME

92kDE (x1 , . . . , xt )k is actually more tightly related to the degree of the multivariate polynomial
DE (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 thenumbers, the penultimate bits, etc., and thereafter combining the partial results. That is, forj ∈ [−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 thebinary representations bj of the Hamming weights.) Now, it turns out, through the magic ofbinomial coefficients, that the binary representation of the Hamming weight of (x1 , . . . , xn )is given by(e2blog nc (x1 , . . . , xn ) mod 2, . . . , e20 (x1 , . . . , xn ) mod 2)
where ei (x1 , . . . , xn ) is the ith elementary symmetric polynomial over x1 , . . . , xn . (See
Lemma 4 of [24].) The highest degree among these polynomials is at most n, versus themultivariate polynomial we would obtain from the 3-for-2 trick, which has degree nc for somec > 1. Also, we know how to efficiently evaluate the elementary symmetric polynomials.
Q
They are simply coefficients of the polynomial p(z) = ni=1 (z − xi ).
We have been talking about the decryption circuit as if it is boolean. However, forbootstrapping to work – i.e., to be able to perform decryption homomorphically – we knowthat we need to express decryption as a mod-BI circuit. Of course, one option is simply totake I = (2). This is fine, except that our stronger security results, beginning in Chapter
14, require det(I) to be only polynomial in n, whereas the ideal (2) has 2n cosets. (Wehasten to add that the reduction given in Chapter 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 ringof cosets in which the computation is performed. We restrict the plaintext space P 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

CHAPTER 9. DECRYPTION COMPLEXITY OF THE TWEAKED SCHEME

93

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 sothat 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 toohigh for our purposes.
Now, we have the following lemma regarding Step 2.
Lemma 9.0.3. For i ∈ [1, t], let ai = (. . . , ai,1 , ai,0 , ai,−1 , . . .) be a real number given inPbinary representation mod BI with the promise that i ai mod 1 ∈ [−1/4, 1/4]. There isa mod-BI circuit C for generating t + 1 integers z1 , . . . , zt+1 (also represented in binary)P
whose sum is b i ai e, such that if the generalized circuit g(C)’s inputs are in B(rin ), thenits outputs are in B(rout ) for:rout ≤ (γMult (R) · n · kBI k · (1 + γMult (R) · rin )t · t)polylog(t)For kBI k ≤ rin , t ≤ n, and γMult (R) = nΩ(1) , we have:rout ≤ (γMult (R) · rin )t·polylog(t)Proof. Let a∗i be the integer part of ai and let a†i = (ai,−1 , ai,−2 , . . .) be the fractional part.
PP
Let T = dlog te + 2. Let bi = (a†i,−1 , . . . , a†i,−T ). First, we claim that b a†i e = b bi e – i.e.,that truncating the least significant bits of the a†i ’s does not affect the rounded sum. ThisP
claim follows from the promise that i a†i is within 1/4 of an integer, and that¯¯¯ ¯¯j∈[T +1,∞]
¯
¯X
¯ ¯ X
X
¯
¯
¯ ¯
†
−j
ai −
bi ¯ = ¯
2 · ai,−j ¯¯ < 1/4
¯
¯
¯ ¯
¯
i

i

i

P
The t + 1 integers that we will eventually output will be a∗1 , . . . , a∗t , b bi e.
P
Our strategy for computing b bi e 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 computingP
the sum b Tj=1 2−j · cj e; 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.

CHAPTER 9. DECRYPTION COMPLEXITY OF THE TWEAKED SCHEME

94

The binary representation of the Hamming weight of (x1 , . . . , xt ) is given by(e2blog tc (x1 , . . . , xt ) mod 2, . . . , e20 (x1 , . . . , xt ) mod 2)
where ei (x1 , . . . , xt ) is the ith elementary symmetric polynomial over x1 , . . . , xt .

(See

Lemma 4 of [24].) These elementary symmetric polynomials can obviously be computed
efficiently. Specifically, one obtains them as the coefficients of the polynomial p(z) =Qt
i=1 (z − xi ). The next step would be to bound ke2k (x1 , . . . , xt )k for xi ∈ B(rin ), fork ∈ {0, . . . , blog tc}.
However, for I 6= (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 ∈ Z(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, ourcircuit 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 · kBI k as an upper bound on the length of elements
in R mod BI , we havekg(C)(x1 , . . . , xt )k≤ γMult (R) · n · kBI k · (Xkei (x1 , . . . , xt )k) · ti∈[0,t]X µt¶i≤ γMult (R) · n · kBI k · (γMult (R)i−1 · rin)·tii∈[0,t]= n · kBI k · (1 + γMult (R) · rin )t · t
At this point, we have generated T numbers, each with O(T ) bits, with the same sum
Pasbi . There is a O(log T )-depth constant fan-in boolean circuit for computing thissum, 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.3.2, the result follows.

CHAPTER 9. DECRYPTION COMPLEXITY OF THE TWEAKED SCHEME

95

Unfortunately, Step 2 uses t = n, implying rDec /rEnc ≥ rout /rin ≥ 2n , and therefore theabove analysis cannot show that the scheme is both bootstrappable and secure. However,Lemma 9.0.3 will be relevant to our final scheme, as will the following lemma regarding
Step 3:
Lemma 9.0.4. Using a constant depth circuit having polynomial fan-in AddBI gates andPconstant fan-in MultBI gates, we can compute ψ − Bsk1
yi ) mod BI from a binaryJ · (representation (using the bits {0, 1} mod BI ) of the terms of the expression.
The proof of Lemma 9.0.4 involves converting the binary representation of the terms
to a more “natural” mod-BI representation, at which point the computation is triviallyconstant depth. As a toy example for intuition, suppose we have mod-13 gates, where thenumbers 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 = ...b1 b0 in binary representation,
where each of the bi is separately represented by the frequency for ‘0’ or ‘1’ (not by anyof the other 11 frequencies). For example, suppose 9 is represented as 1001 rather thanby 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 (..., Mult13 (a1 , b1 ), Mult13 (a0 , b0 )). Using polynomial-fan-in Add13 gates, thistakes constant depth even if b has a polynomial number of bits. Essentially the same considerations apply in the proof of Lemma 9.0.4. The simplest case is where I = (2) and theconversion is unnecessary.
Proof. For a slightly simpler case, let us first assume that Bsk1
J is a rotation basis, so thatP
sk1
the remaining decryption computation is to compute ψ −vJ ×( yi ) mod BI for vJsk1 ∈ R.
Consider one of the vectors – say, y ← y1 . How do we compute the “natural” representationof y mod BI ?
Currently, the ith coefficient yi of y is represented by the elements yix ×e1 , . . . , yi0 ×e1 ∈P{0, 1} mod BI where yi = xj=0 2j · yij . So, we havey=Xi∈[1,n],j∈[0,x]2j × (yij × e1 ) × ei mod BI

CHAPTER 9. DECRYPTION COMPLEXITY OF THE TWEAKED SCHEME

96

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 logf (n) (nx) levels of f (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 Bsk1
is only slightly more complicated. Basically, sinceJ
the matrix inhibits our use of ring multiplication, we first compute the “natural” modBI representation of each individual coefficient (rather than the full vector), multiply thecoefficients together in the proper fashion to obtain the natural representations of coefficientsin the vectors Bsk1
J · yi , and then multiply the representations by the appropriate ei ’s, andadd the results modulo BI .

At this point, it may be tempting to ask: how is a mod-BI gate implemented, anddoesn’t this implementation add to the decryption complexity? But we have shown thatring addition and multiplication applied to ciphertexts induces mod-BI operations overplaintexts: 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 CE ).
From Lemmas 9.0.3 and 9.0.4, we conclude that, aside from the coefficient multiplication
operations in the computation of Bsk2
J · ψ 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.3.2, themaximum depth that we can evaluate is d = log log rDec − log log γMult (R) · rEnc . Can wetake d to be greater than log n?
Unfortunately, the answer appears to be ‘no.’ Specifically, the dominant computation−1 · ψe, which occurs within the computation of ψ mod Bsk . Roughly
in decryption is b(BskJ )J

speaking, to ensure that the rounding is correct, one must use a sufficient number of bitsof 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 constantfan-in). The precision we seem to need is roughly log det(J) > n · log rDec bits, and therefore

CHAPTER 9. DECRYPTION COMPLEXITY OF THE TWEAKED SCHEME

97

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.1
This problem is difficult to fix post hoc, in part due to the self-referential nature of thebootstrapability property: intuitively, if one expands the set of circuits that E can “handle”
in an effort to include DE , one seemingly must increase the complexity of DecryptE toaccommodate, thereby making the circuit DE more complex, possibly such that DE always
elusively falls outside of the expanded set. To obtain a bootstrappable encryption scheme,it seems necessary to change the decryption algorithm fundamentally.

1
However, we do not prove this. It remains possible that the decryption circuit of this initial scheme canbe expressed in a way that makes the scheme bootstrappable.

Chapter 10

Squashing the Decryption Circuit
Let E ∗ be the encryption scheme described in Chapter 7, modified by Tweak 2 and preferably
also Tweak 1 as described in Chapter 8. In this Chapter, we describe how to transform E ∗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 E, we potentially weaken security by including information about the E ∗ secret key
inside the E public key. We first describe our transformation generically. We prove securityof E (generically) based on E ∗ and the assumed hardness of a certain abstract distinguishingproblem, where the latter arises from the new information included in the E public key. We
then instantiate the transformation, where the distinguishing problem becomes a lattice
problem that we discuss in Chapter 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 thesecret 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
98CHAPTER 10. SQUASHING THE DECRYPTION CIRCUIT

99

outsources expensive computations to a server. To set up this arrangement, the user (insome schemes) must give the server a tag τ 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-keydependent tag τ and suffer from ciphertext expansion.
Now, we describe the transformation in detail. Let E ∗ be the initial encryption scheme.
We construct a modified scheme E that uses two new algorithms, SplitKeyE and ExpandCTE ,that will remain abstract for now.
R

R

KeyGenE (λ). Runs (pk∗ , sk∗ ) ← KeyGenE ∗ (λ) and (sk, τ ) ← SplitKeyE (sk∗ , pk∗ ). The secret
key is sk. The public key pk is (pk∗ , τ ).
EncryptE (pk, π). Runs ψ ∗ ← EncryptE ∗ (pk∗ , π). It then sets ψ to include ψ ∗ and the output
of ExpandCTE (pk, ψ ∗ ). (ExpandCTE makes heavy use of τ .)DecryptE (sk, ψ). Uses sk and expanded ciphertext to decrypt more efficiently. DecryptE (sk, ψ)
should work whenever DecryptE ∗ (sk∗ , ψ ∗ ) works.
AddE (pk, ψ1 , ψ2 ). Extracts (ψ1∗ , ψ2∗ ) from (ψ1 , ψ2 ), computes ψ ∗ ← AddE ∗ (pk∗ , ψ1∗ , ψ2∗ ), andsets ψ to include ψ ∗ and the output of ExpandCTE (pk, ψ ∗ ). MultE (pk, ψ1 , ψ2 ) is analogous.
The security of the transformation relies on the following problem, which is completely
abstract at this point.
R

Definition 10.1.1 (SplitKey Distinguishing Problem). The challenger sets (sk∗ , pk∗ ) ←R

R

KeyGenE ∗ and b ← {0, 1}. If b = 0, it sets (sk, τ ) ← SplitKey(sk∗ , pk∗ ). If b = 1, it
Rsets (sk, τ ) ← SplitKey(⊥, pk∗ ), where ⊥ is a special symbol. The problem: guess b given(τ, sk∗ , pk∗ ).
Theorem 10.1.2. Suppose that there is an algorithm A that breaks the semantic securityof E above with advantage ². Then, there exist algorithms B0 and B1 , running in about
the same time as A, such that either B0 ’s advantage against the SplitKey Distinguishing
Problem or B1 ’s advantage against the semantic security of E ∗ 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CHAPTER 10. SQUASHING THE DECRYPTION CIRCUIT

100

inputs ⊥ to obtain τ , and adds τ to the pk it sends to A. By assumption, ² is A’s advantage
in Game 0. Let ²0 be A’s advantage in Game 1.
R

B0 runs as follows. The challenger sets bit b ← {0, 1} and sends a SplitKey Distinguishing
Problem instance (τ, sk∗ , pk∗ ) to B0 . B0 sends pk ← (pk∗ , τ ) to A. When A asks for aRchallenge ciphertext on one of (π0 , π1 ), B0 sets β ← {0, 1} and sends ψ ← EncryptE (pk, πβ ).
Eventually, A sends a bit β 0 . B0 sends b0 ← β ⊕ β 0 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 B0 ’s advantage is at least |² − ²0 |/2.
R

B1 runs as follows. It obtains an E ∗ public key pk∗ from the challenger. It runs (sk, τ ) ←SplitKey(⊥, pk∗ ) and sends pk ← (pk∗ , τ ) to A. When A asks for a challenge ciphertext
on one of (π0 , π1 ), B1 asks the challenger for a challenge ciphertext on one of (π0 , π1 ). The
challenger sends back ψ ∗ . B1 sets ψ to include ψ ∗ and the output of ExpandCTE (pk, ψ ∗ )and sends ψ to A. A sends a bit b0 , which B1 forwards to the challenger. We see that the
distribution is the same as in Game 1. Also, B1 ’s bit is correct if A’s bit is correct; so B1
has advantage ²0 .

In the next Section, 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 ourconcrete version of the SplitKey Distinguishing Problem in Chapter 11.

10.2

How to Squash, Concretely∗

Let vJsk be the secret key vector of our somewhat homomorphic encryption scheme E ∗after Tweak 1. (Our concrete transformation below can be adapted to handle the schemewithout 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:∗

π = ψ − bvJsk × ψe mod BI
The idea of our abstract transformation was to place a “hint” about the E ∗ secret key inside∗

the E public key; what hint do we give about vJsk ?

CHAPTER 10. SQUASHING THE DECRYPTION CIRCUIT101

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 aP∗
subset of indices having cardinality γsubsetsize (n). And it will hold that i∈S ti = 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 theoriginal scheme E ∗ 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
π = ψ∗ − bXci e mod BI

i∈Swhich can easily be verified to be correct.
This transformation will actually end up increasing the computational complexity ofdecryption. However, the important point is that the ExpandCT operation, which does notneed to be performed homomorphically, prepares a ciphertext that can be decrypted bya 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 E ∗ key pair. Let γsetsize (n) and γsubsetsize (n) be functions, where
the former is ω(n) and poly(n) and the latter is ω(1) and o(n). Here are the concrete
instantiations of SplitKeyE , ExpandCTE , and DecryptE used to construct E.
SplitKeyE (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)P∗such that i∈S ti ∈ vJsk + I.
• sk is a matrix γsubsetsize (n) × γsetsize (n) matrix M of 0’s and 1’s, where Mij = 1 iff j
is the ith member of S.
ExpandCTE (pk, ψ ∗ ). Outputs ci ← ti × ψ ∗ mod BI for i ∈ [1, γsetsize (n)].

CHAPTER 10. SQUASHING THE DECRYPTION CIRCUIT

102

DecryptE (sk, ψ). Takes as input the secret key sk and a ciphertext ψ. It performs thefollowing steps:
Step 0: Set the vectors wij ← Mij · cj
Pγsetsize (n)Step 1: Set the vectors xi ← j=1
wij
Step 2: From x1 , . . . , xγsubsetsize (n) , generate integer vectors y1 , . . . , yγsubsetsize (n)+1 withP
sum b xi e.
P
Step 3: Compute π ← ψ ∗ − ( yi ) mod BI
Remark 10.2.1. To generate τ , one may, for example, just set t1 , . . . , tγsetsize (n)−1 to be uniPγsubsetsize (n)−1∗formly random vectors in J −1 ∩P(BI ). Then, one sets tγsetsize (n) ← vJsk − i=1
ti modBI . Then one permutes the vectors.
Remark 10.2.2. Without Tweak 2, we could have instead used a γsetsize (n)-sized set of−1
matrices with a hidden γsubsetsize (n)-sized subset whose sum is related to (Bsk
J ) . 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 Chapter 9. It is obvious that Step 0 requires only constant depth. We claim that Step 1 requires only constant depth, but why? Computing
Pγsetsize (n)wij is very cheap because, in the set {wij : j ∈ [1, γsetsize (n)}, there is only
j=1
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.3.1. The scheme E is bootstrappable whenµc1γsubsetsize (n) · log γsubsetsize (n) ≤log(rDec /m)
c
2 2 · log(γMult (R) · rEnc )¶where logc1 γsubsetsize (n) is the polylog term arising in Lemma 9.0.3, m arises from the redefinition of CE in the Tweaks (m = 2 when just Tweak 2 is used), and c2 is a constantrepresenting the depth needed in a circuit having AddBI gates with γMult (R) = nΩ(1) fan-inand MultBI gates with constant fan-in to sequentially perform DecryptE Steps 0, 1, and 3,
and a NAND gate.

CHAPTER 10. SQUASHING THE DECRYPTION CIRCUIT103

Proof. As in the proof of Theorem 7.3.2, for a c-level circuit, if the inputs to the generalizedccircuit are in B(r), the outputs are in B((γMult (R) · r)2 ). Combining with Lemma 9.0.3,
we have that if the inputs to our generalized NAND-augmented decryption circuit are inB(rEnc ), the output is inc2 ·(γsubsetsize (n)·polylog(γsubsetsize (n)))(γMult (R) · rEnc )2

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

C

For example, suppose γMult (R) · rEnc is polynomial in n, and rDec = 2n 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 wehave done.

Chapter 11

Security
From Theorem 10.1.2, we know that the bootstrappable encryption scheme described in
Chapter 10.2 is semantically secure as long as the SplitKey distinguishing problem (instantiated as described as in Chapter 10.2) is hard and the somewhat homomorphic encryption
scheme of Chapter 7 (possibly with the tweaks of Chapter 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
Chapter 7.7, basing it on the decision BDDP. Later, we will revisit this scheme, modifying it
to obtain a quantum reduction from the shortest independent vector problem (SIVP) overideal lattices. In the remainder of this Chapter, 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.1.4.)
We then show how to reduce search SSSP to decision SSSP using Goldreich-Levin [55, 51].

11.1

Regarding the Hint Given in Our “Squashing” Transformation

For the concrete instantiation of SplitKey given in Chapter 10.2, the SplitKey distinguishingproblem becomes the following.
Definition 11.1.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
RR∗

(sk∗ , pk∗ ) ← KeyGenE ∗ and b ← {0, 1}, where sk∗ includes the secret vector vJsk ∈ J −1 . If
104

CHAPTER 11. SECURITY

105∗

b = 1, it sets vJsk ← 0. It sets τ to be a set of γsetsize (n) vectors t1 , . . . , tγsetsize (n) thatare uniformly random in J −1 mod BI subject to the constraint that there exists a subsetPsk∗S ⊆ {1, . . . , γsetsize (n)} of cardinality γsubsetsize (n) such thati∈S ti ∈ vJ + 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.1. The problem is somewhat unnatural, in the sensethat it depends on our key generation algorithm. Below, we base the hardness of ourSplitKey Distinguishing Problem on a sparse subset sum problem modulo an integer that isessentially 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 thelattice 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, weremove the dependence on I and J.
Here is the intermediate problem that we use.
Definition 11.1.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
RR

(sk∗ , pk∗ ) ← KeyGenE ∗ and b ← {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 Zn ∩ P(BIJ ), subject tothe constraint that there exists a subset S ⊆ {1, . . . , γsetsize (n)} of cardinality γsubsetsize (n)Psuch that i∈S ui ∈ IJ. If b = 1, it sets the vectors without the constraint. The problem
is to guess b given (τ, sk∗ , pk∗ ).
Theorem 11.1.3. Let A be an algorithm that decides the concrete version of the SplitKey
Distinguishing Problem with advantage ². Then, there is an algorithm B, running in about
the same time as A, that solves the SVSSP with advantage (γsubsetsize (n)/2γsetsize (n)) · ².
R

Proof. The challenger generates a bit b ← {0, 1} and gives B 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 τ 0 for the SplitKey Distinguishing Problem, B 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 }.
R

B sets T 0 ← BJ −1 · U , reducing the columns modulo BI . It sets a bit β ← {0, 1}; if β = 0 it∗

sets v ← vJsk , otherwise it sets v ← 0. It adds v to a random column (say the kth column)

CHAPTER 11. SECURITY

106

of T 0 , reducing the column modulo BI , to obtain matrix T . It outputs τ 0 as the column
vectors of T . A responds with a bit β 0 . B outputs b0 ← β ⊕ β 0 .
We have thatPr[b0 = b] = (1/2) · Pr[b0 = 0|b = 0] + (1/2) · Pr[b0 = 1|b = 1] = (1/2) · Pr[b0 = 0|b = 0] + 1/4
The last equality follows from the fact that, when b = 1, the column vectors of T 0 are
random and independent in J −1 ∩ P(BI ) and thus T is independent of β, β 0 is independentof β, and b0 is uniformly random. We know that the column vectors of T 0 are random andindependent, since multiplication by BJ −1 induces a bijection between Zn ∩ P(BIJ ) andJ −1 ∩ P(BI ) that preserves rank: for c ∈ Zγsetsize (n) , we have
T 0 · c = 0 ⇔ BJ −1 · U · c = 0 ⇔ U · c = 0
In short, the uniformity of U when b = 1 implies the uniformity of T 0 .
Now, assume b = 0. For i ∈ {0, 1}, let ²i be the probability that A outputs 1 whenb† = i in the SplitKey Distinguishing Problem. (We used ‘b† ’ to avoid a notation conflict.)
We have¡¢
Pr[b0 = 0] = (1/2) · Pr[β 0 = 0|β = 0] + Pr[β 0 = 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[β 0 = 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 nota 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 havePr[β 0 = 0]

= Pr[β 0 = 0|k ∈ S] · Pr[k ∈ S] + Pr[β 0 = 0|k ∈/ S] · Pr[k ∈/ S]= (1 − ²0 )(γsubsetsize (n)/γsetsize (n)) + (1 − ²1 ) · (1 − γsubsetsize (n)/γsetsize (n))

CHAPTER 11. SECURITY

107

Overall, we havePr[b0 = 0|b = 0] = 1/2 + (²1 − ²0 )(γsubsetsize (n)/2γsetsize (n))
and thus Pr[b0 = b] = 1/2 + (²1 − ²0 )(γsubsetsize (n)/4γsetsize (n)). In other words, B’s advantage is less than A’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.1.4 (Sparse Subset Sum Problem (SSSP)). Let γsetsize (n) and γsubsetsize (n)Rbe functions as above, and let q be a prime positive integer. The challenger sets b ← {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 ⊆P{1, . . . , γsetsize (n)} of cardinality γsubsetsize (n) such thati∈S ai = 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 thatsums 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 weomit 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 exponentiallyshorter than the rest of the solution vectors; this solution vector can then be recovered bya polynomial-time lattice reduction algorithm. In our case, γsetsize (n)/ log q will be greaterthan 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 toextract the sparse solution from the many non-sparse ones.
Theorem 11.1.5. Assume BI and IdealGen are such that det(I) and det(J) are distinct
primes and q/ det(IJ) is super-polynomial. Suppose A decides SVSSP with advantage² in this setting. Then, there is an algorithm B 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 thatPi∈S ai =0 mod q, then this set sums to zero over the integers with non-negligible probability, sinceCHAPTER 11. SECURITY108

the only possible sums are k ·q for k ∈ (−γsubsetsize (n)/2, γsubsetsize (n)/2). If this holds, thenPP
q is irrelevant; i∈S ai = 0 mod p holds for any p. In particular, i∈S ai = 0 mod det(IJ).
Accordingly, B’s initial strategy is to set ai ← ai · ei mod BIJ for all i, and ask A
whether these ai are statistically uniform or there is a sparse subset of them that sum to 0P
modulo IJ. There surely is such a sparse subset (namely, S) when i∈S ai = 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
Zn /IJ.
The difficult case is whenPi∈S ai 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 theai ’s would be unlikely to have such a sparse subset if they were uniform. So, we revise B’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 areP
random or have a sparse subset that sums to 0 over the integers; for the case that i∈S ai
is a nonzero multiple of q, the new strategy randomizes the sum of the sparse subset sothat it equals x · e1 for some random x that is invertible modulo det(IJ). If det(I) anddet(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 notsuper-polynomial (det(J) of course must be), then we can use the Leftover Hash Lemma toprove that the distribution is still statistically uniform.
Overall, if A has a non-negligible advantage in the SVSSP, then B can use A to distinguish when an SSSP instance has a sparse subset that sums to 0 over the integers, which isenough to give B a non-negligible advantage in the SSSP.
R

Proof. The challenger generates a bit b ← {0, 1} and gives B an appropriate instance τRof SSSP. To generate a tag τ 0 for the SVSSP, B does the following. B sets (sk∗ , pk∗ ) ←KeyGenE ∗ 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 τ 0 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 Zn /IJ (we will show

CHAPTER 11. SECURITY

109

this momentarily), and m is invertible modulo det(IJ), the ai ’s are random and independentamong the cosets Zn /IJ.
As to why ei generates all of the det(IJ) cosets of Zn /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.
P
Suppose that b = 0 and that i∈S ai = 0 (over the integers). Let S be the set of indicesP
corresponding to the subset whose sum is 0. In this case, i∈S ai = 0 mod det(IJ), andP
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, τ 0 leads to a (statistically)
properly distributed instance of the SVSSP for the b† = 0 case.
P
Suppose that b = 0 and that i∈S ai is a nonzero multiple of q. Consider the distriP
bution of i∈S m · ai mod det(IJ); we claim that it is statistically uniform. If this sum isstatistically uniform, then the distribution of {ai } is uniform modulo IJ, since we alreadyknow that the distribution is uniform apart from the possibility that there is a sparse subset
S with an improbable sum.
P
First, consider i∈S mJ · ai mod det(J), where mJ is the residues of m modulo det(J).
P
We claim that it is statistical uniform and independent of i∈S mI · ai mod det(I), whereP
mI is the residues of m modulo det(I). Toward this claim, first we note thati∈S aiis 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 (Z/ det(J))∗ randomly and independently of mI , and, since
J is necessarily super-polynomial (for basic security reasons), sampling uniformly from
(Z/ det(J))∗ is statistically indistinguishable from sampling uniformly from (Z/ det(J)).
The claim follows.
Now, it suffices to show thatPi∈S mI · ai mod det(I) is statistically uniform. If det(I) isalso 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 hashfunctions, each hash function h in the family associated a distinct (h1 , . . . , hγsetsize (n)−1 ) ∈(Z/ det(I))γsetsize (n)−1 . The function maps from the set X of (γsubsetsize (n) − 1)-sized subP
sets of {1, . . . , γsetsize (n) − 1} to the set Y = Z/ det(I) via h(x) = − i∈x hi mod det(I).

CHAPTER 11. SECURITY

110

This family is clearly 2-universal. By the Leftover Hash Lemma (Lemma 6.3.1), if hp
and x are selected uniformly and independently, then (h, h(X)) is 21 |Y|/|X |-uniform.
¡¢ ω(1)The statistical difference from uniform is negligible when det(I) = γ γsetsize (n)−1
/n
,
(n)−1
subsetsize

which will certainly be true when det(I) is not super-polynomial. The distribution ofPi∈S mI · ai mod det(I) is even closer to uniform than the distribution induced by theabove family of hash functions, since this distribution is equivalent to picking a randomhash function from the family above, computing (h, h(x)), replacing h(x) with h(x) + z fora uniformly random z ∈ (Z/ det(I))∗ , and then permuting the resulting γsetsize (n) elementsof (Z/ det(I))∗ .
Overall, given thatPi∈S ai = 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, themiddle case occurs with probability at least 1/γsubsetsize (n), and B’s advantage is therefore
at least ²/2γsubsetsize (n), up to negligible factors.
Finally, we reduce search SSSP to decision SSSP.
Definition 11.1.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 {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) suchP
that i∈S ai = 0 mod q. The problem is to output the set S given τ .
Theorem 11.1.7. Suppose A decides SSSP with non-negligible advantage in polynomial
time. Then, there is an algorithm B 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 O that decides
whether τ 0 is uniformly random or has a sparse subset that sums to 0. Suppose that we arealso given a set τ = (a1 , . . . , aγsetsize (n) ) that sums to 0 over a sparse subset S. To decideRwhether an index i ∈ [1, γsetsize (n)] is in S, we set r ← Z/(q), set a0i ← ai + r mod q, andgive τ 0 = (a1 , . . . , ai−1 , a0i , ai+1 , . . . , aγsetsize (n) ) to O. If i ∈/ S, then τ 0 still sums to 0 over
S. O will tell us that there is a sparse subset, and we conclude that i ∈/ S. But if i ∈ S,
then τ 0 is distributed like a random member of [−q/2, q/2]γsetsize (n) and we conclude fromO’s response that i ∈ S.
Instead of a flawless oracle, we are given algorithm A, which by assumption solves
decision SSSP with non-negligible advantage. However, the Goldreich-Levin Theorem [55]CHAPTER 11. SECURITY

111

shows us how to use a decision oracle to invert certain functions, even when that oracle isfaulty.
Theorem 11.1.8. (Goldreich-Levin Theorem, restated as in [51]) 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 havePrr∈{0,1}n[bx (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.1.7) B receives a search SSSP instance τ = (a1 , . . . , aγsetsize (n) ) fromthe challenger. Let x ∈ {0, 1}γsetsize (n) be the (unknown) incidence vector associated tothe sparse subset S ⊂ {1, . . . , γsetsize (n)} over which τ sums to 0 modulo q. We will use
Goldreich-Levin to recover x.
R

For r ∈ {0, 1}n , define the random process bx (r) as follows. Sample c ← [−q/2, q/2] andRs ← {−1, 1}γsetsize (n) , setτ 0 ← (a1 + c · s1 · r1 mod q, . . . , aγsetsize (n) + c · sγsetsize (n) · rγsetsize (n) mod q) ,give τ 0 to A as its SSSP instance, and output A’s response bit b0 . We claim that b0 =hx, ri mod 2 with probability non-negligibly bounded away from 1/2, from which the theresult follows by Goldreich-Levin.
For i ∈ {0, 1}, let ²0 be the probability that A outputs 1 when a decision SSSP instancehas a sparse subset that sums to 0, and let ²1 be the probability that A outputs 1 otherwise.
By assumption, ²1 − ²0 is non-negligible. Let E1 and E2 be the events that hx, ri = 0 mod 2
P
and i∈S si · ri = 0, respectively. Note that E2 implies E1 . We havePr[b0 = hx, ri]= Pr[b0 = 0|E2 ] · Pr[E2 ] + Pr[b0 = 0|E1 ∧ ¬E2 ] · Pr[E1 ∧ ¬E2 ] + Pr[b0 = 1|¬E1 ] · Pr[¬E1 ]= (1 − ²0 ) · Pr[E2 ] + (1 − ²1 ) · ((1/2) − Pr[E2 ]) + ²1 · (1/2)= 1/2 + (²1 − ²0 ) · Pr[E2 ]CHAPTER 11. SECURITY112

The first equality follows from the fact that, if E2 occurs, then τ 0 sums to 0 over S (and isotherwise randomly distributed). However, if E2 does not occur, then τ 0 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) –P
since there are only 2γsubsetsize (n)+1 possibilities for i∈S si ·ri and 0 is the most likely.
As mentioned in Chapter 10, our approach to reducing the complexity of the decryption
circuit is abstractly similar to approaches used in server-aided cryptography to outsourcesome of the decryption work to an untrusted server. In fact, the similarity is more thanjust abstract; there are concrete server-aided schemes whose security relies on the SSSP. In
particular, in the Matsumoto, Kato and Imai [91] server-aided RSA scheme – called, RSA-S1– the private exponent d is decomposed into γsetsize (n) integers {ai } such that there is a set
P{xi ∈ [0, 2` −1]}, only γsubsetsize (n) of which are nonzero, such that i xi ·ai = 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 [101] as part of their program to separate P from NP [117]. The fullrank avoidance problem asks: given a matrix X with n rows and kn columns grouped as nblocks of k, is it possible to choose one column from each block so that the resulting n × nmatrix M has det(M ) = 0? In our setting, we need k to be at least γsetsize (n)/n. Gurvitz[64] 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 [114, 106, 96, 105]? These attacks are feasible only for limited choices of
RSA-S1 parameters; they are not polynomial-time in general. Some of these [114] (and previous related results [128, 33]) are essentially time-space tradeoffs, meet-in-the-middle typeattacks, whose complexity is exponential in γsubsetsize (n); these attacks are not polynomialtime when γsubsetsize (n) = ω(1).
Nguyen and Shparlinski [105] 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

CHAPTER 11. SECURITY

113

Theorem 11.1.5 only requires log q to be larger than log(det(IJ)) by an additive factor thatsuper-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.
For Theorem 11.1.5 to apply to our scheme, we need to use BI and instantiate IdealGensuch that I and J satisfy the given requirements on det(IJ). In Chapter 14, we begin
describing a modified version of the somewhat homomorphic scheme that uses an I for
which det(I) is prime. Also, we provide an instantiation of IdealGen in Chapter 18, which
outputs J as a uniformly random invertible prime ideal with norm in a given interval; its
norm will most likely be a prime integer.

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 andShparlinski [105]. I.e., the best attack takes time (roughly) 2γsubsetsize (n) .
On the other hand, by Theorem 10.3.1, our scheme becomes bootstrappable whenµc1γsubsetsize (n) · log γsubsetsize (n) ≤log(rDec /m)
c2
2 · log(γMult (R) · rEnc )¶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 Chapter 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 [123].
√
We can set γsubsetsize (n) ≈ 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

CHAPTER 11. SECURITY

114

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 λ.

Chapter 12

Performance and Optimizations
In this Chapter, 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 Section 12.1, we find in Section 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, andincreasing 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 Section 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 whichcase a full exponentiation takes time quasi-linear in λ6 , even when one uses fast FFT
115

CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

116

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 OptimizationsFirst, we note some very simple optimizations, before getting to the more technical ones
described in Section 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 Chapter 4, where we
defined what it means for an encryption scheme to be bootstrappable with respect to a setof gates Γ.) In particular, a “gate” could be a “normal” boolean circuit of depth greaterthan 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 thediscussion below that we use NAND gates.
For each NAND gate in C, we evaluate two decryption circuits DE homomorphically,
and then compute NAND homomorphically. In our transformation above from E ∗ (thesomewhat homomorphic scheme) to E (with the squashed decryption circuit), we said thata 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 ExpandCTE (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 π underpk1 ), we do not really need to first encrypt the bits of ψ under pk2 . Instead, we canview 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 thesecret key as input and has the ciphertext hard-wired. So, overall, the complexity (per gatein C) is approximately twice the complexity of this simplified version of Recrypt, plus thecomplexity of ExpandCT.

CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

12.2

117

Basic Performance

As discussed in Chapter 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, suchthat 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 secretkey (unencrypted) is a γsubsetsize (n) × γsetsize (n) matrix of bits. We need γsetsize (n) to berather 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 thatlog 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 theciphertext 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 thisintermediate computation also has length quasi-linear in λ9 . The remaining computationis 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 ExpandCTE are as before; the changes are in the format of sk

CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

118

and in the decryption algorithm, which is as follows.
DecryptE (sk, ψ). Takes as input the secret key sk and a ciphertext ψ. It performs thefollowing 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 sumPb xi e.
P
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 havethe promise that most of the numbers that we are summing up are 0, then we can computethe output above using a shallower circuit. Why? Recall that, in Lemma 9.0.3, we basicallyreduced computing the sum of t numbers to computing the Hamming weight of a vectorb ∈ {0, 1}t . Then, we used the fact that the binary representation of this Hamming weightis precisely(e2blog tc (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 polynomialse2i (b1 , . . . , bt ) for i > blog kc, 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.0.3.
Lemma 12.3.1. For i ∈ [1, t], let ai = (. . . , ai,1 , ai,0 , ai,−1 , . . .) be a real number givenPin 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 integersPz1 , . . . , zt+1 (also represented in binary) whose sum is b i ai e, such that if the generalized
circuit g(C)’s inputs are in B(rin ), then its outputs are in B(rout ) for:rout ≤ k · t · n · kBI k · (t · γMult (R) · rin )k·polylog(k)CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

119

For kBI k ≤ rin , t ≤ n, and γMult (R) = nΩ(1) , we have:rout ≤ (γMult (R) · rin )k·polylog(k)Proof. The proof is essentially identical to the proof of Lemma 9.0.3 – i.e., we compute theelementary 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 thepolynomials now take more input variables.
Let C be the mod-BI sub-circuit for computing any bit of the binary representationof the Hamming weight. Using n · kBI k as an upper bound on the length of elements in
R mod BI , we havekg(C)(x1 , . . . , xt )k≤ γMult (R) · n · kBI k · (Xkei (x1 , . . . , xt )k) · ti∈[0,k]X µt¶iγMult (R)i−1 · rin)·t≤ γMult (R) · n · kBI k · (ii∈[0,k]X µt¶(γMult (R) · rin )i )= t · n · kBI k · (ii∈[0,k]X(t · γMult (R) · rin )i )≤ t · n · kBI k · (i∈[0,k]≤ k · t · n · kBI k · (t · γMult (R) · rin )kAt this point, we have generated about log k numbers, each with O(log k) bits, with thePsame 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.3.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.3.1.
Now, let us analyze the computation needed after Optimization 1. The more concise

CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

120

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 dominantremaining 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 leastsignificant coefficients of the ci ’s, etc.; the total number of such computations is the numberof bits in ci , which is quasi-linear in n ≈ λ2 .
The symmetric polynomials are the coefficients of z i , i ∈ [γsetsize (n)−γsubsetsize (n), γsetsize (n)],Qγsetsize (n)in the polynomial p(z) = i=1(z−bi ). Let f (t) be the computation needed to computethe product of t of the (z −bi )’s. Using the recursion that f (t) = 2·f (t/2)+polylog(t/2), thetotal computation needed to compute the symmetric polynomials (non-homomorphically)is γsetsize (n) · polylog(γ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 inn ≈ λ2 , the total computation in quasi-linear in λ8 .
Remark 12.3.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 degreed > γsubsetsize (n), we can discard its coefficients for z i 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 ncoefficient 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).1 A ciphertext ψ ∗ from thesomewhat homomorphic scheme has the form m + j, where m ∈ π · e1 + 2 · Zn 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 coefficientof ψ ∗ ; for all of the other coefficients, the offset from the closest J-vector is even. This
1

Shai Halevi observed the optimization for this case [67].

CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

121suggests that, our decryption equation∗

π = ψ ∗ − bvJsk × ψ ∗ e mod 2
we only really care about the least significant coefficient – i.e., π can be recovered from theleast significant coefficient of ψ ∗ and the least significant coefficient of∗vJsk × ψ ∗ =Xti × ψ ∗i∈S

In Optimization 2, we modify ExpandCT to output only the least significant coefficients ofthe 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 6= (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 B0I of I, where the first column vectorb0 = (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 ∈ Zn . Let
m0 ← m −n−1
X

mi · bi = m mod BI ,i=1

Then all of the coefficients of m0 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 theciphertext (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 thistransformation 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 B0I and p as above and x ∈ Qn , let
x red B0I = x −n−1Xxi · bi

i=1

Notice that all of the coefficients of x red B0I are 0, except possibly the least significant one.
Also, notice that x + y red B0I = (x red B0I ) + (y red B0I ). Finally, notice that x red B0I

CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

122

seems to have a close relationship with x mod B0I , which equals
x−

n−1
X

bxi e · bi mod p

i=1

The following lemma characterizes this relationship.
Lemma 12.3.3. Let B0I 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,bx mod B0I e = bx red B0I e mod p
Also, the least significant coefficient of x red B0I has size at most p ·P

i |xi | and is within ηof an integer.
Proof. The upper bound on the magnitude of the least significant coefficient of x red B0I is
obvious.
Since the vectors in B0I are integer vectors, the coefficients of (x mod B0I ) are within δof integers. Also, for some integer k, we have(x mod B0I ) − (x red B0I )= (x − k · p · e1 −n−1Xbxi e · bi ) − (x −i=1

= −k · p · e1 +

n−1
X

n−1
X

xi · bi )i=1(xi − bxi e) · bi

i=1

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 B0I )are close (within η) to the same integers that the coefficients of (x mod B0I ) are close to (upto a multiple of p for the least significant coefficient).

With that technical lemma in hand, we modify ExpandCTE and DecryptE as follows.
ExpandCTE (pk, ψ ∗ ). Computes c0i ← ti × ψ ∗ mod BI for i ∈ [1, γsetsize (n)], and outputs
ci ← c0i red B0I . (All but the first coefficient of these vectors is 0, so these coefficients do
not actually need to be output.)CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

123

DecryptE (sk, ψ). Takes as input the secret key sk and a ciphertext ψ. It performs thefollowing 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 sumPb xi e.
P
Step 3: Compute π ← ψ − ( yi ) mod B0I
To show that decryption is correct, it suffices to show that
ψ−b

X

X
c0i e mod I
ci e = ψ − b

i∈S

i∈S

where the first expression is what is computed in the new decryption algorithm, and thesecond expression is what was computed prior to Optimization 2. But this follows fromP
Lemma 12.3.3 as long as i∈S c0i has coefficients that are sufficiently close to integers.
P∗
Modulo I, i∈S c0i 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 Chapter 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 = Z[x]/(f (x)) for f (x) = xn + 1, where n is a powerof 2. (Alternatively, one could use some other irreducible f (x) that equals xn + h(x)for some constant-degree polynomial h(x) with khk = poly(n).) To set τ , generate 2 ·Rγsubsetsize (n) random vectors xj ← J −1 subject to the constraint that there exists a vectors ∈ {0, 1}2·γsubsetsize (n) of Hamming weight γsubsetsize (n), and a vector r ∈ {0, . . . , n −1}2·γsubsetsize (n) such that∗vJsk =

2·γsubsetsize (n)X(si · xri i mod f (x)) mod I

i=1

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

CHAPTER 12. PERFORMANCE AND OPTIMIZATIONS

124

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 moreconcise, 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, theless 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.

Chapter 13

Background on Ideal Lattices II
Over the next few Chapters, we revisit the somewhat homomorphic scheme in an effort
to base its security on a weaker computational assumption. Recall that, to make thesomewhat homomorphic scheme bootstrappable, we needed to squash the decryption circuitand make an additional computational assumption; our efforts below will only weaken thefirst assumption.
As our first refinement to the somewhat homomorphic scheme, we modify the Samp
algorithm (used in Encrypt) so that it samples from the coset π + I according to a discrete
Gaussian distribution centered at the origin and with a deviation parameter not much larger
than kBI k. When Encrypt uses this distribution and det(I) = poly(n), we show in the next
Chapter that security can be based (classically) on the (search) BDDP over ideal lattices
generated according to the distribution induced by the IdealGen algorithm used in KeyGen.
To generate I, we need some results on ideal factorization in polynomial rings, given here.
Beginning in Chapter 16, we show how to obtain a worst-case / average-case connection for
ideal lattices and show how to instantiate IdealGen so that it generates ideals according to
the average-case distribution.

13.1

Overview of Gaussian Distributions over Lattices

For any real s > 0, define the Gaussian function on Rn centered at c with parameter s asρs,c (x) = exp(−πkx − ck2 /s2 ) for all x ∈ Rn . The associated discrete Gaussian distribution

125CHAPTER 13. BACKGROUND ON IDEAL LATTICES II

126

over L is∀ x ∈ L, DL,s,c (x) =where ρs,c (A) for set A denotesρs,c (x),ρs,c (L)Px∈A ρs,c (x). In other words, the probability DL,s,c (x) is

simply proportional to ρs,c (x), the denominator being a normalization factor.
We use the smoothing parameter [100] associated to a lattice. The gist for our purposesis that if I1 ⊂ I2 are two ideals and s exceeds the smoothing parameter of I1 – in particular,√s = λn (I1 ) · ω( log n) – then the distribution DI2 ,s,c samples uniformly from the cosets of
I1 ; intuitively, the Gaussian is so “fat” that it smears uniformly across the cosets. Relatedly,ρs,c (I2 )/ρs,c (I1 ) = det(I1 )/ det(I2 ), up to negligible factors.
We will repeatedly invoke a technical lemma by Gentry, Peikert and Vaikuntanathan(GPV) [49], which basically states that, given a basis B of L, one can sample vectors in L
according to an arbitrarily precise discrete Gaussian distribution, as long as the deviationof the Gaussian is slightly bigger than kBk.
Lemma 13.1.1 (Theorem 3.1 of [49]). For any lattice basis B ∈ Zn×n , any real s ≥√kBk · ω( log n), and any c ∈ Rn , GPV’s efficient sampling algorithm Samp, on input(B, s, c), has an output distribution that is within negligible statistical distance of DL(B),s,c .

13.2

The Smoothing Parameter

As in [100], for lattice L and real ² > 0, we define the smoothing parameter η² (L) to be thesmallest s such that ρ1/s (L∗ \ {0}) ≤ ². We also use a couple of lemmata from [100].
Lemma 13.2.1 (Lemma 3.3 from [100]). For any n-dimensional lattice L and positive real
² > 0,r
η² (L) ≤ln(2n(1 + 1/²))· λn (L)π

In particular, for any superlogarithmic function ω(log n), there exists a negligible functionp²(n) such that η² (L) ≤ λn (L) · ω(log n).
Another fact we need says that a sample from a discrete Gaussian with parameter s is√
at most s · n away from its center with overwhelming probability.

CHAPTER 13. BACKGROUND ON IDEAL LATTICES II

127

Lemma 13.2.2 (Lemma A.6 of [49], derived from [100]). For any full-rank n-dimensionallattice L, c ∈ Rn , real ² ∈ (0, 1), and s ≥ η² (L), we have£√ ¤ 1 + ² −n
·2kx − ck > s · n ≤x←DL,s,c1−²Pr

The above is a stronger form of Banaszyzck’s Lemma [11].
√Lemma 13.2.3 (Lemma 1.5 of [11]). For any c > 1/ 2π, n-dimensional lattice L, andvector v ∈ Rn ,√
ρ(L \ c nB) < C n · ρ(L)√
ρ((v + L) \ c nB) < 2C n · ρ(L)√2where C = c 2πe · e−πc < 1.
When the smoothing parameter exceeds the smoothing parameter (by which we means ≥ η² (M ) for negligible ²) of lattices M ⊆ L, we obtain the following nice properties.
Lemma 13.2.4 (Lemma A.4 of [49], implicit in [100]). Let L be any full-rank n-dimensionallattice. Then for any s ≥ η² (L), real ² ∈ (0, 1) and c ∈ Rn , we have ρs,c (L) ∈ [ 1−²
1+² , 1] ·ρs,0 (L).
Lemma 13.2.5 (Lemma A.5 of [49]). Let L, M be full-rank n-dimensional lattices withM ⊆ L. Then for any ² ∈ (0, 1/2), and s ≥ η² (M ), and any c ∈ Rn , the distribution of(DL,s,c mod M ) is within statistical distance at most 2² of uniform over (M mod L).
Lemma 13.2.6. Let L, M be full-rank n-dimensional lattices with M ⊆ L. Then for any² ∈ (0, 1/2), and s ≥ η² (M ), and any c ∈ Rn , ρs,c (L)/ρs,c (M ) equals det(M )/ det(L), up
to a multiplicative factor at most 2² away from 1.
Approximately, the sum of two discrete Gaussian distributions is another discrete Gaussian distribution, as is the case when the distributions are continuous. The problem is that
this is not entirely true; the discreteness of the original distributions introduces some error.
Here, we bound the error.
Lemma 13.2.7. Let L be a lattice, c ∈ Rn be a vector, s, t > 0 be two reals, and r =√s2 + t2 . Assume that ² ← ρr/st (L∗ /{0}) satisfies ² < 1/2. Then, the statistical difference
between DL,s,c1 + DL,t,c2 and DL,r,c1 +c2 is at most 9².

CHAPTER 13. BACKGROUND ON IDEAL LATTICES II

128

Proof. Consider the continuous distribution Y on Rn obtained by sampling from DL,s,c1
and then adding a noise vector from ρt,c2 . We use Lemma 13.2.8 below to conclude that
|Y (x) − ρr,c1 +c2 (x)/rn | ≤ ρr,c1 +c2 (x)/rn · 4²
But we know that, by definition, DL,r,c1 +c2 (x) simply equals ρr,c1 +c2 (x)/rn , up to thePnormalization factor n1 ← x∈L ρr,c1 +c2 (x). Similarly, (DL,s,c1 + DL,t,c2 )(x) equals Y (x),P
up to the normalization factor n2 ← x∈L Y (x). Since Y (x) ∈ [(1 − 4²)ρr,c1 +c2 (x), (1 +4²)ρr,c1 +c2 (x)] for all x, we have that n2 ∈ [(1 − 4²)n1 , (1 + 4²)n1 ]. Therefore,(DL,s,c1 + DL,t,c2 )(x) ∈ [(1 − 4²)2 · DL,r,c1 +c2 (x), (1 + 4²)2 · DL,r,c1 +c2 (x)]for all x. After replacing the implicit ²2 by ² in the equation above, the result follows by
integration.

Lemma 13.2.8 (Strengthening of Lemma 3.9 of [119]). Let L be a lattice, c ∈ Rn be a√vector, s, t > 0 be two reals, and r = s2 + t2 . Assume that ² ← ρr/st (L∗ /{0}) satisfies² < 1/2. Consider the continuous distribution Y on Rn obtained by sampling from DL+c,s,0
and then adding a noise vector from ρt . Then, for all x ∈ Rn ,|Y (x) − ρr (x)/rn | ≤ ρr (x)/rn · 4²
The lemma above follows from the Regev’s proof of Lemma 3.9 [119].

13.3

Sampling a Lattice According to a Gaussian Distribution

Gentry, Peikert and Vaikuntanathan [49] provide a fast algorithm that is able to sample alattice L according to (a distribution that is statistically indistinguishable from) a discrete
Gaussian distribution for parameter s. The algorithm only requires as input a basis B of Lsuch that kBk is a little bit less than s.
Theorem 13.3.1 (Theorem 3.1 from [49]). For any lattice basis B ∈ Zn×k , any real s ≥√kBk · ω( log n), there is an algorithm (called SampleD in [49]) whose output distribution

CHAPTER 13. BACKGROUND ON IDEAL LATTICES II

129

is within negligible distance of DL(B),s,c . The running time of SampleD is polynomial in n
and the size of its input (B, s, c).
The algorithm works by iteratively reducing the problem of sampling from L according
to a Gaussian distribution centered at c to the problem of sampling from subspaces of L ofsmaller and smaller dimension. Specifically, the sampling algorithm SampleD is as follows.
On input (B, s, c), if k = 0 (i.e., B is empty), return 0. Otherwise:
1. Compute bk , the (nonzero) component of bk orthogonal to span(b1 , . . . , bk−1 ). Comht,bk ipute t, the projection of c onto span(B), and the scalar value t = hb
∈ R.
,b i
k

k

2. Choose an integer z ← DZ,s/kbk k,t .
3. Output z · bk + SampleD(B0 , s, t − z · bk ) via recursion, where B0 = {b1 , . . . , bk−1 }.
Informally, SampleD samples from a k-dimensional lattice by: (1) sampling a (k − 1)dimensional hyperplane containing a (k − 1)-dimensional sublattice of L according to a
1-dimensional Gaussian distribution, and then (2) sampling a lattice point from this hyperplane. In terms of proving that this algorithm outputs according to the desired distribution,
one relevant fact is that an n-dimensional Gaussian distribution is equivalent to the direct
product of n 1-dimensional Gaussian distributions, each along orthogonal axes parallel tothe respective vectors bk . Another relevant fact is that the weight allotted to each hyperplane in the discrete Gaussian distribution is indeed proportional (up to a negligible factor)
to the weight that the hyperplane would receive in a continuous Gaussian distribution. Gentry et al. prove this fact using the smoothing parameter – i.e., s is large enough to makethe “discreteness” of the points on the hyperplane irrelevant. See [49] for more details.

13.4

Ideal Factorization in Polynomial Rings

Unique factorization of ideals does not necessarily hold for R = Z[x]/(f (x)). Rather, uniquefactorization of ideals holds for the ring of integers OK = {x ∈ K : fQx ∈ Z[x]}, where K is
the field Q(x)/(f (x)), and fQx is the monic irreducible minimal polynomial of x over Q. The
ring R is sometimes called an order or a number ring. The ring of integers is the maximal
order; it is a ring that contains R. However, the nice algebraic properties of OK , such as
unique factorization, carry over to R modulo some badness that arises from primes that
divide the index [OK : R].

CHAPTER 13. BACKGROUND ON IDEAL LATTICES II

130

For general number rings R, a prime ideal p is an ideal that is proper (i.e., does notcontain all of R) and such that for any ideals I and J with I · J ⊆ p, it holds that I ⊂ p
or J ⊂ p. Every prime ideal is maximal – i.e., there is no ideal I for which p ⊂ I ⊂ R,
where the inclusions are proper. The norm of an ideal I, Nm(I), is the index [R : I]. When
R = Z[x]/(f (x)) and the lattice associated to R is simply Zn , we have that Nm(I) = det(I).
For any prime ideal, the norm is a prime integer power.
For R = Z[x]/(f (x)) and any prime integer p, there is an efficient algorithm to find allof the prime ideals in R with norms that are a power of p. It uses the following theorem.
Theorem 13.4.1 (Kummer-Dedekind, as given in [127]). Consider the factorization f (x) =Qei
i gi (x) mod p for prime integer p. The prime ideals pi ∈ Z[x]/(f (x)) whose norms are
powers of p are precisely
pi = (p, gi (x))
The inclusionQei
i pi ⊂ (p) is an equality iff all pi are invertible.

There are polynomial time algorithms for factoring polynomials in Zp [x] – e.g., by
Kaltofen and Shoup [75].
For ideal I ⊂ R, the fractional ideal I −1 is {x ∈ K = Q(x)/(f (x)) : ∀y ∈ I, x × y ∈ R}.
I is said to be invertible if I · I −1 = R. Not all ideals are invertible; a non-invertible
ideal is said to be singular. As an example (from [127]), consider the ring Z[x]/(x2 + 3)
and the ideal I = (1 + x, 1 − x). I 2 is generated by (1 + x)2 = 2x − 2 mod x2 + 3,
(1 + x)(1 − x) = 4 mod (x2 + 3), and (1 − x)(1 − x) = −2x − 2 mod x2 + 3, and therefore
I 2 = 2 · I. Since I 6= (2), it is clear that I is not invertible. The norm of an ideal, defined as
its index in the ring, is a multiplicative map over invertible ideals. However, for a singular
ideal one can have a situation where [R : I]2 6= [R : I 2 ] – e.g., for I = (1 + x, 1 − x) inZ[x]/(x2 + 3), we have [R : I] = 2 and [R : I 2 ] = 8. In general, the norm of a product ofideals is at least the product of the norms. All principal ideals are invertible.
However, only a small number of prime ideals are singular. All such prime ideals havenorm pe for some prime integer p that divides [OK : R], and it is straightforward to place
an upper bound on this index. Specifically, let ∆(f ) be the discriminant of f (x), and ∆K
be the discriminant of the number field K = Q(x)/(f (x)), and Res(f, f 0 ) be the resultant

CHAPTER 13. BACKGROUND ON IDEAL LATTICES II

131

of f (x) and its derivative. All of these terms are integers, and we have∆(f ) = [OK : R]2 · ∆K= (−1)n(n−1)/2 · Res(f, f 0 )Viewing Res(f, f 0 ) as the determinant of the Sylvester matrix associated to f and f 0 , it iseasy to see that |Res(f, f 0 )| is bounded by nn kf k2n , where kf k is the Euclidean length ofthe coefficient vector associated to f . (Note that our suggested method of selecting f (x)in Chapter 7.4 already places a polynomial bound on kf k.) We can bound the numberof primes that divide |Res(f, f 0 )|, and hence [OK : R], by O(n(log n + log kf k)). Singularprimes are “rare,” and we can easily detect and discard them using Dedekind-Kummer.
(See [127] for a survey on general number rings and more details on these issues.)
While ideals I that are divisible by singular primes may not have unique factorization,
at least there is no “bad interaction” between ideals that are relatively prime (i.e., have no
Q
R/I(p) ,common prime ideal divisors). In particular, one has the isomorphism R/I ∼=p⊃I

where I(p) is the p-part associated to I. For example, if I has norm 15, it can always be
uniquely decomposed as the product of two ideals I3 and I5 such that Nm(I(3) ) = 3 andNm(I(5) ) = 5. In particular, I3 = I + (3) – the sum of the ideals I and (3); similarly forI5 . In general, if I’s norm is divisible by pei i , then I’s “pi -part” is simply I + (pei i ) and has
Qnorm pei i . The following equation of ideals holds: I = i (I + (pei i )). Also, if Nm(I) andNm(J) are relatively prime, then Nm(I · J) = Nm(I) · Nm(J).

Chapter 14

The Somewhat Homomorphic
Scheme Revisited
In this Chapter, we revisit the somewhat homomorphic ideal lattice based scheme describedin Chapters 5 and 7. Our objective is to obtain a security proof based on a weaker assumption. Toward that goal, we use this Chapter to describe some different methods to generate
the ideal I and to instantiate the algorithm Samp, which is used in Encrypt to sample fromπ + I. We also provide some security reductions for this revised scheme.

14.1

Using Gaussian Sampling in Encrypt

Briefly, we recall the suggestions for instantiating I and Samp in the initial construction.
Recall that IdealGen ensures that I and J are relatively prime. The suggestion was to picka short generator s ∈ I. Then, Samp outputs π + s × t, where t ∈ R is a short vector output
by algorithm Samp1 .
The image of our original version 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. Our
new instantiation of Samp uses the GPV SampleD algorithm, described in Chapter 13.3, toobtain a distribution that is “nicer” and simpler to analyze.
Samp(BI , π} outputs π + SampleD(BI , s, −π) (where s is a global parameter of the system).
As we learned in Chapter 7, it is straightforward to generate BI such that kBI k =√poly(n). Since the GPV algorithm only requires that s = kBI k · ω( log n) (see Lemma
132

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

133

13.1.1), we can also take s = poly(n), and by Lemma 13.2.2, the sampled vector (and hence√rEnc ) is longer than s · n with only negligible probability.

14.2

Generating an Ideal with Very Small Norm

For one of our reductions – namely, the Hensel lifting one described in Chapter 14.5 – weneed a stronger requirement on I – namely, that det(I) be polynomial in n; otherwise,
the reduction is inefficient. Restricting I’s determinant to be small will allow us to based
security on search BDDP, essentially by using a “brute-force” search over the det(I) cosetsof I (in R); for this reduction to be efficient, det(I) must be polynomial in n. One downsideof this approach is that it restricts the plaintext space rather severely. Also, it makes thegeneration of I conceptually more complex; we cannot simply set I to be (m) for small
integer m, because (given that R = Z[x]/(f (x)) for f (x) of degree n) the ideal (m) has mn
cosets. The bottom line here is that, to get our Hensel lifting reduction to work, we needto demonstrate two things: 1) if R has an ideal I of norm poly(n), then there is an efficientalgorithm that outputs a basis BI of I such that kBI k = poly(n); and 2) R = Z[x]/(f (x))
does indeed have an ideal of norm poly(n) as long as f (x) satisfies certain conditions (which
it will already satisfy if f (x) was selected as suggested in Chapter 7.4). We address the firstissue first.
Suppose R has an ideal I with m ← det(I) = poly(n); how do we generate a basis of
an ideal that has norm m (either I or some other ideal with norm m)? First, we factor m:
Q
suppose m = i pei i . Next, for each i, we find bases BIi of ideals Ii that have norm pei i . We
Q
set I = i Ii , and we can compute a preliminary basis B0I of I from the bases BIi . Finally,
we set BI to the the Hermite normal form of L(B0I ). It remains to explain why this gives
the desired output.
Recall the basic algebraic fact (see Chapter 13.4) that I =Qeii (I + (pi )), and the fact

that, if Nm(I) and Nm(J) are relatively prime, then Nm(I ·J) = Nm(I)·Nm(J). From this,Q
we know that if there is an ideal I in R with norm i pei i , then the ideal I + (pei i ) has norm
pei i . To find such an ideal, we use Kummer-Dedekind in connection with a polynomial timealgorithm for factoring polynomials in Fpi [x] to obtain all prime ideals whose norms are
powers of pi , and find a product of them whose norm is pei i ; let this be Ii . Given bases BI
and BJ for ideals I and J, one can efficiently compute a basis for the product I · J simply
by computing the set of vectors {u × v : u ∈ BI , v ∈ BJ }, and then reducing this set to n

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

134

vectors (eliminating the linear dependencies) by applying a lattice reduction algorithm suchas LLL [81]. Given the initial basis B0I of I, computing I’s Hermite normal form (HNF) BIQ
is efficient. In BI , which has positive diagonal entries m1 , . . . , mn with i mi = m, the ithPbasis vector has length at most mi + j>i bmj /2c, which is at most m = poly(n).
Now, we need to explain why R = Z[x]/(f (x)) does indeed have an ideal of normpoly(n) as long as f (x) satisfies certain conditions. When f (x) is such that Q(x)/(f (x))
is an abelian extension of Q – e.g., when f (x) is a cyclotomic polynomial – then we can
invoke the following theorem.
Theorem 14.2.1 (Theorem 8.7.7 of [10]). Assume GRH. Let K/E be a proper abelian
extension of number fields with a conductor f. Let ∆ denote the discriminant of E. Then
there is a degree 1 prime ideal p of E that does not split in K, relatively prime to ∆ and f,
satisfying Nm(p) = O((log |∆| + log |Nm(f|)2 ). The constant implied by “O” is absolute.
∆ and the norm of the conductor f each divide ∆(f ), the discriminant of f (x), so wehave Nm(p) = O((log |∆(f )|)2 ). As discussed in Chapter 13.4, ∆(f ) is bounded by nn kf k2n ,where kf k is the Euclidean length of the coefficient vector of f (x), and therefore Nm(p)is polynomial in n as long as kf k is polynomial in n. In Chapter 7.4, we suggested amethod for choosing f (x) so as to minimize γMult (R); polynomials f (x) chosen according
to this method already satisfy kf k = poly(n). Note that the relative primeness property in
Theorem 14.2.1 implies that I will be an invertible ideal in R (see Chapter 13.4).
Rather than fixing f (x) and afterwards finding an ideal in R = Z[x]/(f (x)) with small
norm, one can instead choose f (x) and I together. For example, we can select f (x) as
follows. Select a prime p, a linear polynomial (x − b), and a monic polynomial g(x) ofdegree n − 1 such that (x − b)g(x) has only lower-order terms – e.g., the coefficient of xi in(x − b)g(x) is 0 for i ∈ (n/2, n − 1], like the values of f (x) that we suggested in Chapter
7.4. Set f (x) ← (x − b) · g(x) mod p – i.e., reduce the nonzero coefficients of (x − b) · g(x)so that they have magnitude at most p/2. Then, f (x) factors modulo p into factors that
include the linear polynomial x − b, and therefore R = Z[x]/(f (x)) (by Theorem 13.4.1) has
an ideal of norm p. If p happens to divide [OK : R], one samples again. The probability
that p divides [OK : R] is not overwhelming. If p divides [OK : R], then it divides ∆(f )and also Res(f, f 0 ), where f 0 is the derivative of f (x). This only happens when f (x) andf 0 (x) have a common root modulo p.

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

14.3

135

Proof of Security Based on the Inner Ideal Membership
Problem (IIMP)

We base the security of our encryption scheme, when using GPV sampling in Encrypt as
described above, directly on the following problem.
Definition 14.3.1 (Inner Ideal Membership Problem (IIMP)). Fix ring R, basis BI of
an ideal I ⊂ R, and algorithm IdealGen as in the scheme. Fix a positive real sIIMP . The
RR

pkchallenger sets (Bsk
J , BJ ) ← IdealGen(R, BI ). The challenger flips a bit b ← {0, 1}. If b = 0,RR

it sets x ← DI,sIIMP ,0 . If b = 1, it sets x ← DR,sIIMP ,0 . It sets t ← x mod Bpk
J . The problem
is: given (Bpk
J , t) (and the fixed values), output b.
Basically, the IIMP is like the IMP (discussed in Chapter 3) – i.e., does x belong to the“inner” ideal I? – but the instance is perturbed by the “outer” ideal J.
√
Theorem 14.3.2. Let sIIMP = s/ 2, where s is the Gaussian deviation parameter in the√encryption scheme E described in Chapter 14.1, and suppose that sIIMP / 2 exceeds thesmoothing parameter of I – i.e. ρ√2/sIIMP (I −1 /{0}) is negligible. Suppose that there is analgorithm A that breaks the semantic security of E with advantage ². Then, there is analgorithm B, running in about the same time as A, that solves the IIMP with advantage ²/2(up to negligible factors).
Proof. The proof is almost a tautology, the only wrinkles being technical issues relating toGaussian distributions. The basis Bpk
J was generated by the challenger using the actual
KeyGen algorithm, so B can use it as a properly distributed public key pk to give to A.
When A requests a challenge ciphertext on one of π0 , π1 in the plaintext space R mod BI ,RR

B sets β ← {0, 1}, and v ← DI,sIIMP ,−πβ . It sends ψ ← πβ + t + v mod Bpk
J to A. A sends
back a guess β 0 . B sends b0 ← β ⊕ β 0 to the challenger.
When b = 0, B’s simulation is almost perfect. In the real world, ψ is chosen according
to the distribution πβ + DI,s,−πβ (and then reducing modulo Bpk
J ). In the simulation, ψequals πβ + t + v = πβ + x + v mod Bpk
J . In other words, the simulated distribution
is πβ + DI,sIIMP ,−πβ + DI,sIIMP ,0 (and then reducing modulo Bpk
J ). By Lemma 13.2.7, thestatistical difference between DI,s,−πβ and DI,sIIMP ,−πβ + DI,sIIMP ,0 is negligible. (Essentially,
this is because the sum of two Gaussians is another Gaussian, even in the discrete setting,up to small error.) Therefore, when b = 0, A’s advantage is ² by assumption, up to anegligible additive factor.

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

136

When b = 1, the challenger chose x according to DZn ,s,0 . From Lemma 13.2.4, itRfollows that this distribution is statistically equivalent to setting y ← R mod BI and thengenerating x according to y + DI,s,−y . Thus the challenge ciphertext comes from the
distribution πβ + DI,t,−πβ + y + DI,s,−y , where y is uniformly random modulo I. But,
by Lemma 13.2.7, this distribution is statistically equivalent to z + DI,r,−z for z uniformly
random modulo I. This implies that B’s challenge ciphertext is (essentially) independentof the bit β, and that A therefore has negligible advantage in this case.
Overall, B’s advantage is ²/2, up to negligible factors.

14.4

Success Amplification: Proof of Security Based on the
Modified IIMP (MIIMP)

The IIMP is “very average-case” in that it depends on Gaussian distributions and the
distribution induced by IdealGen. Since the problem looks almost like the semantic security
game, the proof of Theorem 14.3.2 is almost a tautology.
In the following problem, we permit more freedom in how x, and hence the target vectort, is chosen. We also amplify the success probability (over values of x) to be overwhelming
for a certain fraction of keys output by IdealGen.
Definition 14.4.1 (Modified Inner Ideal Membership Problem (MIIMP)). Fix ring R, basis
BI of an ideal I ⊂ R, and algorithm IdealGen as in the scheme. Fix a positive real sMIIMP .
R

R

pk
The challenger sets (Bsk
J , BJ ) ← IdealGen(R, BI ). The challenger flips a bit b ← {0, 1}. If

b = 0, it sets x however it likes, except x ∈ I and kxk < sMIIMP . If b = 1, it does the samepk
thing, except x ∈/ I. It sets t ← x mod Bpk
J . The problem is: given (BJ , t) (and the fixedvalues), output b.
Theorem 14.4.2. Suppose that sMIIMP < sIIMP · ²/(n · max{kBI k}). Suppose also that
[R : I] is prime. Suppose that there is an algorithm A that solves the IIMP with advantage². Then, there is an algorithm B that, for a ²/2 (weighted) fraction of bases Bpk
J output byIdealGen, solves the MIIMP with overwhelming probability. B’s running time is proportional
to 1/² times the running time of A.
Notice that the success amplification in MIIMP came at a cost: sMIIMP is less than ²·sIIMP– i.e., the MIIMP-solver requires t to be much closer to the ideal lattice J. Similarly, theCHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

137

running time is much higher. However, the reduction is polynomial when the IIMP solver
has non-negligible advantage.
Proof. Let ²BJ be A’s advantage given that Bpk
J is chosen. Let S be the set of bases forwhich ²BJ exceeds ²/2. By a standard averaging argument, the probability that an ideal in
S is chosen is at least ²/2. From now on, suppose Bpk
J ∈ S.

R

B receives a MIIMP instance t (along with the fixed values). It sets u ← R mod BI . ItR

pk 0
sets x0 ← u × t + DI,sIIMP ,0 and t0 ← x0 mod Bpk
J . It sends (BJ , t ) as the instance of IIMP

to A. A sends back a bit b0 , which A forwards to the challenger.
R

Recall that in the IIMP problem, when b = 0, the challenger sets x0 ← DI,sIIMP ,0 , sets
pk 0
pkt0 ← x0 mod Bpk
J , and sends (BJ , t ). We claim that, up to the reduction modulo BJ , B

generates x0 according to a nearly identical distribution. In particular,Rpk
x0 ← u × t + DI,sIIMP ,0 ∼= u × x + DI,sIIMP ,0 ∼= DI,sIIMP ,u×x mod BJ

where u and x are very short, and the product is in I. Since the reduction modulo Bpk
Jcannot increase the statistical difference between the distributions (real and simulated)according to which x0 is generated, it suffices to upper bound the statistical difference
introduced by translating the distribution DI,sIIMP ,0 by u × x. Note that sIIMP exceeds thesmoothing parameter of I. Also, since an n-dimensional Gaussian is a product of n 1dimensional Gaussians, and the translation occurs only in the direction of u × x, it suffices
to consider the statistical difference by translating a 1-dimensional Gaussian. One can showthat the statistical difference is at most ²/4 when ku × tk is less than sIIMP · ²/4. .
When the challenger’s bit is 1, the situation is analogous, except that B simulates
sampling from DR,sIIMP ,0 by choosing u randomly modulo I and sampling from u × t +pk
DI,s ,0 ∼/ I. Since [R : I] is prime, implying the= u × x + DI,s ,0 mod b , where x ∈
IIMP

IIMP

J

ideal (x) is relatively prime to I, and since u is uniform modulo I, the simulated distribution
is statistically equivalent.
So, A’s advantage for B’s IIMP instance is at least ²/2 − ²/4 = ²/4. With θ(1/²) calls
to A, B can solve its MIIMP instance with constant probability, and can make its successprobability arbitrarily close to 1 with more calls.

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

14.5

138

Basing Security on a Search Problem: Bounded Distance Decoding Via Hensel Lifting

Here, we reduce a search problem (BDDP) to a decision problem (MIIMP). To be efficient,
this is reduction requires [R : I] = poly(n).
Definition 14.5.1 (I-Hybrid Bounded Distance Decoding Problem (HBDDP)). Fix ringR, basis BI of an ideal I ⊂ R, and algorithm IdealGen as in the scheme. Fix a positive real
R

pk
sHBDDP . The challenger sets (Bsk
J , BJ ) ← IdealGen(R, BI ). The challenger sets x subject

to the constraint that kxk < sHBDDP and sets t ← x mod Bpk
J . The problem is: given(Bpk
J , t) (and the fixed values), output x.
√
Theorem 14.5.2. Suppose sHBDDP ≤ (sMIIMP −2n·kBI k)/(γMult (R)·( n/2)). Suppose that
there is an algorithm A that, for a ² (weighted) fraction of bases Bpk
J output by IdealGen,
solves the MIIMP with overwhelming probability. Then, there is an algorithm B that, fora ² (weighted) fraction of bases Bpk
J output by IdealGen, solves HBDDP with overwhelming
probability. B’s running time is only polynomially larger than that of A, as long as [R :I] = poly(n).
Essentially, the reduction B works by invoking A repeatedly to recover x mod I k forincreasingly large k – in effect, a Hensel lift, but with geometric aspects, since B must
construct valid MIIMP instances. Specifically, in the kth iteration, the MIIMP target
vector tk must actually be close to the lattice J. Once the method recovers the value of x
modulo I k for sufficiently large k, we can use LLL (more properly, Babai’s algorithm for
CVP) to recover x from x mod I k .
More specifically, in the first iteration of the Hensel lift, algorithm B has t = x mod Bpk
J
and wants to find x mod BI . For this, B we can use a MIIMP-solver A as follows. It gives t
to A; if A responds ‘0’ – i.e., that the underlying value of x is in I – then B has its answer.
Otherwise, it picks some nonzero u ∈ R mod BI , and give t0 ← t − u to A. Assuming that
this is a valid MIIMP instance, A returns ‘0’ precisely when x = u mod BI . In this fashion,
B searches through the cosets of I until A indicates that it has found the coset containing
x. For this part to be efficient, we require det(I) to be polynomial in n. Let r0 ∈ R mod BI
be such that x ∈ r0 + I. The value r0 is certainly useful information in our search for x,
but obviously it is not enough information to allow us to recover x completely. We would
like to recover the value of x modulo a much higher power of I.

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

139

How do we perform the next iteration in the Hensel lift? Conceptually, we would liketo give our MIIMP-solver A an instance that is somehow related to (x − r0 )/I, but what
does this mean in practice? Of course, B has t, not x, and t − r0 is not necessarily in I.
However, J is relatively prime to I; thus, we can find v0 ∈ J such that t − r0 − v0 ∈ I.
This vector will have the form v + (x − r0 ), where v ∈ IJ and x − r0 ∈ I. We then “divideby I” by multiplying by some vector a ∈ I −1 \ R; our next MIIMP instance is essentiallyt1 ← a × (t − r0 − v0 ). This equals a × (v + (x − r0 )) = (a × v) + a · (x − r0 ), wherea × v ∈ J (since v ∈ IJ), and the new “error” vector a · (x − r0 ) is in R, and is also still very
short if a is a suitably short vector. In other words, t1 becomes a new, potentially valid
MIIMP instance. To perform the Hensel lift, we will recursively generate MIIMP instances
tk that will allow us to recover x modulo higher powers I k . However, how do we ensurethat a is a very short vector in I −1 \ R? We know that R is a sub-lattice of I −1 ; therefore,
given any single vector in I −1 \ R, we can reduce it modulo the ideal (1) to obtain a vector√
whose length is no more than n/2. Extending this approach to later iterations in themost obvious way would involve using powers a, which would be quite long even though ais short; addressing this problem involves additional subtleties. The detailed proof is below.
Proof. B is given a HBDDP instance t. B’s goal is to return x, where t − x is the closest
J-vector to t.
For i = 0 to m (for m to be determined), B does the following. At the beginning of
iteration i, B has values ti and ri . It initializes t0 ← t and r0 ← 0. We will let xi denotethe implicit unknown vector such that ti − xi is the closest J-vector to ti .
B also uses some values that can be set independently of the ti ’s and ri ’s:• ai is a short vector in I −i \ I −i+1i
i+1
• bi ∈ R \ I is a vector such that bi × a−1
i ∈I \Ii+1 ∈ R• ci = b−1
i mod I

It uses a0 = 1. Note that, since R is a sub-lattice of I −i , it is easy to compute a vector√ai ∈ I −i \I −i+1 of length at most n/2 from any vector in I −i \I −i+1 by reducing it modulo
the cube generated by the vector 1.
For all i, we claim that the following invariants will hold:
1. ri = x mod I i

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

140

2. ti ∈ R with xi = ai × x − (ai × ri mod BI )The parenthesized term (ai × ri mod BI ) means that it is reduced modulo BI before interacting with other terms. The invariants clearly hold for i = 0.
0
For u ∈ R mod BI , B sets t0i ← ti −u mod Bpk
J and gives ti to A as its MIIMP instance.

Assuming t0i is a valid instance of MIIMP, A responds by telling B whether or not xi −u ∈ Iwith probability arbitrarily close to 1. B thereby discovers the value of ui ← xi mod BI intime linear in [R : I].
B then setsri+1 ← ri + ci × bi × ai−1 × ui
ti+1 ← ai+1 × (t0 − vi+1 ) − (ai+1 × ri+1 mod BI )where vi+1 ∈ J ∩ (t0 − ri+1 + I i+1 ). (Such a vi+1 exists because I and J are relatively
prime.)
Assume that the invariants hold for i; we show that they hold for i + 1.
From the second invariant for i, we conclude that the values t0i used by B are indeed valid√
MIIMP instances, since max{kxi k + kuk} ≤ γMult (R) · ( n/2) · kxk + 2n · kBI k, as required.
Then, assuming A’s response ui is correct (as it should be with probability arbitrarily closeto 1), and using our assumption above that xi = ai × x − (ai × ri mod BI ), we have thatui = ai × (x − ri ) mod I
Multiplying by a−1
i , then bi , then, ci , we obtain−1
x = ri + a−1
i × ui mod I · (ai )i+1
bi × x = bi × ri + bi × a−1
i × ui mod I
i+1
x = ri + ci × bi × a−1
i × ui mod I

implying that ri+1 is correct.
As for ti+1 , consider the vectort†i+1 ← ai+1 × (t0 − vi+1 − ri+1 ) = ai+1 × ((t0 − vi+1 − x) + (x − ri+1 ))This vector is in R, since both t0 − vi+1 − x and x − ri+1 are in I i+1 ; canceling theCHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

141“denominator” of ai+1 . We have that ti+1 − t†i+1 = ai+1 × ri+1 − (ai+1 × ri+1 mod BI ) ∈I ⊂ R. Since t†i+1 −ai+1 ×(x−ri+1 ) ∈ J, the vector ti+1 −ai+1 ×x+(ai+1 ×ri+1 mod BI ) ∈ J,
as required.
Finally, we describe how to recover x from x mod I m for large-enough m. Babai’s
algorithm can recover x from x + I m when x is exponentially (in n) shorter than any othervector in x + I m ; so, it suffices to show that the λ1 (I m ) grows exponentially with m. Let
vm ∈ I m be such that kvm k = λ1 (I m ). Also, assume that the ring R has no zero-divisors,
implying that for any v ∈ R, the vectors {v × xi : i ∈ [0, n − 1]} are linearly independent.
We havedet(I m ) ≤n−1
Ykvm × xi k ≤ γMult (R)n−1 kvm kn

i=0

which implies that
λ1 (I m ) ≥ (det(I))m/n /γMult (R)14.6

Toward Reducing the SIVP to the BDDP: Regev’s Quantum Reduction

Here we base the security of our scheme on the following problem.
Definition 14.6.1 (Ideal Independent Vector Improvement Problem (IVIP)). Fix ring R
and a positive real sIVIP . Let BJ be a basis for an ideal lattice J of R. The problem is:given BJ (and the fixed values), output an independent set BJ −1 of the fractional ideal J −1
such that kBJ −1 k ≤ 1/sIVIP .
Since J is an integer (non-fractional) ideal of R, we know that R (i.e., Zn ) is a sub-latticeof J −1 . Therefore, we “trivially” know the independent set {ei } of J −1 . When sIVIP > 1,
the IVIP asks one to “improve” upon this trivial independent set. We have the following
theorem.
Theorem 14.6.2. Let J be an ideal lattice in R. Suppose sIVIP ≤ sHBDDP /(n1.5 · kf k) andsHBDDP ≤ λ1 (J)/2. Suppose that there is a classical algorithm A that solves sHBDDP -HBDDPCHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

142

for J (with probability 1). Then, there is a quantum algorithm B that solves sIVIP -IVIP for
J.
Actually, “hybridness” of the hybrid BDDP does not manifest itself in Theorem 14.6.2,
since the ideal J is fixed. For every algorithm IdealGen that generates J according tosome distribution, we can say that IVIP for that distribution reduces to HBDDP for that
distribution. So, this reduction will also be useful for reducing worst-case IVIP to worst-case
BDDP.
The proof of Theorem 14.6.2 invokes the following lemma by Regev [119].
Lemma 14.6.3 (Lemma 3.13 in [119]). Let L be an n-dimensional lattice and assume that
there exists an oracle that answers CVPL,d (the target vector’s distance from L is boundedby d) queries for some d < λ1 (L)/2. Then, there exists a quantum algorithm for samplingfrom the distribution DL∗ ,√n/d .
Notice that Regev’s reduction is not exactly from the SIVP, since the vectors output
by the sampling algorithm, which by Lemma 13.2.2 will be of length less than n/d withoverwhelming probability, are not necessarily short relative to the shortest vectors in L∗ .
We prefer to think of Regev’s reduction as being more analogous to the IVIP, since when L
is an integer lattice, it outputs an independent set of L∗ that is better than the trivial set{ei } when n/d < 1.
Proof. (Theorem 14.6.2) Algorithm A solves CVPJ,sHBDDP by assumption. So, by Lemma
14.6.3, there is a quantum algorithm that samples from the distribution DJ ∗ ,√n/sHBDDP .
√√We have n/sHBDDP ≥ 2 n/λ1 (J) ≥ 2λn (J ∗ ) (the latter inequality by transference
theorems for general lattices). Let v be the shortest nonzero vector in J ∗ . There is a nonnegligible probability that a vector drawn according to the distribution above is a nonzero
vector. By Lemma 13.2.3, the probability that a vector longer than n/sHBDDP is drawn isnegligible.
Let w ∈ J ∗ be a vector of length at most n/sHBDDP drawn by Regev’s algorithm. By
Lemma 8.1.2, we can use w to generate an independent set BJ −1 of J −1 with kBJ −1 k ≤√n · kf k · kwk ≤ n1.5 · kf k/sHBDDP .

Interestingly, we do not need to use Regev’s algorithm to generate an independent setof J ∗ . We only need the algorithm to generate a single vector of J ∗ , which we can use toCHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

143

generate an independent set of J −1 .

14.7

Summary of Security Results for this Construction So
Far

Collecting Theorems 14.3.2, 14.4.2, 14.5.2 and 14.6.2, we have the following corollary.
Corollary 14.7.1. Suppose thatsIVIP ≤ sHBDDP /(n1.5 · kf k)√sHBDDP ≤ (sMIIMP − 2n · kBI k)/(γMult (R) · ( n/2))
sMIIMP < sIIMP · ²/(n · max{kBI k})√sIIMP = s/ 2
where s is the Gaussian deviation parameter in the encryption scheme E described in Chapter 14.1. Also suppose that s/2 exceeds the smoothing parameter of I, that IdealGen always√
outputs an ideal J with s· n < λ1 (J), and that [R : I] is prime. Finally, suppose that there
is an algorithm A that breaks the semantic security of E with advantage ². Then, there is aclassical algorithm B1 that solves sHBDDP -HBDDP for an ²/4 (up to negligible factors) weightfraction of bases output by IdealGen. The running time of B1 is O([R : I] · (1/²) · time(A)).
Also, there is a quantum algorithm that solves sIVIP -IVIP for an ²/4 (up to negligible factors)
weight fraction of bases output by IdealGen.

14.8

Looking Forward

So far, we have managed to base the security of our revised initial construction on averagecase IVIP – average-case in the sense that the IVIP instance depends on the average-case
distribution induced by the algorithm IdealGen. This is quite nice; IVIP is closely related
to SIVP (a natural hard problem over lattices), and it is certainly not uncommon for acryptosystem to be based on the average-case hardness of the underlying hard problems –i.e., the assumption is that the problem is hard over a sampleable distribution of instances.
All other things being equal, however, it would be preferable to base the security on thehardness of solving worst-case instances of the problem. Ajtai [2] established that, for certain
lattice problems (e.g., SVP), one can reduce worst-case instances to average-case instances,

CHAPTER 14. THE SOMEWHAT HOMOMORPHIC SCHEME REVISITED

144

though the approximation factor in the worst-case instance is larger by a factor polynomial
in n. The possibility of using such a worst-case / average-case connection, thereby basing
security on worst-case hardness, is part of the appeal of lattice-based cryptography.
Over the next few Chapters, we will describe an IdealGen algorithm that generates
a “nice” average-case distribution of “random” ideal lattices. We will also describe how
to “randomize” a worst-case BDDP instance over ideal lattices to obtain an average-caseinstance according to the same average-case distribution generated by IdealGen – i.e., we
describe a worst-case / average-case reduction. Our worst-case / average-case reduction isqualitatively different from previous ones, including such reductions involving ideal lattices[98, 111, 112, 88, 99]. Most notably, unlike previous examples, our worst-case and averagecase lattice problems are over lattices of the same dimension. This average-case / worst-caseconnection is rather technical, and requires us to closely consider the distribution of ideals
in number rings. We provide some background on these issues in the next Chapter.

Chapter 15

Background on Ideal Lattices III
15.1

Lemmata Regarding Vectors Nearly Parallel to e1

In some of our reductions, and also in our instantiation of IdealGen, we will generate a vectorv ∈ t · e1 + B(s) where s is much smaller than t – i.e., v is “nearly parallel” to e1 .
Since such a v is very close to being simply the scalar t, we would expect v to behave
almost like a real number, and the lattice (v) to behave almost like a scaling of Zn . The
following lemmata characterize this intuition more formally. These lemmata apply to v ∈Q[x]/(f (x)).
The first lemma basically says that if v is nearly parallel to e1 , then it is within a small
factor of being the shortest nonzero vector in the lattice (v).
Lemma 15.1.1. Let v = e1 + u. Then, λ1 ((v)) ≥ 1 − γMult (R) · kuk.
Proof. Let a ∈ (v) \ 0. Then, there is some vector b ∈ R \ 0 such that a = b × v. We have
kak = kb + b × uk
≥ kbk − γMult (R) · kbk · kuk≥ kbk · (1 − γMult (R) · kuk)
≥ 1 − γMult (R) · kuk

We have a similar statement regarding λn ((v)).

145

CHAPTER 15. BACKGROUND ON IDEAL LATTICES III

146

Lemma 15.1.2. Let v = e1 + u. If the ring R has no zero divisors, then λn ((v)) ≤1 + γMult (R) · kuk. In particular, this upper bound holds for the linearly independent vectors{v × xi : i ∈ [0, n − 1]}.
Proof. For the rotation basis {v×xi : i ∈ [0, n−1]} of (v), we have kv×xi k = kei +u×xi k ≤1 + γMult (R) · kuk.

When we sample a vector v according to the Gaussian distribution DZn ,s,t·e1 , we would
like to say that, for well-chosen s and t, v is the only vector (v) that is contained in the√ball t · e1 + s nB, and that actually the weight of the Gaussian distribution is negligible
over (v) \ {v}.
Lemma 15.1.3. Let v = e1 + u with kuk = 1/(δ · γMult (R)) for δ > 3 and γMult (R) > 1.
Then, v is the only vector in (v) that is within a distance of ((δ − 2)/δ) of e1 .
Proof. By Lemma 15.1.1,
λ1 ((v)) ≥ 1 − γMult (R) · kuk = 1 − 1/δ
Therefore, any vector in (v) other than v is at least(1 − 1/δ) − 1/(δ · γMult (R)) > (δ − 2)/δaway from e1 .

The next two lemmas say that if v is close to 1, then so is its inverse, and, in fact,
inversion nearly preserves distance from 1 in a way that also preserves certain Gaussianquantities.
Lemma 15.1.4. If kuk < 1/γMult (R), thene1 /(e1 − u) = e1 + u + x for kxk ≤γMult (R) · kuk2
1 − γMult (R) · kuk

Proof. Since kuk < 1/γMult (R), we have that
lim kuk k ≤ lim γMult (R)k−1 kukk = 0

k→∞

k→∞

CHAPTER 15. BACKGROUND ON IDEAL LATTICES III

147

Thus, e1 /(e1 − u) = e1 + u + u2 + · · · . The length of this vector’s difference from e1 + u is
at most:γMult (R) · kuk2 + γMult (R)2 · kuk3 + · · · =γMult (R) · kuk2
1 − γMult (R) · kuk

Lemma 15.1.5. Let v = e1 + u and w = 1/v (the inverse in Q(x)/((f (x))). Suppose
kuk ≤ 1/2γMult (R) and kuk3 ≤ β · σ 2 /γMult (R). Thenρσ,e1 (w)/ρσ,e1 (v) ∈ [e−6β·π , e6β·π ]Proof. Let x be such that w = e1 − u + x. By Lemma 15.1.4,
kxk ≤γMult (R) · kuk2
1 − γMult (R) · kuk

We have2

ρσ,e1 (w)e−πk(−u+x)k /σ=
ρσ,e1 (v)e−πkuk2 /σ22This latter quantity is clearly in the intervalhi22e−πkxk(2kuk+kxk)/σ) , e−πkxk(−2kuk+kxk)/σ
We claim that the magnitude of the exponents in the left and right terms is small. In
particular, we haveÃ

πkxk(2kuk + kxk)/σ22γMult (R) · kuk3
γMult (R)2 · kuk4
≤ π·σ ·+
1 − γMult (R) · kuk (1 − γMult (R) · kuk)2³´≤ π · σ −2 · 4γMult (R) · kuk3 + 4γMult (R)2 · kuk4!

−2

≤ 4β · π + 4β · π · γMult (R) · kuk≤ 6β · π

The next lemma states that if v is very close to t · e1 , then the determinant (or norm)

CHAPTER 15. BACKGROUND ON IDEAL LATTICES III

148

of (v) is close to tn .
Lemma 15.1.6. Let v = e1 + u. Then, det(v) ≤ en·γMult (R)·kuk . If kuk ≤ 1/n · γMult (R),
we obtain 1/3 ≤ det(v) ≤ e.
Proof. We know that det((v)) is the volume of the rotation basis of v. So,det((v)) ≤n−1
Y

kv × xi k ≤ (1 + γMult (R) · kuk)n ≤ en·γMult (R)·kuk .

i=0

Now suppose kuk ≤ 1/n · γMult (R); then, the term on the right is simply e. Also, from
Lemma 15.1.4, we know thatw ← e1 /v = e1 − u + x for kxk ≤1γMult (R) · kuk2≤
1 − γMult (R) · kuk(1 − 1/n) · n2 · γMult (R)Since k − u + xk ≤ (1 + 1/(n − 1))/n · γMult (R),det((1/v)) ≤ e1+1/(n−1) =⇒ det((v)) ≥ e−1−1/(n−1) ≥ 1/3 ,the latter inequality for reasonable values of n.

15.2

Distribution of Prime Ideals

Recall that the ring of integers of a number field K is:
OK = {x ∈ K : fQx ∈ Z[x]} , where fQx is the (monic) minimal polynomial of x in Q[x]OQ[α] contains Z[α], and the former’s nice properties carry over to Z[α], modulo somedetectable and fixable “badness” due to prime ideals that divide the conductor of OQ[α] .
These prime ideals are “rare” in the sense that they all have norms that are powers of someprime integer that divides the discriminant of f (x), which (for suitable f (x)), is only nO(n) .
(See Chapter 13.4 for more details, and see [127] for a nice survey of algorithmic aspects ofgeneral number rings.)
The distribution of prime ideals in number fields is quite analogous to the distributionof primes in the integers. Just as the prime number theorem states that the number ofCHAPTER 15. BACKGROUND ON IDEAL LATTICES III

149

primes less than x is approximately x/ ln x, we have Landau’s prime ideal theorem.
Theorem 15.2.1 (Theorem 8.7.2 from [10]). Let K be an algebraic number field of degree n. Let πK (x) denote the number of prime ideals whose norm is ≤ x. Let λ(x) =(ln x)3/5 (ln ln x)−1/5 . There is a c > 0 (depending on K) such that
πK (x) = x/ ln x + O(xe−cλ(x) )With the Generalized Riemann Hypothesis, one can make a stronger statement.
Theorem 15.2.2 (Theorem 8.7.4 from [10]). Assume GRH. Let K be an algebraic number
field of degree n and discriminant ∆. For x ≥ 2, we have√
|πK (x) − x/ ln x| = O( x(n ln x + ln |∆|))
The constant implied by the “O” symbol is absolute.
In later Chapters, we will require some results on the distribution of prime ideals, but
nothing as strong as Theorem 15.2.2. Rather, we will require only that, for certain intervals[a, b] (e.g., where a = b/2), the number of prime ideals with norms in [a, b] is a non-negligible
fraction of b. In particular, we use the following lemma.
Lemma 15.2.3. Let M be an ideal with norm in [N, 2N ], with log N polynomial in n. Let
Ia,b be the set of invertible prime ideals with norms in [a, b]. Let s = n · kf k · (b/N )1/n ·√ω( log n) and t ≥ γMult (R) · s · n1.5 . Suppose v is chosen according to the distribution
DM −1 ,s,t·e1 . If |Ia,b |/b is non-negligible, then the probability that the ideal M · (v) has adivisor in Ia,b is non-negligible.
Remark 15.2.4. Above, notice that M · (v) is an integer (non-fractional) ideal, sincev ∈ M −1 .
Proof. As a preliminary matter, we have that s exceeds the smoothing parameter of all ideals√
I with norm at most b/N , since by Lemma 8.2.2, λn (I) < n · kf k · det(I)1/n = s/ω( log n).
Now, we want to prove that the quantity
Pv∈pM −1 for some p∈Ia,b ρs,t·e1 (v)Pv∈M −1 ρs,t·e1 (v)is non-negligible.

CHAPTER 15. BACKGROUND ON IDEAL LATTICES III

150

Consider the numerator of the expression above. Let us restrict the summation to v’s√
in the ball t · e1 + B(s · n). For convenience, let p(n) = log(2N · etn ). We haveXv∈pM −1 for some p∈Ia,b

ρs,t·e1 (v)≥X(log Nm(p)) ·p∈Ia,b≥ (1/p(n)) ·X
p∈Ia,b≥ (1/p(n)) ·X

X

ρs,t·e1 (v)/(log Nm(M · (v)))

v∈pM −1X(log Nm(p)) ·X

ρs,t·e1 (v)v∈pM −1

ρs,t·e1 (v)p∈Ia,b v∈pM −1≈ (1/p(n)) ·X

ρs,t·e1 (pM −1 )p∈Ia,b' (1/p(n)) · ρs,t·e1 (M −1 ) ·X

1/Nm(p)p∈Ia,b≥ (1/p(n)) · ρs,t·e1 (M −1 ) ·X

1/bp∈Ia,b

The first inequality follows from the fact that log Nm(M · (v)) ≥P

i log Nm(pi ), where {pi }consists of distinct invertible prime ideal divisors of M · (v). The second inequality follows
from the fact that the invertibility of (v) implies that Nm(M · (v)) = det(M ) · det((v)),
and from Lemma 15.1.6, which implies that det((v)) ≤ e · tn when v is in the ball above,
where e is Euler’s constant. The “≈” equation holds up to a multiplicative factor that is
negligibly close to 1, because on the rhs we go back to including vectors that are outside of
the ball, which carry only a negligible fraction of the weight since s exceeds the smoothing
parameter of all ideals with norm at most b/N . By Lemma 13.2.6, since (again) s exceeds
the smoothing parameter of all ideals with norm at most b/N , the ‘'” inequality is trueP
up to a multiplicative factor that is negligibly close to 1. Overall, sincep∈Ia,b 1/b is
non-negligible by assumption, the result follows.

Chapter 16

Random Self-Reduction of Ideal
Lattice Problems
In this Chapter, we provide an overview of our worst-case / average-case connection for ideal
lattices, and its relevance to our scheme. We provide the formal details in later Chapters.

16.1

A New Type of Worst-Case / Average-Case Connection
for Lattices

Inherently, public-key cryptography is based on average-case hardness. For example, in the
Rabin encryption scheme, the KeyGen algorithm induces an (average-case) distribution of
public keys. In the random oracle model, one can prove that Rabin encryption is secure if it
is infeasible to factor moduli generated according to the average-case distribution. As far as
we know, any efficient instantiation of Rabin encryption could be insecure even if factoringis hard in the worst-case – i.e., for some (possibly negligible fraction of) moduli.
Sometimes, however, one can prove an worst-case / average-case connection – i.e., if one
can solve an average-case instance of problem A (generated according to some distribution
D), then one can solve any instance of problem B. If D is efficiently samplable and hasenough min-entropy to be used in KeyGen, then the worst-case / average-case connection
may allow one to base the scheme’s security on the worst-case hardness of problem B. This
gives more assurance that the scheme is secure.

151

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 152

For example, one can establish something similar to a worst-case / average-case connection for schemes based on Diffie-Hellman. The Diffie-Hellman problem is random selfreducible – i.e., given any instance I1 of Diffie-Hellman over a fixed group G, one can use
I1 to generate a random instance I2 of Diffie-Hellman over G, such that an algorithm thatsolves I2 can be used as a sub-routine in an algorithm to solve I1 . Thus, a scheme whose
security is based on Diffie-Hellman in G is based on the problem’s worst-case hardness in
G. However, since G is fixed – i.e., we use the same G in the worst-case and average-caseinstances – the random self-reducibility of Diffie-Hellman in G is typically not considered
to be a full-fledged worst-case / average-case connection.
In 1996, Ajtai [2] found a surprising reduction of worst-case lattice problems to an
average-case ones, and Ajtai and Dwork [4] proposed an encryption scheme based on thisworst-case hardness. The good news is that, unlike in the Diffie-Hellman case, the worstcase problem is a completely general problem (over lattices) that is unconstrained by any
parameters in the average-case problem – a full-fledged worst-case / average-case connection.
The bad news is that Ajtai’s reduction has a price. In the Diffie-Hellman case, the worstcase and average-case problems are of the same type – i.e., Diffie-Hellman over G. In Ajtai’s
reduction, however, the lattice in the worst-case instance has smaller dimension than the
average-case instance – i.e., his reduction allows one to base security on worst-case hardness,but over a seemingly easier set of lattices.
Another problem with Ajtai’s approach is that it seems difficult to adapt it to output
average-case ideal lattices. Obviously, our KeyGen algorithm generates a key according to
an average-case distribution, and we need KeyGen to generate an ideal lattice since ourscheme depends crucially on the multiplicative structure of ideal lattices. Prior work [98,111, 112, 88, 99] adapts Ajtai’s approach to establish a worst-case / average-case connection
where only the worst-case problem is directly over ideal lattices; the average-case lattice isgenerated as a sort of “knapsack” of vectors from the worst-case lattice, a process whichruins the ideal lattice structure. To obtain an average-case instance that is directly overideal lattices, we apparently need an approach fundamentally different from Ajtai’s andother prior work.
Our worst-case / average-case connection is conceptually similar to a random selfreduction, where both the worst-case and average-case instances are directly over ideal
lattices in the same polynomial ring R. One difference is that the ideal lattices in theCHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 153

average-case instance correspond to invertible prime ideals (see Chapter 13.4 for definitions), whereas this is not necessarily the case of the ideal in the worst-case instance. Also,
the approximation factor in the worst-case instance is larger by a multiplicative factor that
depends on the ring R. For an exponential-sized family of rings R – in particular, when R
is selected as suggested in Chapter 7.4 – this factor is only polynomial in n.

16.2

Our Average-Case Distribution

As mentioned above, we want our average-case problem to be “directly over” ideal lattices.
We use a natural lattice problem – the bounded distance decoding problem (BDDP) – which(informally) asks: given a lattice L and a vector t with the promise that dist(L, t) ≤ s,output some v ∈ L with kt−vk ≤ s. (The notation dist(L, t) denotes min{kv −tk : v ∈ L};
equivalently, the problem could ask for t − v.) Usually s is chosen to be less than λ1 (L)/2,
where λ1 (L) is the shortest nonzero vector in L, so that there is a unique solution.
The average-case problem that we consider in the main reduction is actually a “hybrid”
of worst-case and average-case. The ideal lattice is generated according to an average-case
distribution induced by an algorithm IdealGen. However, the vector t is “worst-case.” The
only requirement on t is that it be within a certain distance of the lattice; it need not bechosen according to any known (or even samplable) distribution. Here is formal statementof the problem.
Definition 16.2.1 (Hybrid Bounded Distance Decoding Problem (HBDDP)). Fix ring R
and algorithm IdealGen that samples bases of ideals in R. Fix a positive real sHBDDP . The
R

challenger sets Bpk
J ← IdealGen(R). The challenger sets x subject to the constraint thatpk
kxk < sHBDDP and sets t ← x mod Bpk
J . The problem is: given (BJ , t) (and the fixedvalues), output x.
This problem is the same as I-HBDDP (see Chapter 14.5), except that in I-HBDDP,
the algorithm IdealGen took the basis of an ideal I as input and was required to generatebases for an ideal J relatively prime to I.
Our average-case distribution is uniform over invertible prime ideals in R that havenorms in some specified interval [a, b]. In practice, the fact that J is prime will mean that
J is automatically relatively prime to I.
One reason behind our choice of average-case distribution is that, crudely speaking, there
is almost a “bijection” between integers and norms of ideals in R; so, sampling a random

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 154

prime ideal amounts to sampling a random prime integer, and outputting an ideal whose
norm is (a power of) that integer. This crude intuition is inaccurate, but “close enough” tobe useful. Another reason that this average-case distribution is attractive is that we are alsoable to take worst-case ideal lattices, and “randomize into” this average-case distribution,
though there are considerable technical difficulties.
We remark that while there are some difficulties in using our average-case distribution,
defining a random ideal lattice seems simpler than defining a “random lattice” in the general
setting [2, 3]. To see how different the settings are, notice that for any integer d, there are atleast dn−1 distinct lattices of determinant d and dimension n (since there are at dn−1 distinct
Hermite normal form bases with (1, . . . , 1, d) along the diagonal), whereas the number ofideal lattices with determinant in [d, 2d] is θ(d).

16.3

How to “Randomize” a Worst-Case Ideal

Our worst-case problem is also BDDP over ideal lattices in R:
Definition 16.3.1 (Worst-Case Bounded Distance Decoding Problem (WBDDP)). Fixring R and positive real sWBDDP . The problem is: given (BM , t), where BM is a basis for
an ideal lattice M of R and t satisfies dist(M, t) ≤ sWBDDP , output y ∈ t + M such thatkyk ≤ sWBDDP .
How do we “randomize” a worst-case lattice into our distribution on HBDDP lattices,in such a way that an algorithm that solves HBDDP can be used as a subroutine in analgorithm that solves WBDDP? Let us start with some high-level intuition. One intuitionis that if we start from an arbitrary ideal lattice M and look at coarse enough sub-latticesof it, we will find sub-lattices of every “geometric shape”. That is, if we choose a “random”
ideal K, then the “geometric shape” of M K will be essentially independent of the “geometricshape” of M . Roughly speaking, one may view the “geometric shape” as the shape of theparallelepiped formed by a basis of very short vectors in the lattice, which is unchanged byrigid transformations.
But clearly M K is not independent of M K, since this lattice will actually have some“algebraic properties” that depend on M . In particular, the ideal M K is divisible by theideal M . Of course, this is unacceptable in terms of obtaining a worst-case / averagecase connection; perhaps our average-case instance-solver fails precisely when its instanceis divisible by M .

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 155

To destroy these algebraic properties, consider the following approach. Choose an element v ∈ (M K)−1 and output J ← M K(v) as the average-case ideal. (The fractional
ideal (M K)−1 is simply the inverse of the ideal lattice M K.) More specifically, choose v
according to the discrete Gaussian distribution D(M K)−1 ,s,t·e1 , where t À s so that v is“nearly” parallel to the scaled unit vector t · e1 , and the lattice (v) is “close” to the latticet · Zn in that it has nearly the same “shape”. The idea is that, when v is chosen in thisway, the “shape” of J is essentially the same as that of M K since multiplication by (v)is close to being a rigid transformation, but the M −1 factor in (v) removes the “algebraic
properties” that come from M . Intuitively, J = M K · (v) has a “shape” independent of M
and does not inherit the “algebraic” properties of M , so it should be “random”.
The outline of the approach above, of course, is merely intuition; it only serves to
explain why we may hope to find a randomization procedure. However, we are able toformalize the approach. In Chapter 17.4, we define an algorithm RandomizeIdeal0 that takes
as input an ideal M and a bound b > det(M ). RandomizeIdeal0 invokes a sub-routine
RandomIdealGen(R, i, j) that outputs an ideal K that is uniformly random among invertible
ideals with determinant in [i, j], together with a short vector wK ∈ K satisfying kwK k < X
for some X. The particular value of [i, j] that it uses is [bt2n / det(M ), 4bt2n / det(M )], wheret is a factor depending only on R and that may be polynomial in n, and the value X ispreferably only polynomial in n. We prove the following theorems.
Theorem 16.3.2. For any α ≥ 1, assuming RandomIdealGen is efficient, RandomizeIdeal0
efficiently outputs an invertible ideal J that is statistically uniform subject to the constraintthat det(J) ∈ [2bt3n · αn , 3bt3n · αn ].
Assuming that invertible prime ideals are not too sparse among invertible ideals in theinterval, RandomizeIdeal0 can easily be adapted to output ideals according to our averagecase distribution.
Theorem 16.3.3. Assume RandomIdealGen is efficient. Also assume that there is analgorithm A that, for some α ≥ 1, solves the HBDDP with overwhelming probability(over the random coins chosen by A) for a ² fraction of ideals J output by IdealGen,
where IdealGen outputs an invertible ideal J that is uniformly random with determinantin [2bt3n · αn , 3bt3n · αn ]. Then, there is an algorithm B, with running time approximately O(1/²) that of A, that solves the WBDDP over any ideal M with det(M ) < b
and sWBDDP ≤ sHBDDP /(t2 · α · X).

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 156

RandomizeIdeal0 is fairly similar to what we outlined above, but includes some rejection
sampling to fine tune the sampling distribution. The distribution analysis relies heavy on
properties of Gaussian distributions over lattices, and on the relation between v and its
inverse in the field Q(x)/(f (x)) overlying R – e.g., that the fractional ideal (1/v) is “close”
to being a scaling of Zn when (v) is.
Though we defer the formal details of the proof of Theorem 16.3.3 until Chapter 17,
the high-level idea is simple. From its WBDDP instance (M, u), B uses RandomizeIdeal0 togenerate an average-case ideal lattice J = M K(v) for A, and generates the target vectort for the average-case instance as u × v × wK mod BJ . Once A finally succeeds, B caneasily convert A’s solution into a WBDDP solution. The reduction requires wK to be
short, so that the smallness of dist(M, u) implies the smallness of dist(J, t) – i.e., that the
average-case instance is well-formed.
However, an unfortunate wrinkle in this approach is that we do not know how to
instantiate RandomIdealGen efficiently. In the next Section, we outline how to instantiate RandomIdealGen efficiently given access to a factoring oracle, which could be instantiated with quantum computation. We also outline our difficulties in instantiating
it with an efficient classical algorithm. We stress that we still use RandomizeIdeal0 . Specifically, as sketched in Chapter 16.5 and detailed in Chapter 18, we use a weak version of
RandomizeIdeal0 in our (classical, efficient) instantiation of IdealGen in KeyGen. This weakversion of RandomizeIdeal0 uses a weak version of RandomIdealGen that does not generate ashort vector wK ∈ K, which is sufficient for KeyGen. (The short vector wK is need only inthe worst-case / average-case reduction to translate a solution to the average-case problem
into a solution to the worst-case one.)
Since we need a factoring oracle anyway, we use a different reduction (given in Chapter
17.1-17.3) that requires weaker statements about the distribution of prime ideals in number
fields than we require to instantiate RandomIdealGen efficiently. Specifically, we provide
an algorithm RandomizeIdeal, which invokes a factoring oracle, and prove the following
theorems.
Theorem 16.3.4. Let Ia,b be the set of invertible prime ideals with norm in [a, b]. Suppose√that |Ia,b |/b is non-negligible, log b is polynomial in n, and a2 > 2N · tn0 where t0 = t + s · n√√
for s = ω( log n), s = n3 · kf k3 · (b/N )1/n · ω( log n), and t ≥ γMult (R) · n1.5 · s. Then,
given an ideal M with norm in [N, 2N ] as input, and with access to a factoring oracle,
RandomizeIdeal efficiently outputs the basis of an invertible prime ideal J that is statistically

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 157

uniform, and independent of M , subject to the constraint that Nm(J) ∈ [a, b].
Theorem 16.3.5. Let a, b, Ia,b , N , and t be as in Theorem 16.3.4. Suppose that there isan algorithm A that solves sHBDDP -HBDDP with overwhelming probability (over the random
coins chosen by A) for a ² (weighted) fraction of invertible prime ideals J ∈ Ia,b . (Assume
sHBDDP < λ1 (J)/2.) Then, there is an algorithm B, with running time approximately O(1/²)
that of A, that solves the sWBDDP -WBDDP for any (worst-case) ideal M with det(M ) ∈√√[N, 2N ] when 2t · sWBDDP + n ≤ sHBDDP . When N ≥ b, for any g(n) that is ω( log n),
we can set t = γMult (R) · n4.5 · kf k3 · g(n).

16.4

Why Does the Reduction Require a Factoring Oracle?

The algorithm RandomizeIdeal0 , and hence the worst-case / average-case reduction, is efficient and classical (non-quantum), with the possible exception of the sub-routine RandomIdealGen.
An obvious attempt to instantiate RandomIdealGen is the following: generate a random shortvector wK and set K ← (wK ). But, among other problems, the output K is obviously aprincipal ideal (i.e., has a single generator). Typically, most ideals in R are not principal,
so K cannot be said to be random. (We could restrict the worst-case and average-caseproblems to principal ideals, but this leads to other technical difficulties.) It seems quite
challenging to efficiently generate a non-principal ideal together with a short vector in it.
If one, say, generates two “random” vectors v, w ∈ Zn , one of them short, and sets K tobe the ideal (v) + (w), most likely K will be all of R, or some uninteresting ideal with verysmall norm.
One approach to fixing the “attempt” above is to use a factoring oracle. For example,
we can sample wK ∈ Zn from a Gaussian ball of small radius s centered at t · e1 , so thatwK is nearly parallel to e1 . We then factor the ideal (wK ) and set K to be a random
divisor of (wK ), subject to the norm requirements on K. However, there is no known
efficient classical algorithm to factor (wK ) in R = Z[x]/(f (x)). But if we have an integerQ
factoring oracle, we can factor (wK ) easily: factor det((wK )) into i pei i , then (for each pi )use an efficient classical polynomial factorization algorithm (e.g., Kaltofen-Shoup [75]) toQ
factor f (x) = j gij (x) mod pi , and finally test whether the various (possibly non-principal)
ideals (gij (x), pi ) divide (wK ). All of the prime ideal factors have this form [127] and will
be efficiently discovered. Shor [124] describes a quantum integer factoring algorithm, which
can be used to instantiate the oracle efficiently.

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 158

Why should the ideal K be random? The probability that an ideal K with det(K) ∈ [a, b]
divides (wK ) is negligibly close to 1/ det(K), for suitably chosen parameters, using results
on Gaussian distributions over lattices. If this immediately translated into some way tochoose K with probability negligibly close to 1/ det(K) (or c/ det(K) for some non-negligiblec), then we could make the distribution uniform by outputting the sampled K only withprobability det(K)/b, where b is an upper bound on det(K), and otherwise resampling.
However, actually picking a divisor of (wK ) leads to some complications. One canthink of it like a balls and bins problem. For wK chosen according to the distribution
above, we know that K divides (wK ) with probability very close to 1/ det(K) – i.e., insome sense K is in a 1/ det(K) fraction of the bins. However, some of the K’s tend to bein crowded bins – i.e., some K’s tend to divide only the values of (wK ) that have many(potentially a super-polynomial number of) divisors. In fact, we know exactly which K’s
are the problematic ones: they are the K’s that themselves have many divisors. To address
this problem, we could show that the fraction of “bad” K’s is small, and that we can sample
uniformly from among the remaining K’s. But this requires rather strong effective resultson the distribution of prime ideals – e.g., one can try to use an Erdös-Kac-like lemma thatcharacterizes the number of prime ideal divisors that (wK ) is likely to have. This was ouroriginal approach, but ultimately we opted for a reduction that still requires a factoringoracle, but only needs weaker results on the distribution of prime ideals.
In the simpler reduction, given the WBDDP instance (M, u), we start off by generatingR

a vector v ← DM −1 ,s,t·e1 for t À s and setting L ← M · (v) and t0 ← u × v. The idea here isthat the BDDP instance (L, t0 ) is just like the instance (M, u), except everything has been
multiplied by v, which is very close to a rigid transformation that essentially preserves the“shape” of the BDDP instance. Consequently, a solution to (L, t0 ) would give a solution to(M, u). Since v ∈ M −1 , L is an integer (non-fractional) ideal. Moreover, since L inherits
some randomness from v’s distribution, we can show (for proper settings of parameters)that the probability that L is divisible by an invertible prime ideal J with norm in ourdesired interval [a, b] is proportional to 1/ det(J). So, to sample uniformly from among thecandidate J’s, we apply our factoring oracle to L, tentatively grab a candidate J, and makethe probability uniform over the J’s through rejection sampling. The average-case BDDP
instance is essentially (J, t0 mod BJ ), except that t0 is first rounded to an integer vector.
Since J is a super-lattice of L, the fact that t0 is a small distance from L implies that it isa small distance from J, and therefore forms a valid BDDP instance, though of course this

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 159

distance is larger in relation to λ1 (J) than to λ1 (L). We begin describing this reduction
formally in Chapter 17.1.
We still describe RandomizeIdeal0 (the “other” approach) for two reasons. First, as
discussed above, we use a weak version of our RandomizeIdeal0 algorithm to obtain a IdealGen
algorithm (used in KeyGen) that efficiently generates ideals (classically) according to theaverage-case distribution. The weak version requires only a weak version of RandomIdealGen,
which (as before) generates an ideal K that is uniformly random among ideals with norm ina certain interval, but does not generate a short vector wK ∈ K; this weak version can beinstantiated classically. (The techniques used in RandomizeIdeal do not appear to be usefulfor generating a classical IdealGen algorithm that generates ideals according to the averagecase distribution.) Second, we speculate that there may be a classical way to instantiate
RandomIdealGen efficiently, in which case the worst-case / average-case connection would
be entirely classical.

16.5

Application to our Fully Homomorphic Encryption Scheme

The KeyGen algorithm in our fully homomorphic encryption scheme uses an algorithm
IdealGen that outputs the basis of a (random) ideal J, together with a short independent
set BJ −1 of J −1 . One technical requirement is that J must be relatively prime to an idealI, where I is a fixed global ideal used by everybody.
We give a specific instantiation of IdealGen that outputs ideals J according to ouraverage-case distribution, together with a short independent set BJ −1 of J −1 as neededfor decryption. Since, in our average case distribution, J is prime, it will automatically be
relatively prime to I.
It may seem counterintuitive that we can efficiently generate (classically) a random
ideal J and an associated secret key, even though we do not know how to instantiate
RandomIdealGen efficiently (classically). As a rough explanation, the reason is that thesecret key for J is a short independent set for the inverse ideal, while RandomIdealGen is
supposed to generate a short vector in the ideal itself.
A better explanation is simply to sketch why a weak version of RandomizeIdeal0 , whichuses a weak version of RandomIdealGen that does not generate the short vector wK , suffices
to generate a random J together with a short independent set for J −1 . In this weak versionof RandomizeIdeal0 , we “randomize” the “worst-case” ideal M = R; that is, we generate

CHAPTER 16. RANDOM SELF-REDUCTION OF IDEAL LATTICE PROBLEMS 160

K and v as we did before and set J = K · (v) (instead of J = M K · (v)). So, how
do we obtain a short independent set for J −1 ? Given an independent set BK −1 of K −1 ,we can obtain an independent set BJ −1 of J −1 simply by dividing each column vector in
BK −1 by v. We trivially have the independent set {ei } for K −1 , so the rotation basisof 1/v forms an independent set of J −1 . When v is long enough, this independent set issuitable for decryption. In particular, we prove that when we generate our secret key in thisway, we can obtain a value of rDec that is within a polynomial factor of λ1 (J). Then, theanalysis given in Chapter 7.7 applies, where we showed that we could permit rDec /rEnc to
be as large as the approximation factor of our BDDP instance, up to a polynomial factor,
thereby maximizing the circuit depth that we can evaluate.
In Chapter 14, we described a sequence of reductions that, subject to certain conditions– e.g., that det(I) is prime and poly(n), and sHBDDP is sufficiently small – reduces the IHBDDP with the distribution from IdealGen to the semantic security of our scheme. Later,
we give another sequence of reductions that reduces the (worst-case) SIVP to the WBDDP.
Overall, with the worst-case / average-case connection given here, this bases the security of
our scheme on quantum worst-case SIVP over ideal lattices in the ring R.

Chapter 17

How to Randomize a Worst-Case
Ideal
17.1

The RandomizeIdeal Algorithm

In this Section, we present our algorithm RandomizeIdeal and prove Theorems 16.3.4 and
16.3.5.
RandomizeIdeal(R, BM , N, s, t, a, b). Takes as input the ring R, a basis BM of an ideal M
of R whose norm is in [N, 2N ] where log N is polynomial in n, and parameters s, t, a, andb such that:√• s = ω( log n),√• s = n3 · kf k3 · (b/N )1/n · ω( log n),• t ≥ γMult (R) · n1.5 · s,
• the number of invertible prime ideals with norms in [a, b] is a non-negligible fractionof b,• a/b is non-negligible,• log b is polynomial in n,• a2 > 2N · tn0 where t0 = t + s ·√n.

The algorithm does the following.
161

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

162

1. It generates a vector v per the discrete Gaussian distribution DM −1 ,s,t·e1 ; it sets
L ← M · (v).
2. It uses a factoring oracle to compute bases of the invertible prime ideal divisors {pi }of L.
3. It sets J to be an ideal in {pi } that has norm in [a, b], if there is one; otherwise, it
restarts.
4. With probability det(J)/b it outputs a basis BJ of J, along with the vector v; otherwise, it restarts.
Remark 17.1.1. In Step 1, one can sample from the distribution DM −1 ,s,t·e1 by using the
GPV algorithm (see Chapter 13.3) with the independent set {ei } in M −1 .
Remark 17.1.2. See Chapter 13.4 for more details on how an integer factoring oracle canbe used to compute in Step 2 to compute the bases of prime ideal factors of L.

17.2

Is the Ideal Random? The Proof of Theorem 16.3.4

Before proving that our RandomizeIdeal algorithm is efficient and has the proper distribution,
we provide a preliminary fact regarding v.
Lemma 17.2.1. The vector v drawn in Step 1 is in t · e1 + B(s ·√n) with overwhelming

probability, where B(r) is the open ball of radius r.
Proof. First, observe that Zn is a sub-lattice of M −1 . Therefore, regarding smoothingp√parameters, we have η² (M −1 ) ≤ η² (Zn ) ≤ π −1 · ln(2n(1 + 1/²)). Since s = ω( log n),pthere is a negligible ² for which s > π −1 · ln(2n(1 + 1/²)) – i.e., s exceeds the smoothing
parameter of M −1 . By Lemma 13.2.2, we have£√ ¤ 1 + ² −n
kv − t · e1 k > s · n ≤·2v←DM −1 ,s,t·e
1−²
1
Pr

Now, we prove Theorem 16.3.4.

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

163

Theorem 16.3.4. We claim that the probability of restarting in Steps 3 and 4 is nonoverwhelming, from which the efficiency of our algorithm follows. For Step 3, this is true
because a/b is non-negligible. Regarding Step 4, we use Lemma 15.2.3, which establishes
that, for our choices of s, t, a, and b, there is a non-negligible probability that M ·(v) has aninvertible prime ideal divisor with norm in [a, b] when v is sampled according to the above
distribution.
Now, consider the probability that an invertible prime ideal J with norm in [a, b] ischosen as the ideal J in Step 3 in a single trial (without restarts). Assuming v ∈ t · e1 +√B(s · n) (which is indeed the case with overwhelming probability by Lemma 17.2.1), we
claim that J is chosen iff v ∈ JM −1 .
For the ‘if’ direction of our claim, if v ∈ JM −1 , then J divides (is a super-lattice of)
L ← M · (v). Since (v) is an invertible ideal (being principal), we have that det(L) =det(M ) · det((v)) ≤ 2N · tn0 < a2 ≤ det(J)2 . Consequently, besides J, L cannot have anyother prime ideal divisors with norm in [a, b], and J is chosen. For the ‘only if’ direction,that J is chosen implies that J divides (is a super-lattice of) L = M ·(v). But then JM −1 isa super-lattice of M −1 M · (v). M is not necessarily invertible; in particular, M −1 M may bedivisible by singular prime ideals that divide the conductor. (See Chapter 13.4.) However,
we also trivially have that JM −1 is a super-lattice of J · (v) since v ∈ M −1 . Therefore,
all vectors in the sum of ideals J · (v) + M −1 M · (v) = (J + M −1 M ) · (v) are containedin JM −1 . However, J and M −1 M are relatively prime, since J is invertible while M −1 M
is divisible by only singular (non-invertible) prime ideals. Therefore, (v) is contained in
JM −1 ; in particular, v ∈ JM −1 .
Therefore, for fixed M , we havePρs,t·e1 (JM −1 )−1 Pr[v]=Pr[J] = Pv∈JM
ρs,t·e1 (M −1 )v∈M −1 Pr[v]Since J is an invertible ideal, we have det(JM −1 ) = det(J) · det(M −1 ). Assuming that s
exceeds the smoothing parameter of JM −1 , Lemma 13.2.6 thus implies that
ρs,t·e1 (JM −1 )≈ 1/ det(J)ρs,t·e1 (M −1 )where “≈” means up the equation is correct up to a multiplicative factor that is negligibly
close to 1. Step 4 adjusts this probability so that it is 1/b – i.e., uniform (and independent

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

164

of M ) over all prime ideals with norms in [a, b].
It remains only to show that s exceeds the smoothing parameter of the lattice JM −1 .
We have thatp
= n3 · kf k3 · (b/N )1/n · ω( log n)sp≥ n3 · kf k3 · det(J)1/n / det(M )1/n · ω( log n)p≥ n2 · kf k2 · det(J)1/n · det(M −1 )1/n · ω( log n)p≥ n · kf k · det(JM −1 )1/n · ω( log n)p≥ λn (JM −1 ) · ω( log n)by the lemmata in Chapter 8.2.

17.3

Reduction of WBDDP to HBDDP and Worst-case IVIP
to Average-Case IVIP

Next, we prove Theorem 16.3.5, showing how to use the procedure RandomizeIdeal to reduce
WBDDP to HBDDP.
Proof. (Theorem 16.3.5) B wants to solve the WBDDP instance (M, u). It does the following:R

1. It runs (BJ , v) ← RandomizeIdeal(R, BM , N, s, t, a, b).
2. It sets t0 ← u × v and t ← bt0 e mod BJ ; let c ∈ [−1/2, 1/2)n be vector such thatt0 − t − c ∈ J.
3. It runs A on the instance (J, t), receiving back a vector y such that t − y ∈ J. (If A
does not solve this instance, restart.)
4. It outputs x ← (y + c)/v.
First, we verify that (J, t) is a valid HBDDP instance that should be solvable by A. By
Theorem 16.3.4, RandomizeIdeal outputs the basis of an ideal J that is statistically uniform
among invertible prime ideals with norm in [a, b].
Now consider t. By assumption, there exist m ∈ M and z with kzk ≤ sWBDDP such√that u = m + z. So, t0 = m0 + z0 , where m0 ∈ M · (v) and (assuming v ∈ t · e1 + B(s · n))

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

165

we havekz0 k = kz × vk ≤ t · kzk + γMult (R) · s ·√n · kzk ≤ 2t · sWBDDP

Since M · (v) is a sub-lattice of J, we have that t0 = j0 + z0 for some j0 ∈ J. When we round√t0 to obtain t (and reduce modulo BJ ), this shifts the vector by a distance of at most n√(modulo J), and thus t = j + z00 for some j ∈ J and kz00 k ≤ 2t · sWBDDP + n ≤ sHBDDP .
By the analysis above, A should solve the instance (J, t) with probability at least ². If
A solves this instance – i.e., B receives from A a vector y with kyk < sHBDDP such thatt − y ∈ J – then, since z00 is also a valid solution and since sHBDDP < λ1 (J)/2, we have thaty = z00 . Then, z00 + c = z0 and z0 /v = z, and B solves its WBDDP instance.

√
We aim to set t as small as possible. For some function g(n) that is ω( log n), whenN ≥ b, we can set s = n3 · kf k3 · g(n), and then t = γMult (R) · n4.5 · kf k3 · g(n).
The reduction from worst-case to average-case IVIP is very similar.
Theorem 17.3.1. Let Ia,b be the set of invertible prime ideals with norm in [a, b]. Suppose√√that |Ia,b |/b is non-negligible and a2 > 2N · tn0 where t0 = t + s · n for s = ω( log n),√
s = n3 ·kf k3 ·(b/N )1/n ·ω( log n), and t ≥ γMult (R)·n1.5 ·s. Suppose that there is an algorithm
A that solves sIVIP -IVIP with overwhelming probability (over the random coins chosen by A)
for a ² (weighted) fraction of invertible prime ideals J ∈ Ia,b . Then, there is an algorithm
B, with running time approximately O(1/²) that of A, that solves IVIP for any (worst-case)ideal M with det(M ) ∈ [N, 2N ] for parameter sIVIP /2t. In particular, if N ≥ b, for any√
g(n) that is ω( log n), it solves IVIP for parameter sIVIP /(2γMult (R) · n4.5 · kf k3 · g(n)).
Proof. (Theorem 17.3.1) B is a given an ideal lattice M as its IVIP instance. It does thefollowing:R

1. It runs (BJ , v) ← RandomizeIdeal(R, BM , N, s, t, a, b).
2. It runs A on the instance J. If it does not receive back an independent set BJ −1 ofJ −1 that satisfies sIVIP -IVIP, it restarts.
3. It sets the ith column of BM −1 to be the ith column of BJ −1 times v; it outputs
BM −1 .
Since RandomizeIdeal generates J as a uniformly random invertible prime ideal withnorm in [a, b], A outputs a satisfactory independent set in Step 2 with probability ².

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

166

By the properties of RandomizeIdeal, J −1 (v) is a sub-lattice of M −1 . By multiplying
the generating columns of BJ −1 with v, we obtain an independent set BM −1 of M −1 thatsatisfies
kBM −1 k ≤ kBJ −1 k · t + γMult (R) · kBJ −1 k · s ·√n ≤ 2t · kBJ −1 k ≤ 2t/sIVIP ,as required.

√
We aim to set t as small as possible. For some function g(n) that is ω( log n), whenN ≥ b, we can set s = n3 · kf k3 · g(n), and then t = γMult (R) · n4.5 · kf k3 · g(n).

17.4

An Alternative Way to Randomize an Ideal

In this Section, we present an algorithm RandomizeIdeal0 and prove Theorems 16.3.2 and16.3.3. This algorithm will be used in our (classical) instantiation of IdealGen in KeyGen. The
algorithm invokes an as-yet-unspecified algorithm RandomIdealGen(R, i, j) that generates
the basis of a uniformly random invertible ideal K with det(K) ∈ [i, j], together with a√short vector wK ∈ K. Let s = ω( log n) and t ≥ 20 · γMult (R) · s · n2 . Let S = s · α andT = t · α for α ≥ 1.
RandomizeIdeal0 (R, BM , b, s, t, α). Takes as input the ring R, a basis BM of an invertible
ideal M of R, a bound b ≥ det(M ), and s, t, and α (and hence S and T ) as above. It does
the following.
R

1. Runs (BK , wK ) ← RandomIdealGen(R, bt2n / det(M ), 4bt2n / det(M ))2. Generates a vector v per the discrete Gaussian distribution D(M K)−1 ,S,T ·e1
3. Sets J ← M · K · (v)4. Let c1 = 4bt2n , an upper bound on det(M K). It continues to Step 5 with probabilitydet(M K)/c1 ; otherwise, it returns to Step 1.
5. With probability c2 ·

ρS/T 2 ,(1/T )·e (1/v)
1, continues to Step 6, where c2 is a constant toρS,T ·e1 (v)be defined later; otherwise, it returns to Step 1.
6. Returns to Step 1 if det(J) ∈/ [2bt2n T n , 3bt2n T n ].

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

167

7. With probability 2bt2n T n / det(J), outputs BK , wK , v, and the Hermite normal formof J; otherwise, it returns to Step 1.
Remark 17.4.1. In Step 2, one can sample from the distribution D(M K)−1 ,S,T ·e1 by using
the GPV algorithm (see Chapter 13.3) with the independent set {ei } in (M K)−1 .
Remark 17.4.2. We will show that 1/C ≤ ρS/T 2 ,(1/T )·e1 (1/v)/ρS,T ·e1 (v) ≤ C, where√C = e6π 1/n . (See the proof of Theorem 16.3.2.) Therefore, it suffices to take c2 ← 1/C in
Step 5.
Remark 17.4.3. RandomizeIdeal0 outputs a uniformly random invertible ideal with norm
in a certain interval. It is straightforward to modify the algorithm so that it outputs a
uniformly random invertible prime ideal – per our preferred average case distribution –simply by running the algorithm repeatedly until the output ideal is prime. This is efficientas long as prime invertible ideals are a non-negligible fraction of invertible ideals in theinterval.
Before proving Theorem 16.3.2, we provide some lemmata regarding the properties ofv, the vector selected in Step 2.
Lemma 17.4.4. The vector v drawn in Step 2 is in T · e1 + B(S ·√n) with overwhelming

probability, where B(r) is the open ball of radius r.
Proof. Similar to the proof of Lemma 17.2.1.
Since v is in the ball T · e1 + B(S ·√n) with overwhelming probability – i.e., v is “almost

parallel” to the vector T · e1 and is therefore “almost a real number” – we would expect v
to “behave” almost like a real number, and the lattice (v) to behave almost like a scalingof Zn . The following lemmas, which borrow from lemmas in Chapter 15.1 characterize thisintuition more formally.
Lemma 17.4.5. When v ∈ T · e1 + B(S ·√n) in Step 2, it is the only vector in (v) insidethat ball. In fact, ρS,T ·e1 (v)/ρS,T ·e1 ((v)) = 1 − ² for negligible ².
Proof. Let u be such that v = T (e1 + u). We have that kuk ≤ S ·√n/T < 1/(δ · γMult (R))

for δ = n. By Lemma 15.1.3, v is the only vector in (v) that is within a distance ofCHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

168

T · ((n − 2)/n) > T /2 of T · e1 . By Lemma 13.2.3,
ρS,T ·e1 ((v) \ {v})≤ ρS,T ·e1 ((v) \ [T · e1 + B(T /2)])≤ ρS,T ·e1 ((v) \ [T · e1 + B(S · γMult (R) · n1.5 /2)])≤ 2C n · ρS ((v))√
2where C = c 2πe · e−πc and c = γMult (R) · n/2 and≤ 1 + C n · ρS ((v))ρS ((v)) = 1 + ρS ((v) \ B(T /2))

≤ 1/(1 − C n )Thus, ρS,T ·e1 ((v) \ {v}) is extremely small – approximately, exp(−γMult (R)2 · n3 ). One theother hand, ρS,T ·e1 (v) is not nearly as small, being at least (approximately) exp(−n), since√v is at most S · n distant from T · e1 .
In the next lemma, we apply Lemma 15.1.5 to the vector v.
√n) in Step 2. Let v0 = v/T , and σ = S/T .
pThen, v0 satisfies the conditions of Lemma 15.1.5 for β = 1/n. In particular, if w0 =Lemma 17.4.6. Suppose v ∈ T · e1 + B(S ·1/v0 ∈ Q[x]/(f (x)), thenρσ,e1 (w0 )/ρσ,e1 (v0 ) ∈ [e−6π

√

1/n

, e6π

√

1/n

]

and consequently
ρS,T ·e1 (w)/ρS/T 2 ,(1/T )·e1 (v) ∈ [e−6π

√

1/n

, e6π

√

1/n

]

where w = 1/v.
√
n/T < 1/(n1.5 · γMult (R)). Also,pkuk3 ≤ β · σ 2 /γMult (R) ≤ β · n−4 · γMult (R)−3 for β = 1/n.

Proof. Let v0 = e1 + u. We have that kuk ≤ S ·Now we prove Theorem 16.3.2.
Proof. (Theorem 16.3.2) First, we prove that RandomizeIdeal0 is correct – i.e., that it outputs
J according to a distribution that is uniform “up to negligible error” – i.e., Pr[J1 ]/ Pr[J2 ] ≤1 + ² for all J1 , J2 with norms in the prescribed interval, for some negligible ². (In general,

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

169

we use “up to negligible error” to mean an equality holds up to such a 1 + ².) Afterwards,
we prove efficiency. To prove efficiency, it suffices to prove that neither of the rejection
sampling in Steps 5 and 6 rejects with overwhelming probability.
Correctness. For fixed M , consider the probability that IdealGen generates the pair (K, J)
at Step 3, for some K with det(K) in the required interval.
Pr[K ∧ J] = Pr[K] · Pr[J|K] = c · Pr[J|K] ,where, by the assumption on RandomIdealGen, c is some factor independent of K and M .
The ultimate goal is to show that, for all J whose norms are in the prescribed interval,
P
K Pr[J|K] is statistically the same.
We claim that
ρS,T ·e1 (v)/ρS,T ·e1 ((M K)−1 ) ≤ Pr[J|K] ≤ ρS,T ·e1 ((v))/ρS,T ·e1 ((M K)−1 )The left inequality follows from the fact that we implicitly choose the ideal J when v ischosen in Step 2 (out of all possible vectors in (M K)−1 ). However, v is not necessarily
the only vector that induces J; in fact, for every unit u ∈ R (whose norm is 1), samplingv × u in Step 2 induces J. All such v × u are in the ideal (v); hence, the second inequality.
From Lemmas 17.4.4 and 17.4.5, ρS,T ·e1 (v) = ρS,T ·e1 ((v)), up to negligible error; hence theinequalities above are very tight. Thus Pr[J|K] equals ρS,T ·e1 (v)/ρS,T ·e1 ((M K)−1 ), up to
negligible error.
Now, consider the denominator ρS,T ·e1 ((M K)−1 ); we claim that, for fixed (S, T, M ), thissummation is proportional to det(M K), up to negligible error. This follows from Lemma
13.2.6, and the fact that S exceeds the smoothing parameter of (M K)−1 for any integer
ideal M (since Zn is a sub-lattice of (M K)−1 ). So, after Step 3, we have
Pr[J|K] = c1 · ρS,T ·e1 (v)/ det(M K)
up to negligible error for some constant c1 that is independent of K, and thus, after therejection sampling in Step 4, we have
Pr[K ∧ J] = c2 · ρS,T ·e1 (v)CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

170

up to negligible error for some constant c2 that is independent of K.
Let w = 1/v. After Step 5, we have
Pr[K ∧ J] = c3 · ρS/T 2 ,(1/T )·e1 (w)(17.1)

up to negligible error for some constant c3 that is independent of K. The rationale for thisstep is rather technical; essentially, performing this inversion will allow us to compute a
certain sum over the K’s (rather than awkwardly over K −1 ’s). This will become clearer
momentarily.
In step 6, we eliminate J’s that have norm falling outside of the interval. Intuitively,
the reason we discard J’s that were on the edge of the interval is that these J’s tend tobe “associated” to K’s that were on the edge of their interval. (Roughly, we say J is
“associated” to a K when Pr[J ∧ K] is not absurdly small – i.e., the pair induces a v that is√in the ball T ·e1 +B(S· n).) The problem with such J’s is that they would also be associatedto some K’s with norms just outside the interval, if we had permitted RandomIdealGen to
generate such K’s – i.e., these J’s have a “truncated” set of associates. It is easier to discardthese bad J’s and just consider ones whose associates are not truncated.
We claim that for the J’s in this interval, after Step 5 (and Step 6), it holds that
X

X

Pr[K ∧ J] = c4 ·K

ρS/T 2 ,(1/T )·e1 (w)w∈J −1 M

up to negligible error for some constant c4 that is independent of K.
It suffices to show that
XK

ρS/T 2 ,(1/T )·e1 (w) =X

ρS/T 2 ,(1/T )·e1 (w)w∈J −1 M– i.e., the only issue difference is that (using Equation 17.1) we sum up over K’s on theleft-hand side, defining w to be the inverse of v where v is the element in (M K)−1 J thatis inside the ball T · e1 + B(T /2) (if there is one; if not, this value of K contributes nothing
to the sum), whereas on the right-hand side we are summing up directly over elements ofJ −1 M . For fixed J and M , each distinct K on the lhs that could have been chosen (i.e.,that leads to a v in the ball) maps to a distinct v in (v) = (M K)−1 J and thus a distinct
w ∈ J −1 M . (Note: (w) = J −1 M K.) Thus, the terms summed on the lhs are a subset of

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

171

the terms summed on the rhs. To show that the two sides are equal up to negligible error,
it suffices to show that the terms omitted on the lhs contribute a negligible fraction of theweight.
So, consider the values of w ∈ J −1 M that are inside the ball (1/T )e1 + B(S ·√n/T 2 );

these values contribute the overwhelming fraction of the sum on the right, assuming that
S/T 2 exceeds the smoothing parameter of J −1 M , which we will establish shortly. We
claim that, that all such w’s are included in the sum on the lhs – i.e., that for every w inthis ball, there is some K with norm in the interval [bt2n / det(M ), 4bt2n / det(M )] such that(w) = J −1 M K (for our fixed J). In particular, set K ← (w)·JM −1 ; it remains to check that
K has norm in the correct interval. Since the norm is a multiplicative map among invertible
ideals, we have det(K) = det((w)) · det(J) · det(M −1 ). Consider det((w)) = 1/ det((v)).
We can lower- and upper-bound det((v)) by finding hypercubes that circumscribe andare circumscribed by the parallelepiped P(Bv ), where v is the rotation basis of v. Let
vi = v × xi mod f (x). For every point a on the surface of this parallelepiped, there is an isuch thata = (±1/2) · vi +X

xj · vj

j6=i

for xj ∈ [−1/2, 1/2]. So,
T /2 − n · γMult (R) · S ≤ |ha, ei i| ≤ T /2 + n · γMult (R) · S
So, the parallelepiped inscribes a hypercube, centered at the origin, with sides of lengthT − 2n · γMult (R) · S ≥ T (1 − 1/10n) and volume approximately T n /1.1. Similarly, it iscircumscribed by a hypercube with volume approximately T n · 1.1. Given these bounds ondet((w)), and since det(J) ∈ [2t2n T n b, 3t2n T n b], we have that det(M K) ∈ [2t2n b/1.1, 3t2n b ·1.1], which proves the claim.
We claim that S/T 2 exceeds the smoothing parameter of J −1 M . The norm of J −1 isat most 1/(2bt2n T n ) and the norm of M is at most b. Therefore, the norm of J −1 M is at√
most 1/(2t2n T n ). By Minkowski, λ1 (J −1 M ) is at most n/(t2 T ); let a be a nonzero vector
in J −1 M whose length is at most this value. Then we have:λn (J −1 M ) ≤ max{ka × xi k} ≤ γMult (R) · kak ≤ γMult (R) ·i√n/(t2 T ) ≤ 1/(n1.5 tT )

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

172√
The value S/T 2 > 1/tT is much larger; in particular, it is λn (J −1 M ) · ω( log n) – i.e.,larger than the smoothing parameter of J −1 M .
Finally, we consider the sum
XρS/T 2 ,(1/T )·e1 (w)w∈J −1 M

Since S/T 2 exceeds the smoothing parameter of J −1 M , the sum

Pw∈J −1 M ρS/T 2 ,(1/T )·e1 (w)is proportional to det(J), for reasons similar to those discussed above. The final step gets
rid of the dependence on det(J) – i.e., Pr[J] becomes constant, up to negligible error.
Efficiency. Assuming RandomIdealGen is efficient, the efficiency of RandomizeIdeal0 follows
from our claims that the algorithm does not return to Step 1 with overwhelming probability
in Steps 5-6.
Regarding Step 5, we invoke Lemma 17.4.6, which says that with overwhelming probability it holds that
ρS,T ·e1 (w)/ρS/T 2 ,(1/T )·e1 (v) ∈ [e−6πand therefore we can take c2 ← e−6π

√

1/n

, e6π

√

1/n

]

√

1/n

as claimed, so that the probability of rejecting isvery small.
As for the probability of rejecting J in Step 6, we see that this only occurs if det(J)is outside of [2t2n T n b, 3t2n T n b]. But since the associated value of (w) = J −1 M K has
norm in the interval [T −n /1.1, T −n · 1.1] with overwhelming probability, this implies (withoverwhelming probability) that M K has norm outside of [2t2n b · 1.1, 3t2n b/1.1] – i.e., K has
norm outside of [2t2n b/ det(M ) · 1.1, 3t2n b/1.1]. By the distribution of ideals (see Chapter
15.2), it seems reasonable to believe that this occurs only with only constant probability, inwhich case the probability of rejecting in Step 6 is a constant.
Next, we prove Theorem 16.3.3, showing how to use the procedure RandomizeIdeal0 to
reduce WBDDP to HBDDP.
Proof. (Theorem 16.3.3) B wants to solve the WBDDP instance (M, u). It does the following:R

1. It runs (BK , wK , v, J) ← RandomizeIdeal0 (R, BM , b, s, t, α), using α = 1.
2. It sets t ← u × v × wK mod BJ .

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

173

3. It runs A on the instance (J, t), receiving back a vector y such that t − y ∈ J.
4. It outputs x ← y/(v × wK ).
Regarding Step 1, by assumption we have that the algorithm RandomIdealGen outputs abasis BK for an ideal K that is uniformly random subject to the constraint that its det(K)is in the specified interval. Therefore, by Theorem 16.3.2, RandomizeIdeal0 outputs the basis
BJ of an ideal J statistically uniformly, subject to the constraint that det(J) ∈ [2bt3n , 3bt3n ].
√It also outputs v satisfying J = M · K · (v) and v ∈ t · e1 + B(s · n), the latter withoverwhelming probability. Also, we know that kwK k < X by assumption.
We verify that A can perform Step 3 – i.e., that (J, t) is a valid HBDDP instance,
and that A therefore should solve it with overwhelming probability for a ² fraction of J.
Specifically, we have that u = m + z for m ∈ M and kzk ≤ sWBDDP . We havet = (m + z) × v × wK mod BJ= m × v × wK + z × v × wK mod BJ= m0 + z0 mod BJ= z0 mod BJ
where m0 ∈ J because M (v)K = J, and where z0 = z × v × wK .
Now, we claim that z0 is short, so that (J, t) is a valid HBDDP instance. Note that√v = t · e1 + s n · x where kxk ≤ 1 with overwhelming probability. So,√
kz0 k ≤ γMult (R) · kz × vk · kwK k ≤ γMult (R) · (t + γMult (R) · s n) · kzk · kwK k√≤ γMult (R) · (t + γMult (R) · s n) · sWBDDP · X ≤ t2 · sWBDDP · X ≤ sHBDDP
where the penultimate inequality holds for the value of t used in RandomizeIdeal0 .
Since the HBDDP instance is valid, A solves it with probability ². When A solves an
instance and outputs z0 = z × v × wK , B outputs z.
The reduction from worst-case to average-case IVIP is very similar.
Theorem 17.4.7. Let s, t, and b be defined as in RandomizeIdeal0 . Suppose that there isan algorithm A that solves sIVIP -IVIP with overwhelming probability (over the random coinschosen by A) for a ² (weighted) fraction of invertible ideals J with norm in [2bt3n , 3bt3n ].

CHAPTER 17. HOW TO RANDOMIZE A WORST-CASE IDEAL

174

Suppose that RandomIdealGen (efficiently) outputs BK that includes a vector w ∈ K withkwK k < X. Then, there is an algorithm B, with running time approximately O(1/²) that ofA, that solves IVIP for any (worst-case) ideal M with det(M ) < b for parameter sWIVIP ≤√sIVIP /((t + s · n · γMult (R)) · γMult (R) · X).
Proof. (Theorem 17.4.7) B is a given an ideal lattice M as its IVIP instance. It does thefollowing:R

1. It runs (BK , wK , v, J) ← RandomizeIdeal0 (R, BM , b, s, t, α) using α = 1.
2. It runs A on the instance J. If it does not receive back an independent set BJ −1 ofJ −1 that satisfies sIVIP -IVIP, it restarts.
3. It sets the ith column of BM −1 to be the ith column of BJ −1 times wK × v; it outputs
BM −1 .
Since RandomizeIdeal0 generates J as a uniformly random invertible ideal with norm in[2bt3n , 3bt3n ], A outputs a satisfactory independent set in Step 2 with probability ².
By the properties of RandomizeIdeal0 , M −1 = J −1 K(v), and thus J −1 (wK · v) is a sublattice of M −1 . By multiplying the generating columns of BJ −1 with wK · v, we obtain an
independent set BM −1 of M −1 that satisfies kBM −1 k ≤ γMult (R) · kBJ −1 k · kwK · vk. Note√that v = t · e1 + s n · x where kxk ≤ 1 with overwhelming probability. We have thatkwK · vk ≤ t · X + γMult (R) · s ·√√n · kxk · X < (t + s · n · γMult (R)) · X

Thus,
kBM −1 k ≤ γMult (R) · (t + s ·as required.

√n · γMult (R)) · X/sIVIP

Chapter 18

KeyGen per the Average Case
Distribution
The first step in RandomizeIdeal0 , which is invoked by IdealGen, is to generate the basis of
an ideal K that is uniformly random subject to its norm being in a prescribed interval. We
describe the algorithm to do this, called WeakRandomIdealGen, in this Chapter. The maindifference between RandomIdealGen and WeakRandomIdealGen is that, in the latter, we do
not generate a short vector wK ∈ K. As described below, this weak version suffices for
KeyGen.

18.1

The Secret Key

For the moment, let us assume that we have an algorithm WeakRandomIdealGen that outputs
a basis BK of an ideal that is uniformly random, subject to the constraint that its norm
is in some specified interval [a, b]. Define WeakRandomizeIdeal0 exactly like RandomizeIdeal0 ,except that WeakRandomizeIdeal0 uses WeakRandomIdealGen instead of RandomIdealGen, andthe output of WeakRandomizeIdeal0 includes only BK , the vector v, and the Hermite normal
form BJ of J. Also, WeakRandomizeIdeal0 uses the modification mentioned in Remark 17.4.3;
it outputs a random invertible prime ideal rather than a random invertible one. As before,√s = ω( log n) and t ≥ 20 · γMult (R) · s · n2 , S = s · α, and T = t · α. However, whereas we
used α = 1 to obtain as tight a reduction as possible (between the worst-case ideal M andthe average-case ideal J), here we set M to be Zn and use a large value of α – e.g., on the√order of 2 n – which implicitly induces a large value of rDec , which permits greater depth
175

CHAPTER 18. KEYGEN PER THE AVERAGE CASE DISTRIBUTION

176

to be evaluated before bootstrapping is needed. We instantiate IdealGen as follows.
IdealGen(R, BI ):1. Run (BK , v, BJ ) ← WeakRandomizeIdeal(R, R, 1).
2. Set Bpk
J ← BJ .
3. Set Bsk
J ← Bv , where Bv is the rotation basis of v.
Remark 18.1.1. In practice, we will always choose J to have much larger determinant
than I, and thus the fact that J is prime will automatically imply that it is relatively prime
to I.
Remark 18.1.2. Recall that decryption works fine as long as the ideal lattice L(BskJ )contains J. (In our case, this holds since J = K · (v) – i.e., (v) contains J.) Intuitively, ifψ is a ciphertext very close to a J-vector, then it is also very close to a vector in L(BskJ ) –though, of course, to decrypt with Bsk
J , this distance needs to be comfortably less than thefirst minimum of L(BskJ ).
Let us consider the value of rDec associated to Bsk
J , and show that it is only polynomiallysmaller than λ1 (J). This implies that Bsk
J is the best secret key for J, up to a polynomial
factor.
pk
Lemma 18.1.3. Suppose Bsk
J , BJ , v and BK are generated by IdealGen(R, I), as describedabove. Then, λ1 (J)/rDec = poly(n) if γMult (R) is polynomial in n.
Proof. First, let us consider λ1 (J). By Theorem 16.3.2, det(J) ∈ [2bt2n T n , 3bt2n T n ]. There√
fore, λ1 (J) < 31/n · n · t2 · T by Minkowski.
Now, consider rDec , the radius of the largest circle circumscribed by the secret basis
sk −1
Bsk
J = Bv . By Lemma 8.1.1, we have that rDec ≥ 1/(2n · k(BJ ) k), where in our case
−1 is the rotation basis of the vector 1/v ∈ Q[x]/(f (x)). Since v is of the form
(Bsk
J )
√
T · (e1 + u) for kuk ≤ S · n/T ≤ 1/(γMult (R) · n1.5 ), we can apply Lemma 15.1.4 to obtainthat
1/v = (1/T ) · (e1 − u + x) for kxk ≤γMult (R) · kuk2
1 − γMult (R) · kukCHAPTER 18. KEYGEN PER THE AVERAGE CASE DISTRIBUTION177

The rotation basis consists of the vectors ei /v, which has length at most¡¢
(1/T ) · (kei k + γMult (R) · kuk + γMult (R) · kxk) ≤ (1/T ) · 1 + 1/n1.5 + 2/n3 ≤ 2/T
Consequently, rDec ≥ T /4n.
The ratio of λ1 (J) and rDec , which is bounded by 4(31/n )n1.5 t2 , is therefore polynomial
in n, assuming t is polynomial in n. We can set t to be polynomial in n if γMult (R) is
polynomial in n.

18.2

Adapting Kalai’s Algorithm to Generate a Random Factored Ideal

Now we describe how to instantiate WeakRandomIdealGen, an efficient classical algorithm
for generating a basis BK of an invertible ideal K that is uniformly random, subject to theconstraint that its norm is in a prescribed interval. Several difficulties conspire to make thisless trivial than it sounds.
1. The ring OQ(α) , which contains our ring Z[α] where α is a root of f (x), enjoys uniquefactorization of ideals. However, OQ(α) certainly does not have an ideal p of norm pfor every integer prime p. In other words, one cannot simply pick an integer N and
expect that OQ(α) that has an ideal of norm N .
2. If there is an ideal of norm N , there may be multiple ideals of norm N . In particular,
for prime p, if there is one ideal of norm p, there may be up to n ideals of norm p,
where n is the degree of f (x). If N has many prime factors, the number of ideals withnorm N may be very large: up to about nlog N/ log log N .
3. If OQ(α) has an ideal I of norm N , it is still not necessarily easy to find a basis of
I unless N is prime. If N is prime, one can find the ideals of norm N e (for somee ≥ 1) essentially by factoring f (x) modulo N . (See Chapter 13.4.) However, this is
not efficient if N is composite.
These considerations, particularly the last one, lead us to construct an algorithm for generating a random factored ideal whose norm is in the prescribed interval, even though, inprinciple, we do not need the factorization. Our algorithm for generating a random factored

CHAPTER 18. KEYGEN PER THE AVERAGE CASE DISTRIBUTION

178

ideal is a modification of Kalai’s algorithm for generating a random factored number [74].
Let us recall Kalai’s algorithm.
Kalai’s Algorithm for Generating a Random Factored Number.
Input: Integer b > 0.
Output: A uniformly random number 1 ≤ N ≤ b, with its factorization.
1. Generate a sequence b ≥ s1 ≥ s2 ≥ · · · ≥ s` = 1 by uniformly choosing s1 ∈ {1, . . . , b}
and si+1 ∈ {1, . . . , si }.
2. Let N be the product of the prime si ’s.
3. If N > b, restart.
4. Output N and the prime si ’s with probability N/b; otherwise, restart.
The main idea behind Kalai’s algorithm is that the probability that a prime p ≤ b is in
the sequence is 1/p, since p is not chosen iff one of 1, . . . , p − 1 is chosen before p (which
occurs with probability (p − 1)/p). Overall, the probability that exactly pe divides N is
1/pe −1/pe+1 = (p−1)/pe+1 , and (subject to the constraint that all of N ’s factors must be at
Q
Q
Q
e +1
most b) the probability that N = i pei i is chosen is j (pj −1)/pj j = (1/N )· j (pj −1)/pj ,where pj runs over all primes up to b. Thus, the probability that N is chosen is exactly
1/N , up to some factor that does not depend on N . Two rejection sampling steps ensure
the correct distribution. By Mertens’ theorem, the algorithm will not restart in Step 3 withprobability θ(1/ log b).
We would like our algorithm for generating a random factored ideal to have a property
similar to Kalai’s algorithm: that, before some rejection sampling steps, the probability
that a prime ideal p is in the list is 1/ det(p). Kalai’s strategy for ensuring this property
is very elegant; ideally, we would like to replicate it. However, as mentioned above, there
is a considerable difficulty: there may be many (up to n) prime ideals whose norms are to
the same prime integer. This makes it difficult to generate a sequence from large to small,as Kalai does, since some ideals are “tied” in terms of largeness. We break these ties bymapping prime ideals of norm q to distinct integers [n(q − 2) + 1, n(q − 1)]. We then use
Kalai’s algorithm to sample from the integers, and then pick prime ideals as pre-imagesof these integers according to this map. Then, similar to Kalai, we multiply together theprime powers in our list, and perform a couple of rejection steps before outputting theCHAPTER 18. KEYGEN PER THE AVERAGE CASE DISTRIBUTION

179

result. From the bases of the individual prime factors, it easy to generate a basis of thecomposite ideal (essentially by multiplying the bases together). By an analogue of Mertens’
theorem for ideals in number fields, our random factored ideal will have a norm less thanour desired bound with inverse-log probability.
We now present the algorithm; afterwards, we review the purpose of the individual steps.
Let h : I → N be an efficiently computable injective map from invertible prime ideals in
R to positive integers, such that h(p) ∈ [n · (Nm(p) − 2) + 1, n · (Nm(p) − 1)]. (Such an hcan always be constructed (incrementally), since there are at most n prime ideals of a given
norm.)
WeakRandomIdealGen(R, a, b).
Input: The ring R and integers b > a > 1 with (b − a)/b non-negligible.
Output: A basis BK of a uniformly random invertible ideal K with norm in [a, b].
1. Generate n integer sequences b ≥ si1 ≥ si2 ≥ · · · ≥ si`i = 1 as in Kalai’s algorithm.
2. Set S0 to be the set of integers in the sequences, with no duplications.
3. Set S1 to be the subset of S0 consisting of those integers that equal h(p) for someinvertible prime ideal p.
4. Generate S2 from S1 as follows. For each r ∈ S1 , replace r with the prime ideal p suchthat h(p) = r with probability 1/(Np (1 − (1 − 1/r)n )); otherwise, nothing replaces r.
(We use Np to abbreviate Nm(p).)
5. Construct a set S3 by, for each p ∈ S2 , replacing p with the power pe with probability(Nm(p) − 1)/Nm(p)e+1 .
6. Set K to be the product of the prime power ideals in S3 , and BK to be a basis for K.
7. If det(K) ∈ [a, b], output BK with probability det(K)/b; otherwise, restart.
Remark 18.2.1. Regarding Step 3, as discussed in Chapter 13.4, there are efficient algorithms for recognizing when a prime power integer is the norm of a prime ideal, and forcomputing a basis of such a prime ideal.
Regarding WeakRandomIdealGen, we have the following theorem.

CHAPTER 18. KEYGEN PER THE AVERAGE CASE DISTRIBUTION

180

Theorem 18.2.2. The algorithm uniformly samples an invertible ideal K ⊂ R with normin [a, b]. The algorithm takes time b/(a − b) · poly(n, log b).
Proof. (Theorem 18.2.2) Consider an invertible prime ideal p. What is the probability thatp is in S2 ? Let r = h(p), and consider the probability that r is in S0 . For any integerr0 ∈ [1, b], and any single sequence, the probability that r0 is in that sequence is 1/r0 , justas in Kalai’s algorithm. So, the probability that r is in at least one of the sequences is
1 − (1 − 1/r)n . Then, the probability that p ∈ S2 is 1/Np , assuming 1/(Np (1 − (1 − 1/r)n ))is in fact a quantity between 0 and 1 (so that Step 4 is possible).
This assumption is true, sincer < n · (Np − 1) + 1⇒ n/(r − 1) > 1/(Np − 1)
⇒ (r/(r − 1))n > Np /(Np − 1)
⇒ (1 − 1/r)n < 1 − 1/Np
⇒ 1 − (1 − 1/r)n > 1/Np

Step 5 adjusts the probabilities so that they are analogous to those in Kalai’s algorithm,
and the rest of the steps and analysis mirror his algorithm. Specifically, for each invertible
t0

prime ideal pi of norm at most b, the probability that ptii is chosen, and not pii for somet0i > ti , is (Nm(pi ))ti · (1 − 1/Nm(pi )). The probabilities associated to different prime ideals
Q
are independent. So, for an invertible ideal M = Nm(pi )≤b ptii , we havePr[M ] = 1/Nm(M ) ·Y(1 − 1/Nm(pi ))Nm(pi )≤bthrough Step 6. After Step 7, Pr[M ] becomes (1/b) ·Q

Nm(pi )≤b (1 − 1/Nm(pi )), which is

independent of M . By Merten’s theorem for number fields, we haveY

(1 − 1/Nm(pi )) =Nm(pi )≤be−γ 1
1
+ O( 2 )aK log b
log b

where aK is the residue of ζK (s), the Dedekind zeta-function, at s = 1, and γ denotes
Euler’s constant 0.577 . . .. Since there are θ(b) ideals of norm at most b, there is an inverselog probability that Nm(K) ≤ b. Among K’s with norm at most b, approximately a (b−a)/b
fraction of them have norm at least a. The result follows.

Chapter 19

Basing Security on Worst-case
SIVP in Ideal Lattices
So far, we have based the security of our system on worst-case BDDP (WBDDP) over ideal
lattices (along with the additional problem SSSP induced by our technique for squashing thedecryption circuit). Theorem 14.6.2 uses Regev’s reduction [119] to establish that, for eachindividual ideal lattice J, IVIP reduces to BDDP. Since this holds whether J is a worst-caseor an average-case instance, this bases the security of our system on the worst-case IVIP.
There is a subtlety here; the worst-case / average-case reduction requires a lower boundon the determinant of the ideal used in the average-case instance in terms of the worst-caseinstance – i.e., worst-case ideal might be required to have a smaller determinant than the
average-case ideal. But what if IVIP is hard only when the determinant of the ideal latticein question is large, and our worst-case instances are easy?
In this Chapter, we continue the series of reductions. First, we establish that IVIP
instances tend to be harder when the determinant of the lattice in question is small. (Thisreduction uses a factoring oracle, and therefore the reduction is polynomial time in thequantum setting.) Next, we show that the shortest independent vector problem (SIVP)
over ideal lattices is hard if the IVIP problem is hard for all lattices whose determinants
exceed a particular bound. This bases the security of our system on the SIVP over ideal
lattices.

181

CHAPTER 19. BASING SECURITY ON WORST-CASE SIVP IN IDEAL LATTICES182

19.1

Relationship Among Instances of IVIP

The following theorem clarifies that, if one has access to a factoring oracle (which can beinstantiated efficiently with quantum computation), the harder instances of IVIP involve
ideal lattices with smaller determinants.
Theorem 19.1.1. Suppose that there is an algorithm A that solves sIVIP -IVIP whenever
the given ideal has det(J) ∈ [a, b] for [a, b] = [dnIVIP , 2 · dnIVIP ]. Let M be an ideal with normin [N, 2N ] with N ≥ a. Assume that invertible prime ideals with norms in [a, b] are notnegligibly sparse. Then, there is an algorithm B that solves IVIP for M for parameter√sIVIP /(2γMult (R) · n2.5 · kf k · g(n)) for any g(n) that is ω( log n).
Intuitively, it makes sense that solving IVIP for ideal lattices of smaller determinantis the harder case. For any m > 1, if M has large enough determinant, then λn (M −1 ) <2−n /m. In this case, LLL will return an independent set of M −1 of length at most 1/m, thus
solving m-IVIP. It seems reasonable to guess that, even when det(M ) is not so large, IVIP
should become easier as the determinant of M becomes larger. Theorem 19.1.1 establishes
that this is indeed true (with access to a factoring oracle).
Proof. (Theorem 19.1.1) If det(M ) ∈ [a, b], then solve IVIP for M immediately using A.
Otherwise, assume N ≥ b.
Our proof uses techniques similar to those in RandomizeIdeal. Let s and t be such that√√s = ω( log n), s = n · kf k · (b/N )1/n · ω( log n) and t ≥ γMult (R) · n1.5 · s. Let Ia,b be the setof invertible prime ideals with norms in [a, b]. Generate a vector v per the discrete Gaussian
distribution DM −1 ,s,t·e1 and set L ← M · (v). By Lemma 15.2.3, if |Ia,b |/b is non-negligible,
then the probability that the ideal M · (v) has a divisor in Ia,b is non-negligible. Use afactoring oracle to discover whether there is such a factor. If there is not, choose a new v.
If there is, set J to be such a factor.
B obtains from A an independent set BJ −1 of J −1 satisfying kBJ −1 k ≤ 1/sIVIP . This
independent set is also an independent set of L−1 , and we obtain an independent set BM −1
of M −1 from it by multiplying the vectors of BJ −1 by v. As in the proof of Theorem 17.3.1,
we obtain kBM −1 k ≤ 2t/sIVIP .

√We aim to set t as small as possible. For some function g(n) that is ω( log n), sinceN ≥ b, we can set s = n · kf k · g(n), and then t = γMult (R) · n2.5 · kf k · g(n).

CHAPTER 19. BASING SECURITY ON WORST-CASE SIVP IN IDEAL LATTICES183

19.2

Reduction of SIVP to IVIP

In SIVP, the length requirement on the output basis is stated in more absolute terms as amultiple of the nth minimum of the lattice, rather than relative to a trivial known basis.
Definition 19.2.1 (Ideal SIVP). Fix ring R and a positive real dSIVP ≥ 1. Let BM be abasis for an ideal lattice M of R. The problem is: given BM (and the fixed values), output
an independent set BM of M for which kBM k ≤ dSIVP · λn (M ).
Toward reducing Ideal SIVP to Ideal IVIP, it is convenient to use an intermediateproblem.
Definition 19.2.2 (Inverse Ideal SIVP). Fix ring R and a positive real dISIVP ≥ 1. Let BM
be a basis for an ideal lattice M of R. The problem is: given BM (and the fixed values),
output an independent set BM −1 of M −1 for which kBM −1 k ≤ dISIVP · λn (M −1 ).
It is easy to reduce Ideal SIVP to Inverse Ideal SIVP. (For convenience, we will use
SIVP and ISIVP to refer to these two problems.)
Theorem 19.2.3. Suppose that there is an algorithm A that solves dISIVP -ISIVP. Then
there is an algorithm B that solves dISIVP -SIVP.
Proof. B is given the basis BM of an ideal M for which it wants to solve SIVP. It gives
to A a basis BJ of the ideal J ← det(M ) · M −1 ⊂ R. A sends back an independent set
BJ −1 of J −1 for which kBJ −1 k ≤ dISIVP · λn (J −1 ). We know that J −1 = (1/ det(M )) · M ;so, by multiplying BJ −1 by det(M ), we obtain an independent set BM of M that satisfies
kBM k ≤ dISIVP · λn (M ).
The following theorem states the reduction from ISIVP to IVIP.
Theorem 19.2.4. Let dISIVP = (3 · e)1/n · dIVIP , where e is Euler’s constant. Suppose that√
there is an algorithm A that solves IVIP for parameter sIVIP > 8 · γMult (R) · n2.5 ω( log n)
for all ideals with determinant at least dnIVIP . Then, there is an algorithm B that solves
dISIVP -ISIVP. The running time is approximately log dIVIP times that of A.
Combining Theorem 19.1.1 with Theorem 19.2.4, we have the following corollary.
Corollary 19.2.5. Suppose that there is an algorithm A that solves sIVIP -IVIP for sIVIP >16 · γMult (R)2 · n5 · kf k · g(n) for some g(n) that is ω(log n), whenever the given ideal has

CHAPTER 19. BASING SECURITY ON WORST-CASE SIVP IN IDEAL LATTICES184

det(J) ∈ [a, b] for [a, b] = [dnIVIP , 2 · dnIVIP ]. Assume that invertible prime ideals with norms
in [a, b] are not negligibly sparse. Then, there is an algorithm B that solves worst-casedISVIP -ISIVP for dISVIP = (3 · e)1/n · dIVIP , where e is Euler’s constant.
Roughly speaking (and somewhat inaccurately), our reduction from ISIVP to IVIP will
work as follows. We are given an ideal M for which we want to solve ISIVP – i.e., find a short
independent set for M −1 . Our reduction will solve the ISIVP by using our IVIP algorithm
A recursively. We feed M to A. A sends back an “improved” basis BM −1 of M −1 for whichkBM −1 k ≤ 1/s for some s > 1. We use this improved basis to find a different ideal lattice,
J1 , that has the basically same “shape” as M , but a smaller determinant. Our method for
doing this is to use the GPV algorithm to sample v from the intersection of M −1 and the√translated ball (1/2)e1 + B( n(log n)/s), and then to set J1 ← (v) · M , which is an integer
ideal lattice. GPV is able to use the improved basis to sample from this ball, even though
the ball’s radius is somewhat small (when s is large enough). The vector v is very close, andnearly parallel, to (1/2)e1 . For this reason, the rotation basis of v is a nearly orthogonal
matrix. In particular, the mapping from J1−1 to M −1 given by multiplication by the vector
v roughly preserves “shape.” Also, we have det(J1 ) = det(v) · det(M ) ≈ 2−n · det(M ) –i.e., the determinant decreases. Ultimately, through recursion, we end up with a lattice Ji
whose determinant is less than dnIVIP , and which has basically the same shape as M – i.e.,
again, a known nearly orthogonal matrix transforms one ideal to the other. Since Ji has
determinant less than dnIVIP , and therefore λn (Ji−1 ) ≥ 1/dIVIP , the “unimproved” basis {ei }is a dIVIP -ISIVP solution for Ji . We then use the nearly orthogonal matrix that transforms
Ji−1 to M −1 to obtain a (3 · e)1/n · dIVIP -approximate solution to ISIVP for M .
Proof. (Theorem 19.2.4) Given basis BM of ideal M , B does the following pre-processing
operation.
1. It generates a basis of M −1 and runs LLL on it to obtain a basis BM −1 of M −1 thatsatisfies kBM −1 k ≤ 2n · λn (M −1 ).
2. It generates a vector v0 ∈ M −1 that is insIVIP · kBM −1 k ·¡¢√(1/2)e1 + B( n(log n)/sIVIP )3. It sets J0 ← (v0 ) · M and computes a basis B0 of J0 .

CHAPTER 19. BASING SECURITY ON WORST-CASE SIVP IN IDEAL LATTICES185

It sets i = 0 and enters the following loop.
1. If det(Ji ) < dnIVIP , it outputs the rotation basis Bw of the vector w ←Qi

j=0 vj andiend ← i; break.
2. It runs A on Bi and receives from A a basis B∗i of Ji−1 with kB∗i k ≤ 1/sIVIP .
√3. It generates a vector vi+1 ∈ Ji−1 ∩ ((1/2)e1 + B( n(log n)/sIVIP )).
4. It sets Ji+1 ← (vi+1 ) · Ji , computes a basis Bi+1 of Ji+1 , and increments i.
(Notice that all of the Ji are integer ideals, even though the vi ’s are not necessarily elementsof R, but rather elements of Q[x]/(f (x)). For example, J0 is an integer ideal since it isgenerated by v0 × mi for mi ∈ M , and all of these generators are elements of R sincev0 ∈ M −1 .)First, we check that B can perform all of the steps efficiently; this is obvious aside except
for Step 2 of the preprocessing operation and Step 3 of the loop. In both cases, we pick a√
point from the intersection of a lattice and a ball whose radius is at least n log n times thelength of some independent set that we have for that lattice. (In the preprocessing step,
we trivially have the independent set {ei } of M −1 , and in the loop step we have B∗i , anindependent set of Ji−1 received from the IVIP-solver A that must satisfy kB∗i k ≤ 1/sIVIP
by assumption.) We can use the GPV algorithm (see Chapter 13) to sample a point fromthe lattice according to a discrete Gaussian distribution (centered anywhere we want) whose
deviation parameter is less than log n times the length of our independent set. By Lemma√
13.2.2, with overwhelming probability, the sampled point falls within a ball of radius ntimes that deviation parameter. This implies that we can efficiently sample the vi as
claimed.
Next, we claim that the algorithm terminates in polynomial time with an iend such thatdet(Jiend ) < dnIVIP . Obviously, the algorithm does not break until det(Ji ) < dnIVIP . Also, we
have that det(Ji+1 ) = det((vi )) · det(Ji ) ≈ (1/2)n · det(Ji ) – i.e., the determinant decreases
substantially with each iteration.
A bit more accurately, Lemma 15.1.6 tells us that det((vi )) < e/2n . Suppose det(Ji ) >dnIVIP . We have that det(Ji ) < (e/2n )i · det(J0 ), implying
i < log2n /e (det(J0 )/ det(Ji )) < log2n /e (det(J0 )/dnIVIP ) ≤ log2n /e det(J0 )CHAPTER 19. BASING SECURITY ON WORST-CASE SIVP IN IDEAL LATTICES186

We also have thatdet(J0 ) = det((v0 )) · det(M )≤ e · (sIVIP /2)n · kBM −1 kn · det(M )≤ e · (sIVIP /2)n · (2n · γMult (R) · det(M )−1/n )n · det(M )≤ e · (2n · sIVIP · γMult (R)/2)nSince (2n /e)2n−1 > e · (2n · sIVIP · γMult (R)/2)n for reasonable values of sIVIP and γMult (R),
we have that det(Ji ) > dnIVIP implies i < 2n − 1. Therefore, iend ≤ 2n − 1 and the algorithm
terminates in polynomial time.
Finally, let us consider the output basis Bw , the rotation basis of w ←(w) = Jiend

Qiend

j=0 vj . Since−1−1· M , we have that (w) is a sub-lattice of M
and therefore the rotationbasis Bw is an independent set of M −1 . It remains to compute kBw k. From the fact thatdet(Jiend ) < dnIVIP , we have thatdet((w)) < dnIVIP / det(M )We claim thatkBw k ≤ (3e)1/n · det((w))1/n
The theorem follows from this claim, sincedet((w))1/n ≤ dIVIP · det(M −1 )1/n ≤ dIVIP · λn (M −1 )√For j > 0, we have vj = (1/2)(e1 + xj ), where kxj k ≤ 2 n(log n)/sIVIP ; for j = 0 theseequations are just multiplied by sIVIP · kBM −1 k – i.e., v0 = (sIVIP · kBM −1 k/2)(e1 + x0 ),√where kx0 k ≤ 2 n(log n)/sIVIP . So,
iY
end
j=0

vj = sIVIP · kBM −1 k/2iend +1 ·

iY
end
j=0

(e1 + xj )

CHAPTER 19. BASING SECURITY ON WORST-CASE SIVP IN IDEAL LATTICES187

We bound the distance of
°
°
°
°
iY
end
°
°
°e1 −
(e1 + xj )°
°
° ≤
°
°
j=0

Qiend

j=0 (e1 + xj ) from e1 :

°
°
°Y °
°
°
°
xj °
°
°
°
∅6=S⊂[0,iend ] °j∈S
X√≤
γMult (R)|S|−1 · (2 n(log n)/sIVIP )|S|X

∅6=S⊂[0,iend ]= (1/γMult (R))

X√
(γMult (R) · 2 n(log n)/sIVIP )|S|

∅6=S⊂[0,iend ]¡¢√= (1/γMult (R)) −1 + (1 + γMult (R) · 2 n(log n)/sIVIP )iend +1√≤ (1/γMult (R))(−1 + e(iend +1)γMult (R)·2 n(log n)/sIVIP )√≤ (2/γMult (R)) · ((iend + 1)γMult (R) · 2 n(log n)/sIVIP )√≤ 8n n(log n)/sIVIP≤ 1/nγMult (R)The third-from-last inequality holds for reasonable values of n. Specifically, −1 + et ≈ t forsmall values of t, and the exponent in the fourth-from-last expression is at most 1/2n (fromthe upper bound on iend and lower bound on sIVIP ). For n ≥ 1/2, t is small enough so thatindeed −1 + et ≤ 2t, as needed for the inequality.
So, for some x with kxk ≤ 1/nγMult (R), we havew = sIVIP · kBM −1 k/2iend +1 · (e1 + x)
Thus, by Lemma 15.1.1, kBw k ≤ (sIVIP · kBM −1 k/2iend +1 ) · (1 + 1/n).
By Lemma 15.1.6, we obtain det((w)) ≥ (sIVIP · kBM −1 k/2iend +1 )n /3, from which theclaim follows.

Chapter 20

Circuit Privacy
Recall our definition of circuit privacy (Definition 2.1.6). We say that a homomorphic
encryption scheme E is circuit-private for circuits in CE if, for any key-pair (sk, pk) output
by KeyGenE (λ), any circuit C ∈ CE , and any fixed ciphertexts Ψ = hψ1 , . . . , ψt i that are in
the image of EncryptE for plaintexts π1 , . . . , πt , the following distributions (over the random
coins in EncryptE , EvaluateE ) are (statistically) indistinguishable:
EncryptE (pk, C(π1 , . . . , πt )) ≈ EvaluateE (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 approachis to use a public (i.e., not using the secret key) algorithm RandomizeCTE that, applied posthoc, induces the same distribution (statistically) to ciphertexts output by EncryptE and
EvaluateE , while preserving correctness.
The idea is simple: to construct a random encryption ψ 0 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 EncryptE or EvaluateE , is a vector lying inside188

CHAPTER 20. CIRCUIT PRIVACY

189

J + B(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 muchfurther away from J. In particular, it will be chosen from J +B(α·rDec /m) where α is superpolynomial, so that the “noise” from this randomizing encryption statistically obliterates
any information about the initial ciphertext’s offset from J. We need B(α · rDec /m) ⊂ XDecto ensure correct decryption; so, this tweak once again entails increasing m.

Bibliography[1] N. Ahituv, Y. Lapid, and S. Neumann. Processing Encrypted Data, In Comm. of theACM, vol. 20, pages 777–780, 1987.
[2] M. Ajtai. Generating hard instances of lattice problems (extended abstract). In Proc.
of STOC ’96, pages 99–108, 1996.
[3] M. Ajtai. Generating hard instances of the short basis problem. In Proc. of ICALP’99, pages 1-9, 1999.
[4] M. Ajtai and C. Dwork. A public key cryptosystem with worst-case / average-caseequivalence. In Proc. of STOC ’97, pages 284–293, 1997.
[5] 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.
[6] 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.
[7] F. Armknecht and A.-R. Sadeghi. A New Approach for Algebraically Homomorphic
Encryption. Cryptology ePrint Archive: Report 2008/422.
[8] S. Arora, C. Lund, R. Motwani, M. Sudan, and M. Szegedy. Proof verification andthe hardness of approximation problems. J. of the ACM, vol. 45, no. 3, 1998, pages
501–555.
[9] L. Babai. On Lovaszs lattice reduction and the nearest lattice point problem, Combinatorica, 6 (1986), pp. 113. Preliminary version in STACS 1985.
[10] E. Bach and J. Shallit. Algorithmic Number Theory, Volume 1, 1996.

190

BIBLIOGRAPHY

191[11] W. Banaszczyk. New bounds in some transference theorems in the geometry of numbers. Mathematische Annalen 296(4) (1993) 625–635.
[12] 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.
[13] D. Barrington. Bounded-width polynomial-size branching programs recognize exactly
those languages in NC1. In Proc. of STOC ’86, pages 1–5.
[14] D. Beaver. Minimal-latency secure function evaluation. In Proc. of Eurocrypt ’00, pages
335350. Springer, 2000.
[15] M. Bellare and A. Sahai. Non-malleable encryption. Equivalence between two notions,and an indistinguishability-based characterization. In Proc. of Crypto ’99, LNCS 1666,
pages 519–536. Springer, 1999.
[16] 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.
[17] J. Benaloh. Verifiable secret-ballot elections. Ph.D. thesis, Yale Univ., Dept. of Comp.
Sci., 1988.
[18] J. Black, P. Rogaway, and T. Shrimpton. Encryption-scheme security in the presenceof key-dependent messages. In Proc. of SAC ’02, LNCS 2595, pages 62–75. Springer,
2002.
[19] M. Blaze, G. Bleumer, and M. Strauss. Divertible protocols and atomic proxy cryptography. Eurocrypt ’98, LNCS 1403, pp. 127–144.
[20] D. Boneh and M. Franklin. Efficient Generation of Shared RSA Keys. J. ACM, vol. 48,
no. 4. Pages, 702-722. ACM, 2001. Preliminary version in Crypto 1997.
[21] D. Boneh, E.-J. Goh, and K. Nissim. Evaluating 2-DNF formulas on ciphertexts. TCC’05, LNCS 3378, pp. 325–341.
[22] 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.

BIBLIOGRAPHY

192[23] 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.
[24] J. Boyar, R. Peralta, and D. Pochuev. On the Multiplicative Complexity of Boolean
Functions over the Basis (∧, ⊕, 1). Theor. Comput. Sci. 235(1), pp. 43–57, 2000.
[25] E. Brickell and Y. Yacobi. On Privacy Homomorphisms. In Proc. of Eurocrypt ’87,
LNCS 304, pages 117–125. Springer, 1988.
[26] J.Y. Cai and A. Nerurkar. An improved worst-case to average-case connection for lattice
problems. In Proc. of FOCS ’97, pages 468–477.
[27] R. Canetti. Personal communication, 2008.
[28] R. Canetti, O. Goldreich, and S. Halevi. The random oracle methodology, revisited. In
Proc. of STOC ’98, pages 209–218. ACM, 1998.
[29] R. Canetti and S. Hohenberger. Chosen-ciphertext secure proxy re-encryption. In Proc.
of ACM CCS ’07.
[30] R. Canetti, H. Krawczyk, and J.B. Nielsen. Relaxing chosen-ciphertext security. In
Proc. of Crypto ’03, pages 565–582. Springer, 2003.
[31] B. Chor, N. Gilboa, and M. Naor. Private information retrieval by keywords. TR
CS0917, Dept. of Computer Science, Technion, 1997.
[32] M. Christodorescu. Private Use of Untrusted Web Servers via Opportunistic Encryption. In Web 2.0 Security and Privacy, 2008.
[33] D. Coppersmith and G. Seroussi. On the minimum distance of some quadratic residue
codes. In IEEE Trans. Inform. Theory 30 (1984), 407–411.
[34] D. Coppersmith and A. Shamir. Lattice Attacks on NTRU. In Proc. of Eurocrypt ’97,
LNCS 1233, pages 52–61.
[35] R. Cramer, I. Damgaard, and J. B. Nielsen. Multiparty computation from thresholdhomomorphic encryption. In Proc. of Crypto ’01, LNCS 2045, pages 280–300.
[36] R. Cramer and V. Shoup. A Practical Public Key Cryptosystem Provably Secure
Against Adaptive Chosen Ciphertext Attack. Crypto ’98, LNCS 1462, pp. 13–25.

BIBLIOGRAPHY

193[37] W. van Dam, S. Hallgren, and L. Ip. Quantum algorithms for some hidden shift problems. In Proc. of SODA ’03, pages 489–498. Full version in SIAM J. Comput. 36(3):763–778 (2006).
[38] I. Damgard and M. Jurik. A Length-Flexible Threshold Cryptosystem with Applications. ACISP ’03, LNCS 2727, pages 350–356.
[39] I. Damgard and J.B. Nielsen. Universally composable efficient multiparty computationfrom threshold homomorphic encryption. In Proc. of Crypto ’03, LNCS 2729, pages
247–264. Springer, 2003.
[40] M. van Dijk Interval Obfuscation. To be published as an MIT-CSAIL Technical Reportin 2009. Also, personal communication, 2009.
[41] D. Dolev, C. Dwork, and M. Naor. Nonmalleable cryptography. SIAM J. Comput.
30(2):391–437 (electronic), 2000. Preliminary version in STOC 1991.
[42] T. ElGamal. A Public-Key Cryptosystem and a Signature Scheme Based on Discrete
Logarithms. Crypto ’84, pp. 469–472.
[43] R. Endsuleit, W. Geiselmann, and R. Steinwandt. Attacking a polynomial-based cryptosystem: Polly Cracker. Int. Jour. Information Security, (1):143–148, 2002.
[44] 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.
[45] M. Franklin and S. Haber. Joint encryption and message-efficient secure computation.
Journal of Cryptology, 9(4):217–232, 1996.
[46] W. Geiselmann and R. Steinwandt. Cryptanalysis of Polly Cracker. IEEE Trans. Information Theory, (48):2990–2991, 2002.
[47] C. Gentry. Key Recovery and Message Attacks on NTRU-Composite. Eurocrypt ’01,
LNCS 2045, pp. 182–194.
[48] C. Gentry. Fully Homomorphic Encryption Using Ideal Lattices. In Proc. of STOC ’09,
pages 169–178.

BIBLIOGRAPHY

194[49] C. Gentry, C. Peikert, and V. Vaikuntanathan. Trapdoors for Hard Lattices and New
Cryptographic Constructions. STOC ’08, pp. 197–206.
[50] C. Gentry and M. Szydlo. Cryptanalysis of the Revised NTRU Signature Scheme.
Eurocrypt ’02, LNCS 2332, pp. 299–320.
[51] O. Goldreich. Modern Cryptography, Probabilistic Proofs and Pseudorandomness.
1998.
[52] O. Goldreich. Foundations of Cryptography: Basic Applications, vol. 2, Cambridge
University Press, 2004.
[53] O. Goldreich, S. Goldwasser, and S. Halevi. Collision-free hashing from lattice problems. Technical Report TR96-056, Electronic Colloquium on Computational Complexity (ECCC) (1996).
[54] O. Goldreich, S. Goldwasser, and S. Halevi. Public-Key Cryptosystems from Lattice
Reduction Problems. In Proc. of Crypto ’97, LNCS 1294, pages 112-131.
[55] O. Goldreich and L. Levin. Hard-Core Predicates for Any One-Way Function. In Proc.
of STOC ’89. ACM, 1989.
[56] 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. Preliminary version in FOCS ’86.
[57] O. Goldreich and R. Ostrovsky. Software protection and simulation by oblivious RAMs.
JACM, 1996.
[58] S. Goldwasser. Personal communication, 2009.
[59] S. Goldwasser, Y. T. Kalai, and G. Rothblum. One-Time Programs. In Proc. of Crypto’08, LNCS 5157, pages 39–56. Springer, 2008.
[60] S. Goldwasser and D. Kharchenko. Proof of plaintext knowledge for the Ajtai-Dwork
cryptosystem. In Proc. of TCC 2005, pages 529-555, 2005.
[61] 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.

BIBLIOGRAPHY

195[62] S. Goldwasser and S. Micali. Probabilistic encryption. J. Comput. Syst. Sci., 28(2):270–
299, 1984.
[63] J. Groth, R. Ostrovsky, and A. Sahai. Perfect Non-Interactive Zero Knowledge for NP.
Eurocrypt ’06, LNCS 4004, pp. 339–358.
[64] L. Gurvitz. On the Complexity of Mixed Discriminants and Related Problems.
[65] I. Haitner. Personal communication, 2008.
[66] I. Haitner and T. Holenstein. On the (im)possibility of key dependent encryption. In
Proc. of TCC ’09, LNCS 5444, pages 202–219. Springer, 2008.
[67] S. Halevi. Personal communication, 2009.
[68] S. Halevi and H. Krawczyk. Security under key-dependent inputs. In Proc. of ACM
CCS ’07, 2007.
[69] J. Hoffstein, J. Pipher and J. Silverman. NTRU: A Ring Based Public Key Cryptosystem. In Proc. of ANTS ’98, LNCS 1423, pages 267–288.
[70] S. Hohenberger. Personal communication, 2009.
[71] S. Hohenberger, G. Rothblum, A. Shelat, V. Vaikuntanathan. Securely Obfuscating
Re-encryption. In Proc. of TCC ’07, LNCS 4392, pages 233-252.
[72] R. Impagliazzo, L. A. Levin, and M. Luby. Pseudo-random Generation from One-Way
Functions (Extended Abstracts). In Proc. of STOC ’89, pages 12–24.
[73] Y. Ishai and A. Paskin. Evaluating Branching Programs on Encrypted Data. In Proc.
of TCC ’07.
[74] A. Kalai. Generating Random Factored Numbers, Easily. J. Cryptology, vol. 16, no. 4,
pages 287–289. 2003. Preliminary version in SODA 2002.
[75] E. Kaltofen and V. Shoup. Subquadratic-time factoring of polynomials over finite fields.
In Proc. of STOC ’95, pages 398–406. ACM, 1995.
[76] R. Karp. A Survey of Parallel Algorithms for Shared Memory Machines.

BIBLIOGRAPHY

196[77] A. Kawachi, K. Tanaka, K. Xagawa. Multi-bit cryptosystems based on lattice problems.
In Proc. of PKC ’07, LNCS 4450, pages 315–329. Springer, 2007.
[78] J. Kilian. A Note on Efficient Zero-Knowledge Proofs and Arguments. In Proc. of
STOC ’92, pages 723–732.
[79] J. Kilian. Improved Efficient Arguments. In Proc. of Crypto ’95, LNCS 963, pages
311–324.
[80] E. Landau. Neuer Beweis des Primzahlsatzes und Beweis des Primidealsatzes. Mathematische Annalen 56: 645-670.
[81] A.K. Lenstra, H.W. Lenstra, L. Lovsz. Factoring polynomials with rational coefficients.
Math. Ann. 261(4) (1982) 515–534.
[82] F. Levy-dit-Vehel, M.G. Marinari, L. Perret, and C. Traverso. A Survey On Polly
Cracker Systems.
[83] 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.
[84] H. Lipmaa. An Oblivious Transfer Protocol with Log-Squared Communication. In Proc.
of ICS ’05 pages 314-328, 2005.
[85] L. Ly. A public-key cryptosystem based on Polly Cracker, Ph.D. thesis, RuhrUniversität Bochum, Bochum, Germany 2002.
[86] L. Ly. Polly two – a new algebraic polynomial-based public-key scheme. AAECC, 17(34), 2006.
[87] V. Lyubashevky. Personal communication, 2009.
[88] V. Lyubashevsky and D. Micciancio. Generalized compact knapsacks are collision resistant. In Proc. of ICALP ’06. Springer, 2006.
[89] V. Lyubashevsky and D. Micciancio. Generalized compact knapsacks are collision resistant. Full version.
[90] V. Lyubashevky and D. Micciancio. Asymptotically efficient lattice-based digital signatures. In Proc. of TCC ’08.

BIBLIOGRAPHY

197[91] T. Matsumoto, K. Kato, and H. Imai. Speeding up secret computations with insecure
auxiliary devices. In Proc. of Crypto ‘88, LNCS 403, pages 497-506. Springer, 1988.
[92] U. Maurer and D. Raub. Black-Box Extension Fields and the Inexistence of FieldHomomorphic One-Way Permutations. Asiacrypt ’07, pp. 427–443.
[93] A.

May,

Cryptanalysis

of

NTRU-107,

manuscript,

1999.

Availablefrom

http://www.informatik.uni- frankfurt.de/~alex/crypto.html.
[94] C.A. Melchor, G. Castagnos, and P. Gaborit. Lattice-based homomorphic encryptionof vector spaces. ISIT ’08, pp. 1858–1862.
[95] C.A. Melchor, P. Gaborit, and J. Herranz. Additive Homomorphic Encryption with
t-Operand Multiplications. Eprint 2008/378.
[96] J. Merkle. Multi-round passive attacks on server-aided RSA protocols. In Proc. of ACM
CCS ’00, pages 102-107. ACM, 2000.
[97] D. Micciancio. Improving Lattice Based Cryptosystems Using the Hermite Normal
Form. In Proc. of CaLC ’01, LNCS 2146, pages 126–145. Springer, 2001.
[98] D. Micciancio. Improved cryptographic hash functions with worst-case / average-caseconnection. In Proc. of STOC ’02, pages 609–618.
[99] 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.
[100] D. Micciancio and O. Regev. Worst-Case to Average-Case Reductions Based on Gaussian Measures. FOCS ’04, pp. 372–381.
[101] K. Mulmuley and M. Sohoni. Geometric complexity theory I: An approach to the P
vs. NP and related problems. SIAM J. Comput., 31(2):496–526, 2002.
[102] D. Naccache and J. Stern. A New Public-Key Cryptosystem Based on Higher
Residues. ACM CCS ’98.
[103] M. Naor and K. Nissim. Communication preserving protocols for secure function
evaluation. In Proc. of STOC ’01, pages 590–599, 2001.

BIBLIOGRAPHY

198[104] M. Naor and M. Yung. Public-key cryptosystems provably secure against chosen ciphertext attacks. In Proc. of STOC ’90, pages 427–437. ACM, 1990.
[105] P.Q. Nguyen and I. Shparlinski. On the Insecurity of Some Server-Aided RSA Protocol. Asiacrypt ’01, LNCS 2248, pp. 21–35.
[106] 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.
[107] A.M. Odlyzko. The rise and fall of knapsack cryptosystems. In Crypt. and Comp.
Num. Th., Proc. Sympos. Appl. Math., vol. 42, AMS, 1990, pp. 75–88.
[108] T. Okamoto and Uchiyama. A New Public-Key Cryptosystem as Secure as Factoring.
Eurocrypt ’98, LNCS 1403, pp. 308–318.
[109] R. Ostrovsky and W. E. Skeith. Private Searching on Streaming Data. In Proc. of
Crypto ’05, LNCS 3621, pp. 223–240.
[110] P. Paillier. Public-Key Cryptosystems Based on Composite Degree Residuosity
Classes. Eurocrypt ’99, pp. 223–238.
[111] C. Peikert and A. Rosen. Efficient collision-resistant hashing from worst-case assumptions on cyclic lattices. In Proc. of TCC ’06, pages 145166.
[112] C. Peikert and A. Rosen. Lattices that Admit Logarithmic Worst-Case to AverageCase Connection Factors. In Proc. of STOC ’07, pages 478–487.
[113] C. Peikert and B. Waters. Lossy Trapdoor Functions and Their Applications. STOC
’08, pp. 187–196.
[114] 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.
[115] M. Prabhakaran and M. Rosulek. Homomorphic Encryption with CCA Security. In
Proc. of ICALP ’08. Springer, 2008.
[116] C. Rackoff and D.R. Simon. Non-interactive zero-knowledge proof of knowledge andchosen ciphertext attack. In Proc. of Crypto ’91, LNCS 576, pages 433-444. Springer,
1991.

BIBLIOGRAPHY

199[117] K. W. Regan. Understanding the Mulmuley-Sohoni Approach to P vs. NP.
[118] O. Regev. New lattice-based cryptographic constructions. Journal of the ACM 51(6)(2004) 899942. Extended abstract in STOC ‘03.
[119] O. Regev. On Lattices, Learning with Errors, Random Linear Codes, and Cryptography. In Proc. of STOC ’05, pages 84–93, 2005.
[120] R. Rivest, L. Adleman, and M. Dertouzos. On data banks and privacy homomorphisms. In Foundations of Secure Computation, pages 169–180, 1978.
[121] R. Rivest, A. Shamir, and L. Adleman. A method for obtaining digital signatures andpublic-key cryptosystems. In Comm. of the ACM, 21:2, pages 120–126, 1978.
[122] T. Sander, A. Young, and M. Yung. Non-interactive cryptocomputing for NC1. In
Proc. of FOCS ’99, pages 554–567, 1999.
[123] C.P. Schnorr. A Hierarchy of Polynomial Time Lattice Basis Reduction Algorithms.
Theoretical Computer Science, 53(2-3):201–224, 1987.
[124] P.W. Shor. Polynomial-time algorithms for prime factorization and discrete logarithms
on a quantum computer. SIAM Journal on Computing, 26(5): 1484–1509, 1997. Extended abstract in FOCS ’94.
[125] D.X. Song, D. Wagner, and A. Perrig. Practical techniques for searches on encrypted
data. In IEEE Symposium on Security and Privacy, pages 44–55, 2000.
[126] R. Steinwandt. A ciphertext-only attack on Polly Two, 2006.
[127] P. Stevenhagen. The Arithmetic of Number Rings. Algorithmic Number Theory, MSRI
Publications, Volume 44, 2008. See also Stevenhagen’s course notes “Number Rings.”[128] D.R. Stinson. Some baby-step giant-step algorithms for the low hamming weight discrete logarithm problem. Mathematics of Computation, vol. 71, no. 237, pages 379–391,
2001.
[129] A.C. Yao. Protocols for secure computations (extended abstract). FOCS ’82, pages
80–91.
[130] A. C. Yao. How to generate and exchange secrets. FOCS ’86, pages 162-167.