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

The structure of Z[X]/(Phi_m(X), p) More...

#include <PAlgebra.h>

Public Member Functions

 PAlgebraMod (const PAlgebra &zMStar, long r)
 
template<class type >
const PAlgebraModDerived< type > & getDerived (type) const
 
bool operator== (const PAlgebraMod &other) const
 
bool operator!= (const PAlgebraMod &other) const
 
PA_tag getTag () const
 Returns the type tag: PA_GF2_tag or PA_zz_p_tag.
 
const PAlgebragetZMStar () const
 Returns reference to underlying PAlgebra object.
 
const vector< ZZX > & getFactorsOverZZ () const
 Returns reference to the factorization of Phi_m(X) mod p^r, but as ZZX's.
 
long getR () const
 The value r.
 
long getPPowR () const
 The value p^r.
 
void restoreContext () const
 Restores the NTL context for p^r.
 
void genMaskTable () const
 Generates the "mask table" that is used to support rotations. More...
 

Detailed Description

The structure of Z[X]/(Phi_m(X), p)

An object of type PAlgebraMod stores information about a PAlgebra object zMStar, and an integer r. It also provides support for encoding and decoding plaintext slots.

the PAlgebra object zMStar defines (Z/mZ)^* /(0), and the PAlgebraMod object stores various tables related to the polynomial ring Z/(p^r)[X]. To do this most efficiently, if p == 2 and r == 1, then these polynomials are represented as GF2X's, and otherwise as zz_pX's. Thus, the types of these objects are not determined until run time. As such, we need to use a class heirarchy, as follows.

Member Function Documentation

void PAlgebraMod::genMaskTable ( ) const
inline

Generates the "mask table" that is used to support rotations.

maskTable[i][j] is a polynomial representation of a mask that is 1 in all slots whose i'th coordinate is at least j, and 0 elsewhere. We have:

  maskTable.size() == zMStar.numOfGens()     // # of generators
  for i = 0..maskTable.size()-1:
    maskTable[i].size() == zMStar.OrderOf(i) // order of generator i
template<class type >
const PAlgebraModDerived<type>& PAlgebraMod::getDerived ( type  ) const
inline

Downcast operator example: const PAlgebraModDerived<PA_GF2>& rep = alMod.getDerived(PA_GF2());


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