|
| virtual | ~EncryptedArrayBase () |
| |
| virtual EncryptedArrayBase * | clone () const =0 |
| |
| virtual PA_tag | getTag () const =0 |
| |
| virtual const Context & | getContext () const =0 |
| |
| virtual const PAlgebra & | getPAlgebra () const =0 |
| |
| virtual long | getDegree () const =0 |
| |
| virtual long | getP2R () const =0 |
| |
| virtual void | rotate (Ctxt &ctxt, long k) const =0 |
| | Right rotation as a linear array. E.g., rotating ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(n 1 2 ... n-1) More...
|
| |
| virtual void | shift (Ctxt &ctxt, long k) const =0 |
| | Non-cyclic right shift with zero fill E.g., shifting ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(0 1 2... n-1) More...
|
| |
| virtual void | rotate1D (Ctxt &ctxt, long i, long k, bool dc=false) const =0 |
| | right-rotate k positions along the i'th dimension More...
|
| |
| virtual void | shift1D (Ctxt &ctxt, long i, long k) const =0 |
| | Right shift k positions along the i'th dimension with zero fill. More...
|
| |
| virtual void | buildLinPolyCoeffs (std::vector< NTL::ZZX > &C, const std::vector< NTL::ZZX > &L) const =0 |
| | Linearized polynomials. L describes a linear map M by describing its action on the standard power basis: M(x^j mod G) = (L[j] mod G), for j = 0..d-1. The result is a coefficient std::vector C for the linearized polynomial representing M: a polynomial h in Z/(p^r)[X] of degree < d is sent to. More...
|
| |
| virtual void | restoreContext () const |
| |
| virtual void | restoreContextForG () const |
| |
| long | size () const |
| | Total size (# of slots) of hypercube. More...
|
| |
| long | dimension () const |
| | Number of dimensions of hypercube. More...
|
| |
| long | sizeOfDimension (long i) const |
| | Size of given dimension. More...
|
| |
| bool | nativeDimension (long i) const |
| | Is rotations in given dimension a "native" operation? More...
|
| |
| long | coordinate (long i, long k) const |
| | returns coordinate of index k along the i'th dimension More...
|
| |
| long | addCoord (long i, long k, long offset) const |
| | adds offset to index k in the i'th dimension More...
|
| |
| template<typename U > |
| void | rotate1D (std::vector< U > &out, const std::vector< U > &in, long i, long offset) const |
| | rotate an array by offset in the i'th dimension (output should not alias input) More...
|
| |
|
| virtual void | encode (zzX &ptxt, const std::vector< long > &array) const =0 |
| |
| virtual void | encode (NTL::ZZX &ptxt, const std::vector< long > &array) const =0 |
| |
| virtual void | encode (zzX &ptxt, const std::vector< zzX > &array) const =0 |
| |
| virtual void | encode (zzX &ptxt, const PlaintextArray &array) const =0 |
| |
| virtual void | encode (NTL::ZZX &ptxt, const std::vector< NTL::ZZX > &array) const =0 |
| |
| virtual void | encode (NTL::ZZX &ptxt, const PlaintextArray &array) const =0 |
| |
| void | encode (zzX &ptxt, const std::vector< NTL::ZZX > &array) const |
| |
| virtual void | decode (std::vector< long > &array, const NTL::ZZX &ptxt) const =0 |
| |
| virtual void | decode (std::vector< NTL::ZZX > &array, const NTL::ZZX &ptxt) const =0 |
| |
| virtual void | decode (PlaintextArray &array, const NTL::ZZX &ptxt) const =0 |
| |
| virtual void | random (std::vector< long > &array) const =0 |
| |
| virtual void | random (std::vector< NTL::ZZX > &array) const =0 |
| |
| long | decode1Slot (const NTL::ZZX &ptxt, long i) const |
| |
| void | decode1Slot (NTL::ZZX &slot, const NTL::ZZX &ptxt, long i) const |
| |
| virtual void | encodeUnitSelector (zzX &ptxt, long i) const =0 |
| | Encodes a std::vector with 1 at position i and 0 everywhere else. More...
|
| |
|
| template<typename PTXT > |
| void | encrypt (Ctxt &ctxt, const PubKey &key, const PTXT &ptxt) const |
| |
| virtual void | decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< long > &ptxt) const =0 |
| |
| virtual void | decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< NTL::ZZX > &ptxt) const =0 |
| |
| virtual void | decrypt (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const =0 |
| |
| virtual void | decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< double > &ptxt) const =0 |
| |
| virtual void | decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< cx_double > &ptxt) const =0 |
| |
| long | decrypt1Slot (const Ctxt &ctxt, const SecKey &sKey, long i) const |
| |
| void | decrypt1Slot (NTL::ZZX &slot, const Ctxt &ctxt, const SecKey &sKey, long i) const |
| |
virtual class for data-movement operations on arrays of slots
An object ea of type EncryptedArray stores information about an Context context, and a monic polynomial G. If context defines parameters m, p, and r, then ea is a helper abject that supports encoding/decoding and encryption/decryption of std::vectors of plaintext slots over the ring (Z/(p^r)[X])/(G).
The polynomial G should be irreducible over Z/(p^r) (this is not checked). The degree of G should divide the multiplicative order of p modulo m (this is checked). Currently, the following restriction is imposed:
either r == 1 or deg(G) == 1 or G == factors[0].
ea stores objects in the polynomial ring Z/(p^r)[X].
Just as for the class PAlgebraMod, 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 hierarchy, which mirrors that of PAlgebraMod, as follows.
EncryptedArrayBase is a virtual class
EncryptedArrayDerived<type> is a derived template class, where type is either PA_GF2 or PA_zz_p.
The class EncryptedArray is a simple wrapper around a smart pointer to an EncryptedArrayBase object: copying an EncryptedArray object results is a "deep copy" of the underlying object of the derived class.