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.

EncryptedArray/EncrytedArrayMod2r<br />

Routing plaintext slots, §4.1<br />

Crypto<br />

KeySwitching<br />

Matrices for key-switching, §3.3<br />

FHE<br />

KeyGen/Enc/Dec, §3.2<br />

Ctxt<br />

Ciphertext operations, §3.1<br />

FHEcontext<br />

parameters, §2.7<br />

SingleCRT/DoubleCRT<br />

polynomial arithmetic, §2.8<br />

Math<br />

CModulus<br />

polynomials mod p, §2.3<br />

PAlgebra2/PAlgebra2r<br />

plaintext-slot algebra, §2.5<br />

IndexSet/IndexMap<br />

Indexing utilities, §2.6<br />

bluestein<br />

FFT/IFFT, §2.3<br />

PAlgebra<br />

Structure of Zm*, §2.4<br />

NumbTh<br />

miscellaneous<br />

utilities, §2.2<br />

timing<br />

§2.1<br />

Figure 1: A block diagram of the Homomorphic-Encryption library<br />

reconstruction of polynomials in coefficient representation, conversion functions between different<br />

types, procedures to sample at random from various distributions, etc.<br />

2.3 bluestein and Cmodulus: Polynomials in FFT Representation<br />

The bluestein module implements a non-power-of-two FFT over a prime field Z p , using the Bluestein<br />

FFT algorithm [1]. We use modulo-p polynomials to encode the FFTs inputs and outputs. Specifically<br />

this module builds on Shoup’s NTL library [9], and contains both a bigint version with types<br />

ZZ p and ZZ pX, and a smallint version with types zz p and zz pX. We have the following functions:<br />

void BluesteinFFT(ZZ_pX& x, const ZZ_pX& a, long n, const ZZ_p& root,<br />

ZZ_pX& powers, FFTRep& Rb);<br />

void BluesteinFFT(zz_pX& x, const zz_pX& a, long n, const zz_p& root,<br />

zz_pX& powers, fftRep& Rb);<br />

These functions compute length-n FFT of the coefficient-vector of a and put the result in x. If the<br />

degree of a is less than n then it treats the top coefficients as 0, and if the degree is more than n<br />

then the extra coefficients are ignored. Similarly, if the top entries in x are zeros then x will have<br />

degree smaller than n. The argument root needs to be a 2n-th root of unity in Z p . The inverse-FFT<br />

is obtained just by calling BluesteinFFT(...,root −1 ,...), but this procedure is NOT SCALED.<br />

Hence calling BluesteinFFT(x,a,n,root,...) and then BluesteinFFT(b,x,n,root −1 ,...) will<br />

result in having b = n × a.<br />

In addition to the size-n FFT of a which is returned in x, this procedure also returns the<br />

powers of root in the powers argument, powers = ( 1, root, root 4 , root 9 , . . . , root (n−1)2 )<br />

. In the<br />

Rb argument it returns the size-N FFT representation of the negative powers, for some N ≥ 2n−1,<br />

N a power of two:<br />

Rb = F F T N<br />

(<br />

0, . . . , 0, root<br />

−(n−1) 2 , . . . , root −4 , root −1 , 1, root −1 , root −4 , . . . , root −(n−1)2 0, . . . , 0 ) .<br />

4<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!