Virtual class for array of slots, not encrypted. More...
#include <EncryptedArray.h>
Public Member Functions | |
virtual PlaintextArrayBase * | clone () const =0 |
virtual const EncryptedArray & | getEA () const =0 |
Get the EA object (which is needed for the encoding/decoding routines) | |
virtual void | rotate (long k)=0 |
Rotation/shift as a linear array. | |
virtual void | shift (long k)=0 |
Non-cyclic shift with zero fill. | |
virtual void | encode (const vector< long > &array)=0 |
Encode/decode arrays into plaintext polynomials. | |
virtual void | encode (const vector< ZZX > &array)=0 |
virtual void | decode (vector< long > &array) const =0 |
virtual void | decode (vector< ZZX > &array) const =0 |
virtual void | encode (long val)=0 |
Encode with the same value replicated in each slot. | |
virtual void | encode (const ZZX &val)=0 |
virtual void | random ()=0 |
Generate a uniformly random element. | |
virtual bool | equals (const PlaintextArrayBase &other) const =0 |
Equality testing. | |
virtual bool | equals (const vector< long > &other) const =0 |
virtual bool | equals (const vector< ZZX > &other) const =0 |
virtual void | add (const PlaintextArrayBase &other)=0 |
virtual void | sub (const PlaintextArrayBase &other)=0 |
virtual void | mul (const PlaintextArrayBase &other)=0 |
virtual void | negate ()=0 |
virtual void | replicate (long i)=0 |
Replicate coordinate i at all coordinates. | |
virtual void | print (ostream &s) const =0 |
Virtual class for array of slots, not encrypted.
An object pa of type PlaintextArray stores information about an EncryptedArray object ea. The object pa stores a vector of plaintext slots, where each slot is an element of the polynomial ring (Z/(p^r)[X])/(G), where p, r, and G are as defined in ea. Support for arithemetic on PlaintextArray objects is provided.
Mirroring PAlgebraMod and EncryptedArray, we have the following class heirarchy:
PlaintextArrayBase is a virtual class
PlaintextArrayDerived<type> is a derived template class, where type is either PA_GF2 or PA_zz_p.
The class PlaintextArray is a simple wrapper around a smart pointer to a PlaintextArray object: copying a PlaintextArray object results is a "deep copy" of the underlying object of the derived class.