EncryptedArray.h
An object that mimics the functionality of the Ctxt object, and acts as a convenient entry point for ...
Definition: Ptxt.h:280
void rotate(const EncryptedArray &ea, PlaintextArray &pa, long k)
Definition: EncryptedArray.cpp:760
long OrderOf(long i) const
The order of i'th generator (if any)
Definition: PAlgebra.h:217
void mul(const EncryptedArray &ea, PlaintextArray &pa, const PlaintextArray &other)
Definition: EncryptedArray.cpp:1061
void rotate1D(Ctxt &ctxt, long i, long k, bool dc=false) const
Definition: EncryptedArray.h:1307
virtual void decode(std::vector< long > &array, const NTL::ZZX &ptxt) const =0
long lsize(const std::vector< T > &v)
Size of STL vector as a long (rather than unsigned long)
Definition: NumbTh.h:702
void encode(UNUSED NTL::ZZX &ptxt, UNUSED const std::vector< long > &array) const override
Unimplemented encode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:759
const PAlgebra & getPAlgebra() const override
Definition: EncryptedArray.h:730
long addCoord(long i, long k, long offset) const
Definition: EncryptedArray.h:1362
long encodeScalingFactor(long precision=-1, double roundErr=-1.0) const
Definition: EncryptedArray.h:1040
virtual void encode(NTL::ZZX &ptxt, const std::vector< NTL::ZZX > &array) const =0
void encrypt(Ctxt &ctxt, const PubKey &key, const PTXT &ptxt) const
Definition: EncryptedArray.h:200
void random(std::vector< T > &array) const
Definition: EncryptedArray.h:1331
virtual void restoreContext() const
Definition: EncryptedArray.h:263
double encode(NTL::ZZX &ptxt, const PTXT &pt, double useThisSize=-1, long precision=-1) const
Definition: EncryptedArray.h:964
virtual void encode(zzX &ptxt, const PlaintextArray &array) const =0
long getNSlots() const
The number of plaintext slots = phi(m)/ord(p)
Definition: PAlgebra.h:186
double encode(zzX &ptxt, const std::vector< double > &array, double useThisSize, long precision=-1) const
Definition: EncryptedArray.h:917
void random(std::vector< RX > &array) const
Definition: EncryptedArray.h:578
void buildLinPolyCoeffs(UNUSED std::vector< NTL::ZZX > &C, UNUSED const std::vector< NTL::ZZX > &L) const override
Unimplemented buildLinPolyCoeffs function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:903
void decrypt(UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< long > &ptxt) const override
Unimplemented decrypt function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:863
virtual void encode(NTL::ZZX &ptxt, const std::vector< NTL::ZZX > &array) const override
Definition: EncryptedArray.h:485
const std::vector< SlotType > & getSlotRepr() const
Get the data held in the slots as a std::vector<SlotType>.
Definition: Ptxt.cpp:230
std::vector< typename type::RX > & getData()
Definition: EncryptedArray.h:1434
virtual const PAlgebra & getZMStar() const override
Returns reference to underlying PAlgebra object.
Definition: PAlgebra.h:611
double noiseBoundForUniform(double magBound, long degBound) const
Definition: Context.h:188
long genToPow(long i, long j) const
the i'th generator to the power j mod m
Definition: PAlgebra.cpp:606
virtual long getP2R() const =0
void encrypt(Ctxt &ctxt, const PubKey &key, const PTXT &ptxt) const
Definition: EncryptedArray.h:1011
EncryptedArrayBase * clone() const override
Definition: EncryptedArray.h:722
void random(std::vector< long > &array) const override
Definition: EncryptedArray.h:1092
long addCoord(long i, long k, long offset) const
adds offset to index k in the i'th dimension
Definition: PAlgebra.h:272
EncryptedArrayDerived & operator=(const EncryptedArrayDerived &other)
Definition: EncryptedArray.h:356
virtual void encode(NTL::ZZX &ptxt, const PlaintextArray &array) const =0
Implementing polynomials (elements in the ring R_Q) in double-CRT form.
Definition: DoubleCRT.h:76
virtual void rotate1D(Ctxt &ctxt, long i, long k, bool dc=false) const override
right-rotate k positions along the i'th dimension
Definition: EncryptedArray.cpp:64
void plaintextAutomorph(RX &bb, const RX &a, long k, long m, const RXModulus &PhimX)
Definition: EncryptedArray.h:1184
void encode(UNUSED NTL::ZZX &ptxt, UNUSED const PlaintextArray &array) const override
Unimplemented encode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:803
void extractImPart(Ptxt< Scheme > &p) const
Extract the imaginary part of a CKKS plaintext.
Definition: EncryptedArray.h:1147
virtual PA_tag getTag() const =0
void random(UNUSED std::vector< NTL::ZZX > &array) const override
Unimplemented random function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:850
void PolyRed(NTL::ZZX &out, const NTL::ZZX &in, long q, bool abs=false)
Reduce all the coefficients of a polynomial modulo q.
Definition: NumbTh.cpp:751
bool nativeDimension(long i) const
Is rotations in given dimension a "native" operation?
Definition: EncryptedArray.h:278
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)
Definition: EncryptedArray.h:295
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const override
Definition: EncryptedArray.h:552
virtual long getDegree() const override
Definition: EncryptedArray.h:420
virtual void restoreContext() const override
Restores the NTL context for p^r.
Definition: PAlgebra.h:626
virtual void shift1D(Ctxt &ctxt, long i, long k) const =0
Right shift k positions along the i'th dimension with zero fill.
void applyPerm(const EncryptedArray &ea, PlaintextArray &pa, const NTL::Vec< long > &pi)
Definition: EncryptedArray.cpp:1183
virtual void decode(std::vector< long > &array, const NTL::ZZX &ptxt) const override
Definition: EncryptedArray.h:502
void sub(const EncryptedArray &ea, PlaintextArray &pa, const PlaintextArray &other)
Definition: EncryptedArray.cpp:1033
void restoreContextForG() const
Definition: EncryptedArray.h:1355
long addCoord(long i, long k, long offset) const
adds offset to index k in the i'th dimension
Definition: EncryptedArray.h:287
void assertEq(const T &a, const T &b, const std::string &message)
Definition: assertions.h:108
void decode(ARRAY &array, const PTXT &ptxt) const
Definition: EncryptedArray.h:1325
const EncryptedArrayDerived< type > & getDerived(type) const
downcast operator example: const EncryptedArrayDerived<PA_GF2>& rep = ea.getDerived(PA_GF2());
Definition: EncryptedArray.h:1265
A simple wrapper for a smart pointer to an EncryptedArrayBase. This is the interface that higher-leve...
Definition: EncryptedArray.h:1233
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....
virtual void rotate1D(Ctxt &ctxt, long i, long k, bool dc=false) const =0
right-rotate k positions along the i'th dimension
void rem(NTL::zz_pX &r, const NTL::zz_pX &a, const zz_pXModulus1 &ff)
Definition: NumbTh.cpp:1875
virtual const PAlgebra & getPAlgebra() const override
Definition: EncryptedArray.h:416
void shift(const EncryptedArray &ea, PlaintextArray &pa, long k)
Definition: EncryptedArray.cpp:787
void applyLinPolyLL(Ctxt &ctxt, const std::vector< P > &encodedC, long d)
Definition: EncryptedArray.cpp:708
const std::vector< typename type::RX > & getData() const
Definition: EncryptedArray.h:1440
void decode(UNUSED std::vector< NTL::ZZX > &array, UNUSED const NTL::ZZX &ptxt) const override
Unimplemented decode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:827
EncryptedArrayDerived(const Context &_context, const RX &_G, const PAlgebraMod &_tab)
Definition: EncryptedArray.cpp:54
long nativeDimension(long i) const
Definition: EncryptedArray.h:1360
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const =0
long dimension() const
Number of dimensions of hypercube.
Definition: EncryptedArray.h:272
virtual const PAlgebra & getPAlgebra() const =0
EncryptedArrayDerived(const EncryptedArrayDerived &other)
Definition: EncryptedArray.h:341
void decrypt(UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< cx_double > &ptxt) const override
Unimplemented decrypt function for CKKS. It will always throw helib::LogicError.
Definition: EncryptedArray.h:465
virtual void rotate(Ctxt &ctxt, long k) const override
Right rotation as a linear array. E.g., rotating ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(n 1 2 ....
Definition: EncryptedArray.cpp:178
void decode(const EncryptedArray &ea, std::vector< long > &array, const PlaintextArray &pa)
Definition: EncryptedArray.cpp:899
virtual void encode(zzX &ptxt, const std::vector< zzX > &array) const override
Definition: EncryptedArray.h:491
void totalSums(const EncryptedArray &ea, Ctxt &ctxt)
Definition: EncryptedArray.cpp:561
void encode(zzX &ptxt, const std::vector< NTL::ZZX > &array) const
Definition: EncryptedArray.h:159
virtual long getDegree() const =0
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 bas...
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< NTL::ZZX > &ptxt) const =0
virtual class for data-movement operations on arrays of slots
Definition: EncryptedArray.h:113
virtual void shift1D(Ctxt &ctxt, long i, long k) const override
Right shift k positions along the i'th dimension with zero fill.
Definition: EncryptedArray.cpp:127
virtual void encode(NTL::ZZX &ptxt, const std::vector< long > &array) const =0
A different derived class to be used for the approximate-numbers scheme.
Definition: EncryptedArray.h:667
void shift1D(Ctxt &ctxt, long i, long k) const
Definition: EncryptedArray.h:1311
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< double > &ptxt) const =0
long coordinate(long i, long k) const
returns coordinate of index k along the i'th dimension
Definition: EncryptedArray.h:281
long sizeOfDimension(long i) const
Definition: EncryptedArray.h:1359
virtual EncryptedArrayBase * clone() const =0
long size() const
Total size (# of slots) of hypercube.
Definition: EncryptedArray.h:269
Derived concrete implementation of EncryptedArrayBase.
Definition: EncryptedArray.h:315
virtual void random(std::vector< long > &array) const =0
virtual void encode(zzX &ptxt, const std::vector< long > &array) const override
Definition: EncryptedArray.h:480
void encodeUnitSelector(zzX &ptxt, long i) const override
Encodes a std::vector with 1 at position i and 0 everywhere else.
Definition: EncryptedArray.h:1019
virtual void restoreContext() const override
Definition: EncryptedArray.h:409
void decrypt(UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< NTL::ZZX > &ptxt) const override
Unimplemented decrypt function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:876
static void convert(std::vector< cx_double > &out, const std::vector< long > &in)
Definition: EncryptedArray.h:709
virtual void random(std::vector< NTL::ZZX > &array) const override
Definition: EncryptedArray.h:525
void decrypt(UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED std::vector< double > &ptxt) const override
Unimplemented decrypt function for CKKS. It will always throw helib::LogicError.
Definition: EncryptedArray.h:451
virtual void encodeUnitSelector(zzX &ptxt, long i) const =0
Encodes a std::vector with 1 at position i and 0 everywhere else.
void decode(UNUSED std::vector< long > &array, UNUSED const NTL::ZZX &ptxt) const override
Unimplemented decode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:816
const PAlgebra & getZMStar() const override
Returns reference to underlying PAlgebra object.
Definition: PAlgebra.h:774
void encryptOneNum(Ctxt &ctxt, const PubKey &key, double num, double useThisSize=-1, long precision=-1) const
Definition: EncryptedArray.h:975
const Context & getContext() const
Definition: EncryptedArray.h:1301
void encode(UNUSED NTL::ZZX &ptxt, UNUSED const std::vector< NTL::ZZX > &array) const override
Unimplemented encode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:792
virtual void random(std::vector< long > &array) const override
Definition: EncryptedArray.h:519
const PAlgebraMod & getAlMod() const
Definition: EncryptedArray.h:1302
const Context & getContext() const override
Definition: EncryptedArray.h:729
bool equals(const EncryptedArray &ea, const PlaintextArray &pa, const PlaintextArray &other)
Definition: EncryptedArray.cpp:957
void encode(PTXT &ptxt, const ARRAY &array) const
Definition: EncryptedArray.h:1314
virtual void encode(zzX &ptxt, const std::vector< zzX > &array) const =0
virtual void buildLinPolyCoeffs(std::vector< NTL::ZZX > &C, const std::vector< NTL::ZZX > &L) const override
Linearized polynomials. L describes a linear map M by describing its action on the standard power bas...
Definition: EncryptedArray.cpp:599
void random(const EncryptedArray &ea, PlaintextArray &pa)
Definition: EncryptedArray.cpp:875
void buildLinPolyCoeffs(std::vector< NTL::ZZX > &C, const std::vector< NTL::ZZX > &L) const
Definition: EncryptedArray.h:1348
long sizeOfDimension(long i) const
Size of given dimension.
Definition: EncryptedArray.h:275
void rotate1D(std::vector< U > &out, const std::vector< U > &in, long i, long offset) const
Definition: EncryptedArray.h:434
void power(const EncryptedArray &ea, PlaintextArray &pa, long e)
Definition: EncryptedArray.cpp:1143
virtual void encode(NTL::ZZX &ptxt, const std::vector< long > &array) const override
Definition: EncryptedArray.h:474
Definition: EncryptedArray.h:1401
virtual ~EncryptedArrayBase()
Definition: EncryptedArray.h:115
long getPPowR() const override
The value p^r.
Definition: PAlgebra.h:776
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< NTL::ZZX > &ptxt) const override
Definition: EncryptedArray.h:541
Definition: EncryptedArray.h:1383
bool SameOrd(long i) const
Is ord(i'th generator) the same as its order in (Z/mZ)^*?
Definition: PAlgebra.h:223
virtual void shift(Ctxt &ctxt, long k) const override
Non-cyclic right shift with zero fill E.g., shifting ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(0 1 2....
Definition: EncryptedArray.cpp:286
void encode(UNUSED zzX &ptxt, UNUSED const std::vector< zzX > &array) const override
Unimplemented encode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:770
virtual void encodeUnitSelector(zzX &ptxt, long i) const override
Encodes a std::vector with 1 at position i and 0 everywhere else.
Definition: EncryptedArray.cpp:415
static double roundedSize(double x)
Definition: EncryptedArray.h:673
void setData(const std::vector< SlotType > &data)
Set the data.
Definition: Ptxt.cpp:151
void encode(UNUSED zzX &ptxt, UNUSED const std::vector< long > &array) const override
Unimplemented encode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:748
void decode(std::vector< double > &array, const NTL::ZZX &ptxt, double scaling) const
Definition: EncryptedArray.h:1076
void rotate(Ctxt &ctxt, long k) const override
Right rotation as a linear array. E.g., rotating ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(n 1 2 ....
Definition: EaCx.cpp:123
void dispatch(Args &&... args) const
Definition: EncryptedArray.h:386
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)
Definition: EncryptedArray.h:1370
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< long > &ptxt) const override
Definition: EncryptedArray.h:530
void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< RX > &ptxt) const
Definition: EncryptedArray.h:585
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 ....
void CKKSencrypt(Ctxt &ciphertxt, const NTL::ZZX &plaintxt, double ptxtSize=1.0, double scaling=0.0) const
Definition: keys.cpp:498
virtual void restoreContextForG() const
Definition: EncryptedArray.h:264
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< cx_double > &ptxt) const =0
long Encrypt(Ctxt &ciphertxt, const NTL::ZZX &plaintxt, long ptxtSpace, bool highNoise) const
Definition: keys.cpp:354
Definition: apiAttributes.h:21
void incrementalZeroTest(Ctxt *res[], const EncryptedArray &ea, const Ctxt &ctxt, long n)
Definition: eqtesting.cpp:95
Definition: EncryptedArray.h:1391
virtual ~PlaintextArrayBase()
Definition: EncryptedArray.h:1385
void runningSums(const EncryptedArray &ea, Ctxt &ctxt)
A ctxt that encrypts is replaced by an encryption of , where .
Definition: EncryptedArray.cpp:548
void random(std::vector< double > &array, double rad=1.0) const
Definition: EncryptedArray.h:1086
void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< double > &ptxt) const override
Definition: EncryptedArray.h:1102
virtual void decode(PlaintextArray &array, const NTL::ZZX &ptxt) const =0
virtual void encode(zzX &ptxt, const std::vector< long > &array) const =0
PlaintextArray & operator=(const PlaintextArray &other)
Definition: EncryptedArray.h:1427
long coordinate(long i, long k) const
Definition: EncryptedArray.h:1361
void encode(UNUSED zzX &ptxt, UNUSED const PlaintextArray &array) const override
Unimplemented encode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:781
const NTL::Mat< R > & getNormalBasisMatrixInverse() const
Definition: EncryptedArray.h:400
void decrypt1Slot(NTL::ZZX &slot, const Ctxt &ctxt, const SecKey &sKey, long i) const
Definition: EncryptedArray.h:238
std::ostream & operator<<(std::ostream &s, const SKHandle &handle)
Definition: Ctxt.h:190
void decode(std::vector< double > &array, const zzX &ptxt, double scaling) const
Definition: EncryptedArray.h:1069
void applyLinPolyMany(const EncryptedArray &ea, Ctxt &ctxt, const std::vector< std::vector< NTL::ZZX >> &Cvec)
Definition: EncryptedArray.cpp:679
virtual void print(std::ostream &s) const =0
void decrypt(const Ctxt &ctxt, const SecKey &sKey, Ptxt< Scheme > &ptxt) const
Decrypt ciphertext to a plaintext relative to a specific scheme.
Definition: EncryptedArray.h:1121
static void convert(std::vector< cx_double > &out, const std::vector< double > &in)
Definition: EncryptedArray.h:695
void encodeUnitSelector(zzX &ptxt, long i) const
Definition: EncryptedArray.h:1319
void shift(Ctxt &ctxt, long k) const override
Non-cyclic right shift with zero fill E.g., shifting ctxt=Enc(1 2 3 ... n) by k=1 gives Enc(0 1 2....
Definition: EaCx.cpp:127
virtual void random(std::vector< NTL::ZZX > &array) const =0
void decode(std::vector< cx_double > &array, const NTL::ZZX &ptxt, double scaling) const
Definition: EncryptedArray.h:1060
void applyLinPoly1(const EncryptedArray &ea, Ctxt &ctxt, const std::vector< NTL::ZZX > &C)
Definition: EncryptedArray.cpp:655
void extractRealPart(Ptxt< Scheme > &p) const
Extract the real part of a CKKS plaintext.
Definition: EncryptedArray.h:1136
virtual const Context & getContext() const override
Definition: EncryptedArray.h:415
long decode1Slot(const NTL::ZZX &ptxt, long i) const
Definition: EncryptedArray.h:180
long coordinate(long i, long k) const
Returns coordinate of index k along the i'th dimension.
Definition: PAlgebra.h:257
void decrypt(const Ctxt &ctxt, const SecKey &sKey, T &ptxt) const
Definition: EncryptedArray.h:1343
EncryptedArray(const Context &context, const NTL::ZZX &G=NTL::ZZX(1, 1))
constructor: G defaults to the monomial X, PAlgebraMod from context
Definition: EncryptedArray.h:1240
double encodei(zzX &ptxt, long precision=-1) const
Definition: EaCx.cpp:173
void encode(const EncryptedArray &ea, PlaintextArray &pa, const std::vector< long > &array)
Definition: EncryptedArray.cpp:824
EncryptedArray & operator=(const EncryptedArray &other)
Definition: EncryptedArray.h:1250
double encode(zzX &ptxt, const std::vector< long > &array, double useThisSize, long precision=-1) const
Definition: EncryptedArray.h:926
EncryptedArrayCx(const Context &_context)
Definition: EncryptedArray.h:683
virtual EncryptedArrayBase * clone() const override
Definition: EncryptedArray.h:377
void rotate1D(Ctxt &ctxt, long i, long k, bool dc=false) const override
right-rotate k positions along the i'th dimension
Definition: EaCx.cpp:91
PlaintextArray(const PlaintextArray &other)
Definition: EncryptedArray.h:1426
virtual void decode(std::vector< NTL::ZZX > &array, const NTL::ZZX &ptxt) const override
Definition: EncryptedArray.h:508
void negate(const EncryptedArray &ea, PlaintextArray &pa)
Definition: EncryptedArray.cpp:1085
void decode(UNUSED PlaintextArray &array, UNUSED const NTL::ZZX &ptxt) const override
Unimplemented decode function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:838
virtual void decode(std::vector< NTL::ZZX > &array, const NTL::ZZX &ptxt) const =0
long numOfGens() const
The prime-power factorization of m.
Definition: PAlgebra.h:202
void frobeniusAutomorph(const EncryptedArray &ea, PlaintextArray &pa, long j)
Definition: EncryptedArray.cpp:1131
void add(const EncryptedArray &ea, PlaintextArray &pa, const PlaintextArray &other)
Definition: EncryptedArray.cpp:1005
void encrypt(Ctxt &ctxt, const PubKey &pKey, const T &ptxt) const
Definition: EncryptedArray.h:1337
void decode1Slot(NTL::ZZX &slot, const NTL::ZZX &ptxt, long i) const
Definition: EncryptedArray.h:186
static void convert(std::vector< double > &out, const std::vector< cx_double > &in)
Definition: EncryptedArray.h:702
virtual void decrypt(const Ctxt &ctxt, const SecKey &sKey, std::vector< long > &ptxt) const =0
long decrypt1Slot(const Ctxt &ctxt, const SecKey &sKey, long i) const
Definition: EncryptedArray.h:232
EncryptedArrayCx(const Context &_context, const PAlgebraModCx &_alMod)
Definition: EncryptedArray.h:688
void decrypt(UNUSED const Ctxt &ctxt, UNUSED const SecKey &sKey, UNUSED PlaintextArray &ptxt) const override
Unimplemented decrypt function for BGV. It will always throw helib::LogicError.
Definition: EncryptedArray.h:889
Definition: PAlgebra.h:758
virtual const Context & getContext() const =0
virtual void restoreContextForG() const override
Definition: EncryptedArray.h:410
void dispatch(Args &&... args) const
Definition: EncryptedArray.h:1281
static void convert(std::vector< long > &out, const std::vector< cx_double > &in)
Definition: EncryptedArray.h:715
void initNormalBasisMatrix() const
Definition: EncryptedArray.cpp:482
double encode(zzX &out, const Ptxt< Scheme > &ptxt, double useThisSize, long precision=-1) const
Encode a Ptxt object into a zzX.
Definition: EncryptedArray.h:946
virtual void print(std::ostream &s) const
Definition: EncryptedArray.h:1397
void shift1D(Ctxt &ctxt, long i, long k) const override
Right shift k positions along the i'th dimension with zero fill.
Definition: EaCx.cpp:115
const PAlgebraModDerived< type > & getTab() const
Definition: EncryptedArray.h:421
EncryptedArray(const Context &context, const PAlgebraMod &_alMod)
constructor: G defaults to F0, PAlgebraMod explicitly given
Definition: EncryptedArray.h:1244
virtual PA_tag getTag() const override
Definition: EncryptedArray.h:382
const PAlgebra & getPAlgebra() const
Definition: EncryptedArray.h:1303
void encrypt(Ctxt &ctxt, const PubKey &key, const PTXT &ptxt, double useThisSize, long precision=-1) const
Definition: EncryptedArray.h:994
EncryptedArrayBase * buildEncryptedArray(const Context &context, const PAlgebraMod &alMod, const NTL::ZZX &G=NTL::ZZX::zero())
A "factory" for building EncryptedArrays.
Definition: EncryptedArray.cpp:23
PlaintextArray(const EncryptedArray &ea)
Definition: EncryptedArray.h:1421
double encodeRoundingError() const
Definition: EncryptedArray.h:1027
const NTL::Mat< R > & getNormalBasisMatrix() const
Definition: EncryptedArray.h:393