HElib  1.0
Implementing Homomorphic Encryption
 All Classes Files Functions Variables Friends Pages
Public Member Functions | Friends | List of all members
SingleCRT Class Reference

This class hold integer polynomials modulo many small primes. More...

#include <SingleCRT.h>

Public Member Functions

 SingleCRT (const ZZX &poly, const FHEcontext &_context, const IndexSet &s)
 
 SingleCRT (const ZZX &poly, const FHEcontext &_context)
 
 SingleCRT (const ZZX &poly)
 
 SingleCRT (const FHEcontext &_context, const IndexSet &s)
 
 SingleCRT (const FHEcontext &_context)
 
SingleCRToperator= (const SingleCRT &other)
 
SingleCRToperator= (const DoubleCRT &dcrt)
 
SingleCRToperator= (const ZZX &poly)
 
SingleCRToperator= (const ZZ &num)
 
SingleCRToperator= (const long num)
 
bool operator== (const SingleCRT &other) const
 
bool operator!= (const SingleCRT &other) const
 
SingleCRTsetZero ()
 
SingleCRTsetOne ()
 
void addPrimes (const IndexSet &s1)
 
void removePrimes (const IndexSet &s1)
 
SingleCRToperator+= (const SingleCRT &other)
 
SingleCRToperator+= (const ZZX &poly)
 
SingleCRToperator+= (const ZZ &num)
 
SingleCRToperator+= (long num)
 
SingleCRToperator-= (const SingleCRT &other)
 
SingleCRToperator-= (const ZZX &poly)
 
SingleCRToperator-= (const ZZ &num)
 
SingleCRToperator-= (long num)
 
void Add (const SingleCRT &other, bool matchIndexSet=true)
 
void Sub (const SingleCRT &other, bool matchIndexSet=true)
 
SingleCRToperator++ ()
 
SingleCRToperator-- ()
 
void operator++ (int)
 
void operator-- (int)
 
SingleCRToperator*= (const ZZ &num)
 
SingleCRToperator*= (long num)
 
SingleCRToperator/= (const ZZ &num)
 
SingleCRToperator/= (long num)
 
void toPoly (ZZX &p, const IndexSet &s) const
 
void toPoly (ZZX &p) const
 
const IndexMap< ZZX > & getMap () const
 
const FHEcontextgetContext () const
 

Friends

class DoubleCRT
 

Detailed Description

This class hold integer polynomials modulo many small primes.

SingleCRT form is a map from an index set to (ZZX) polynomials, where the i'th polynomial contains the coefficients wrt the ith prime in the chain of moduli. The polynomial thus represented is defined modulo the product of all the primes in use.

This is mostly a helper class for DoubleCRT, and all the rules that apply to DoubleCRT wrt moduli sets apply also to SingleCRT objects. Although SingleCRT and DoubleCRT objects can interact in principle, translation back and forth are expensive since they involve FFT/iFFT. Hence support for interaction between them is limited to explicit conversions.


The documentation for this class was generated from the following files: