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

One entry in a ciphertext vector. More...

#include <Ctxt.h>

Inheritance diagram for CtxtPart:
DoubleCRT

Public Member Functions

bool operator== (const CtxtPart &other) const
 
bool operator!= (const CtxtPart &other) const
 
 CtxtPart (const FHEcontext &_context)
 
 CtxtPart (const FHEcontext &_context, const IndexSet &s)
 
 CtxtPart (const FHEcontext &_context, const IndexSet &s, const SKHandle &otherHandle)
 
 CtxtPart (const DoubleCRT &other)
 
 CtxtPart (const DoubleCRT &other, const SKHandle &otherHandle)
 
- Public Member Functions inherited from DoubleCRT
 DoubleCRT (const ZZX &poly, const FHEcontext &_context, const IndexSet &indexSet)
 Initializing AltCRT from a ZZX polynomial. More...
 
 DoubleCRT (const ZZX &poly, const FHEcontext &_context)
 
 DoubleCRT (const ZZX &poly)
 Context is not specified, use the "active context".
 
 DoubleCRT (const FHEcontext &_context)
 
 DoubleCRT (const FHEcontext &_context, const IndexSet &indexSet)
 Also specify the IndexSet explicitly.
 
DoubleCRToperator= (const DoubleCRT &other)
 
DoubleCRToperator= (const SingleCRT &other)
 
DoubleCRToperator= (const ZZX &poly)
 
DoubleCRToperator= (const ZZ &num)
 
DoubleCRToperator= (const long num)
 
void toPoly (ZZX &p, const IndexSet &s, bool positive=false) const
 Recovering the polynomial in coefficient representation. This yields an integer polynomial with coefficients in [-P/2,P/2], unless the positive flag is set to true, in which case we get coefficients in [0,P-1] (P is the product of all moduli used). Using the optional IndexSet param we compute the polynomial reduced modulo the product of only the ptimes in that set.
 
void toPoly (ZZX &p, bool positive=false) const
 
bool operator== (const DoubleCRT &other) const
 
bool operator!= (const DoubleCRT &other) const
 
DoubleCRTSetZero ()
 
DoubleCRTSetOne ()
 
void breakIntoDigits (vector< DoubleCRT > &dgts, long n) const
 Break into n digits,according to the primeSets in context.digits. See Section 3.1.6 of the design document (re-linearization)
 
void addPrimes (const IndexSet &s1)
 Expand the index set by s1. It is assumed that s1 is disjoint from the current index set.
 
double addPrimesAndScale (const IndexSet &s1)
 Expand index set by s1, and multiply by Prod_{q in s1}. s1 is disjoint from the current index set, returns log(product).
 
void removePrimes (const IndexSet &s1)
 Remove s1 from the index set.
 
const FHEcontextgetContext () const
 
const IndexMap< vec_long > & getMap () const
 
const IndexSetgetIndexSet () const
 
void randomize (const ZZ *seed=NULL)
 Fills each row i with random ints mod pi, uses NTL's PRG.
 
void sampleSmall ()
 Coefficients are -1/0/1, Prob[0]=1/2.
 
void sampleHWt (long Hwt)
 Coefficients are -1/0/1 with pre-specified number of nonzeros.
 
void sampleGaussian (double stdev=0.0)
 Coefficients are Gaussians.
 
void toSingleCRT (SingleCRT &scrt, const IndexSet &s) const
 Makes a corresponding SingleCRT object.
 
void toSingleCRT (SingleCRT &scrt) const
 
void scaleDownToSet (const IndexSet &s, long ptxtSpace)
 
DoubleCRTNegate (const DoubleCRT &other)
 
DoubleCRTNegate ()
 
DoubleCRToperator+= (const DoubleCRT &other)
 
DoubleCRToperator+= (const ZZX &poly)
 
DoubleCRToperator+= (const ZZ &num)
 
DoubleCRToperator+= (long num)
 
DoubleCRToperator-= (const DoubleCRT &other)
 
DoubleCRToperator-= (const ZZX &poly)
 
DoubleCRToperator-= (const ZZ &num)
 
DoubleCRToperator-= (long num)
 
DoubleCRToperator++ ()
 
DoubleCRToperator-- ()
 
void operator++ (int)
 
void operator-- (int)
 
DoubleCRToperator*= (const DoubleCRT &other)
 
DoubleCRToperator*= (const ZZX &poly)
 
DoubleCRToperator*= (const ZZ &num)
 
DoubleCRToperator*= (long num)
 
void Add (const DoubleCRT &other, bool matchIndexSets=true)
 
void Sub (const DoubleCRT &other, bool matchIndexSets=true)
 
void Mul (const DoubleCRT &other, bool matchIndexSets=true)
 
DoubleCRToperator/= (const ZZ &num)
 
DoubleCRToperator/= (long num)
 
void Exp (long k)
 Small-exponent polynomial exponentiation.
 
void automorph (long k)
 
DoubleCRToperator>>= (long k)
 

Public Attributes

SKHandle skHandle
 The handle is a public data member.
 

Additional Inherited Members

- Static Public Member Functions inherited from DoubleCRT
static bool setDryRun (bool toWhat=true)
 Used for testing/debugging The dry-run option disables most operations, to save time. This lets us quickly go over the evaluation of a circuit and estimate the resulting noise magnitude, without having to actually compute anything.
 

Detailed Description

One entry in a ciphertext vector.

A cipehrtext part consists of a polynomial (element of the ring R_Q) and a handle to the corresponding secret-key polynomial.


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