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.

DoubleCRT& operator-=(const ZZ &num);<br />

DoubleCRT& operator-=(long num);<br />

// These are the prefix versions, ++dcrt and --dcrt.<br />

DoubleCRT& operator++();<br />

DoubleCRT& operator--();<br />

// Postfix versions (return type is void, it is offered just for style)<br />

void operator++(int);<br />

void operator--(int);<br />

DoubleCRT& operator*=(const DoubleCRT &other); // Multiplication<br />

DoubleCRT& operator*=(const ZZX &poly); // expensive<br />

DoubleCRT& operator*=(const ZZ &num);<br />

DoubleCRT& operator*=(long num);<br />

// Procedural equivalents, providing also the matchIndexSets flag<br />

void Add(const DoubleCRT &other, bool matchIndexSets=true);<br />

void Sub(const DoubleCRT &other, bool matchIndexSets=true);<br />

void Mul(const DoubleCRT &other, bool matchIndexSets=true);<br />

DoubleCRT& operator/=(const ZZ &num);<br />

DoubleCRT& operator/=(long num);<br />

// Division by constant<br />

void Exp(long k);<br />

// Small-exponent polynomial exponentiation<br />

// Automorphism F(X) --> F(X^k) (with gcd(k,m)==1)<br />

void automorph(long k);<br />

DoubleCRT& operator>>=(long k);<br />

We also provide methods for choosing at random polynomials in DoubleCRT format, as follows:<br />

void randomize(const ZZ* seed=NULL);<br />

Fills each row i ∈ getIndexSet() with random integers modulo p i . This procedure uses the<br />

NTL PRG, setting the seed to the seed argument if it is non-NULL, and using the current<br />

PRG state of NTL otherwise.<br />

void sampleSmall();<br />

Draws a random polynomial with coefficients −1, 0, 1, and converts it to DoubleCRT format.<br />

Each coefficient is chosen as 0 with probability 1/2, and as ±1 with probability 1/4 each.<br />

void sampleHWt(long weight);<br />

Draws a random polynomial with coefficients −1, 0, 1, and converts it to DoubleCRT format.<br />

The polynomial is chosen at random subject to the condition that all but weight of its<br />

coefficients are zero, and the non-zero coefficients are random in ±1.<br />

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