22.04.2014 Views

a590003

a590003

a590003

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ool isOne() const; // does it point to 1?<br />

bool operator==(const SKHandle& other) const;<br />

bool operator!=(const SKHandle& other) const;<br />

bool mul(const SKHandle& a, const SKHandle& b); // multiply the handles<br />

// result returned in *this, returns true if handles can be multiplied<br />

3.1.2 The CtxtPart class<br />

A ciphertext-part is a polynomial with a handle (that “points” to a secret-key polynomial). Accordingly,<br />

the class CtxtPart is derived from DoubleCRT, and includes an additional data member of<br />

type SKHandle. This class does not provide any methods beyond the ones that are provided by the<br />

base class DoubleCRT, except for access to the secret-key handle (and constructors that initialize<br />

it).<br />

3.1.3 The Ctxt class<br />

A Ctxt object is always defined relative to a fixed public key and context, both must be supplied<br />

to the constructor and are fixed thereafter. As described above, a ciphertext contains a vector of<br />

parts, each part with its own handle. This type of representation is quite flexible, for example you<br />

can in principle add ciphertexts that are defined with respect to different keys, as follows:<br />

• For parts of the two ciphertexts that point to the same secret-key polynomial (i.e., have the<br />

same handle), you just add the two DoubleCRT polynomials.<br />

• Parts in one ciphertext that do not have counter-part in the other ciphertext will just be<br />

included in the result intact.<br />

For example, suppose that you wanted to add the following two ciphertexts. one “canonical” and<br />

the other after an automorphism X ↦→ X 3 :<br />

⃗c = (c 0 [i = 0, r = 0, t = 0], c 1 [i = 0, r = 1, t = 1])<br />

and ⃗c ′ = (c ′ 0[i = 0, r = 0, t = 0], c ′ 3[i = 0, r = 1, t = 3]).<br />

Adding these ciphertexts, we obtain a three-part ciphertext,<br />

⃗c + ⃗c ′ = ((c 0 + c ′ 0)[i = 0, r = 0, t = 0], c 1 [i = 0, r = 1, t = 1], c ′ 3[i = 0, r = 1, t = 3]).<br />

Similarly, we also have flexibility in multiplying ciphertexts using a tensor product, as long as all<br />

the pairwise handles of all the parts can be multiplied according to the rules from Section 3.1.1<br />

above.<br />

The Ctxt class therefore contains a data member vector parts that keeps all of<br />

the ciphertext-parts. By convention, the first part, parts[0], always has a handle pointing to<br />

the constant polynomial 1. Also, we maintain the invariant that all the DoubleCRT objects in the<br />

parts of a ciphertext are defined relative to the same subset of primes, and the IndexSet for this<br />

subset is accessible as ctxt.getPrimeSet(). (The current BGV modulus for this ciphertext can<br />

be computed as q = ctxt.getContext().productOfPrimes(ctxt.getPrimeSet()).)<br />

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