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.

ool isCorrect() const; and double log of ratio() const; The method isCorrect() compares<br />

the noise estimate to the current modulus, and returns true if the noise estimate is<br />

less than half the modulus size. Specifically, if √ noiseVar < q/2. The method double<br />

log of ratio() returns log(noiseVar)/2 − log(q).<br />

Access methods.<br />

Read-only access the data members of a Ctxt object:<br />

const FHEcontext& getContext() const;<br />

const FHEPubKey& getPubKey() const;<br />

const IndexSet& getPrimeSet() const;<br />

const xdouble& getNoiseVar() const;<br />

const long getPtxtSpace() const; // the plaintext-space modulus<br />

const long getKeyID() const; // key-ID of the first part not pointing to 1<br />

3.2 The FHE module: Keys and key-switching matrices<br />

Recall that we made the high-level design choices to allow instances of the cryptosystem to have<br />

multiple secret keys. This decision was made to allow a leveled encryption system that does not<br />

rely on circular security, as well as to support switching to a different key for different purposes<br />

(which may be needed for bootstrapping, for example). However, we still view using just a single<br />

secret-key per instance (and relying on circular security) as the primary mode of using our library,<br />

and hence provided more facilities to support this mode than for the mode of using multiple keys.<br />

Regardless of how many secret keys we have per instance, there is always just a single public<br />

encryption key, for encryption relative to the first secret key. (The public key in our variant of<br />

the BGV cryptosystem is just a ciphertext, encrypting the constant 0.) In addition to this public<br />

encryption key, the public-key contains also key-switching matrices and some tables to help finding<br />

the right matrices to use in different settings. Ciphertexts relative to secret keys other than the<br />

first (if any), can only be generated using the key-switching matrices in the public key.<br />

3.2.1 The KeySwitch class<br />

This class implements key-switching matrices. As we described in Section 3.1.6, a key-switching<br />

matrix from s ′ to s, denoted W [s ′ ⇒ s], is a 2 × n matrix of polynomials from A Q , where Q is the<br />

product of all the small primes in our chain (both ciphertext-primes and special-primes). Recall<br />

that the ciphertext primes are partitioned into n digits, where we denote the product of primes<br />

corresponding the i’th digit by D i . Then the i’th column of the matrix W [s ′ ⇒ s] is a pair of<br />

elements (a i , b i ) ∈ AQ 2 that satisfy<br />

[b i + a i · s] Q = ( ∏ j

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

Saved successfully!

Ooh no, something went wrong!