22.04.2014 Views

a590003

a590003

a590003

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Organization of This Report<br />

We begin in Section 1 with a brief high-level overview of the BGV cryptosystem and some important<br />

features of the variant that we implemented and our choice of representation, as well as an overview<br />

of the structure of our library. Then in Sections 2, 3,4 we give a bottom-up detailed description of<br />

all the modules in the library. We conclude in Section 5 with some examples of using this library.<br />

1 The BGV Homomorphic Encryption Scheme<br />

A homomorphic encryption scheme [8, 3] allows processing of encrypted data even without knowing<br />

the secret decryption key. In this report we describe the design and implementation of a<br />

software library that we wrote to implements the Brakerski-Gentry-Vaikuntanathan (BGV) homomorphic<br />

encryption scheme [2]. We begin by a high-level description of the the BGV variant<br />

that we implemented, followed by a detailed description of the various software components in our<br />

implementation. the description in this section is mostly taken from the full version of [5].<br />

Below we denote by [·] q the reduction-mod-q function, namely mapping an integer z ∈ Z to the<br />

unique representative of its equivalence class modulo q in the interval (−q/2, q/2]. We use the same<br />

notation for modular reduction of vectors, matrices, and polynomials (in coefficient representation).<br />

Our BGV variant is defined over polynomial rings of the form A = Z[X]/Φ m (X) where m<br />

is a parameter and Φ m (X) is the m’th cyclotomic polynomial. The “native” plaintext space for<br />

this scheme is usually the ring A 2 = A/2A, namely binary polynomials modulo Φ m (X). (Our<br />

implementation supports other plaintext spaces as well, but in this report we mainly describe the<br />

case of plaintext space A 2 . See some more details in Section 2.4.) We use the Smart-Vercauteren<br />

CTR-based encoding technique [10] to “pack” a vector of bits in a binary polynomial, so that<br />

polynomial arithmetic in A 2 translates to entry-wise arithmetic on the packed bits.<br />

The ciphertext space for this scheme consists of vectors over A q = A/qA, where q is an odd<br />

modulus that evolves with the homomorphic evaluation. Specifically, the system is parametrized<br />

by a “chain” of moduli of decreasing size, q 0 > q 1 > · · · > q L and freshly encrypted ciphertexts are<br />

defined over R q0 . During homomorphic evaluation we keep switching to smaller and smaller moduli<br />

until we get ciphertexts over A qL , on which we cannot compute anymore. We call ciphertexts that<br />

are defined over A qi “level-i ciphertexts”. These level-i ciphertexts are 2-element vectors over R qi ,<br />

i.e., ⃗c = (c 0 , c 1 ) ∈ (A qi ) 2 .<br />

Secret keys are polynomials s ∈ A with “small” coefficients, and we view s as the second element<br />

of the 2-vector ⃗s = (1, s). A level-i ciphertext ⃗c = (c 0 , c 1 ) encrypts a plaintext polynomial m ∈ A 2<br />

with respect to ⃗s = (1, s) if we have the equality over A, [〈⃗c, ⃗s〉] qi = [c 0 + s · c 1 ] qi ≡ m (mod 2), and<br />

moreover the polynomial [c 0 +s·c 1 ] qi is “small”, i.e. all its coefficients are considerably smaller than<br />

q i . Roughly, that polynomial is considered the “noise” in the ciphertext, and its coefficients grow<br />

as homomorphic operations are performed. We note that the crux of the noise-control technique<br />

from [2] is that a level-i ciphertext can be publicly converted into a level-(i + 1) ciphertext (with<br />

respect to the same secret key), and that this transformation reduces the noise in the ciphertext<br />

roughly by a factor of q i+1 /q i .<br />

Following [7, 4, 5], we think of the “size” of a polynomial a ∈ A the norm of its canonical<br />

embedding. Recall that the canonical embedding of a ∈ A into C φ(m) is the φ(m)-vector of complex<br />

numbers σ(a) = (a(τm)) j j where τ m is a complex primitive m-th root of unity (τ m = e 2πi/m ) and<br />

the indexes j range over all of Z ∗ m. We denote the l 2 -norm of the canonical embedding of a by<br />

1<br />

16. Design and Implementation of a Homomorphic-Encryption Library

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!