|
| double | encodei (zzX &ptxt, long precision=-1) const |
| |
| | EncryptedArrayDerived (const Context &_context) |
| |
| | EncryptedArrayDerived (const Context &_context, const PAlgebraModCx &_alMod) |
| |
| EncryptedArrayBase * | clone () const override |
| |
| const zzX & | getiEncoded () const |
| |
| PA_tag | getTag () const override |
| |
| const Context & | getContext () const override |
| |
| const PAlgebra & | getPAlgebra () const override |
| |
| long | getDegree () const override |
| |
| 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 ... n-1) More...
|
| |
| 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... n-1) More...
|
| |
| void | rotate1D (Ctxt &ctxt, long i, long k, bool dc=false) const override |
| | right-rotate k positions along the i'th dimension More...
|
| |
| void | shift1D (Ctxt &ctxt, long i, long k) const override |
| | Right shift k positions along the i'th dimension with zero fill. More...
|
| |
| long | getP2R () const override |
| |
| cx_double | getG () const |
| |
| const PAlgebraModCx | getTab () const |
| |
| template<template< typename > class T, typename... Args> |
| void | dispatch (Args &&... args) const |
| |
| void | encode (UNUSED zzX &ptxt, UNUSED const std::vector< long > &array) const override |
| | Unimplemented encode function for BGV. It will always throw helib::LogicError. More...
|
| |
| 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. More...
|
| |
| void | encode (UNUSED zzX &ptxt, UNUSED const std::vector< zzX > &array) const override |
| | Unimplemented encode function for BGV. It will always throw helib::LogicError. More...
|
| |
| void | encode (UNUSED zzX &ptxt, UNUSED const PlaintextArray &array) const override |
| | Unimplemented encode function for BGV. It will always throw helib::LogicError. More...
|
| |
| 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. More...
|
| |
| void | encode (UNUSED NTL::ZZX &ptxt, UNUSED const PlaintextArray &array) const override |
| | Unimplemented encode function for BGV. It will always throw helib::LogicError. More...
|
| |
| void | encode (UNUSED zzX &ptxt, UNUSED const std::vector< NTL::ZZX > &array) const override |
| |
| 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. More...
|
| |
| 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. More...
|
| |
| void | decode (UNUSED PlaintextArray &array, UNUSED const NTL::ZZX &ptxt) const override |
| | Unimplemented decode function for BGV. It will always throw helib::LogicError. More...
|
| |
| void | random (UNUSED std::vector< NTL::ZZX > &array) const override |
| | Unimplemented random function for BGV. It will always throw helib::LogicError. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| 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. More...
|
| |
| double | encode (zzX &ptxt, const std::vector< cx_double > &array, double useThisSize, long precision=-1) const |
| |
| double | encode (zzX &ptxt, const std::vector< double > &array, double useThisSize, long precision=-1) const |
| |
| double | encode (zzX &ptxt, const std::vector< long > &array, double useThisSize, long precision=-1) const |
| |
| template<typename Scheme > |
| double | encode (zzX &out, const Ptxt< Scheme > &ptxt, double useThisSize, long precision=-1) const |
| | Encode a Ptxt object into a zzX. More...
|
| |
| double | encode (zzX &ptxt, double aSingleNumber, double useThisSize=-1, long precision=-1) const |
| | Function for encoding a double into a zzX. More...
|
| |
| template<typename PTXT > |
| double | encode (NTL::ZZX &ptxt, const PTXT &pt, double useThisSize=-1, long precision=-1) const |
| | Function for encoding a double into a zzX. More...
|
| |
| virtual void | encode (UNUSED EncodedPtxt &eptxt, UNUSED const std::vector< NTL::ZZX > &array) const override |
| |
| virtual void | encode (UNUSED EncodedPtxt &eptxt, UNUSED const std::vector< long > &array) const override |
| |
| virtual void | encode (EncodedPtxt &eptxt, const std::vector< cx_double > &array, double mag=-1, OptLong prec=OptLong()) const override |
| |
| virtual void | encode (EncodedPtxt &eptxt, const std::vector< double > &array, double mag=-1, OptLong prec=OptLong()) const override |
| |
| virtual void | encode (EncodedPtxt &eptxt, const PlaintextArray &array, double mag=-1, OptLong prec=OptLong()) const override |
| |
| virtual void | encode (EncodedPtxt &eptxt, const std::vector< bool > &array) const override |
| |
| virtual void | encodeUnitSelector (EncodedPtxt &eptxt, long i) const override |
| |
| void | encryptOneNum (Ctxt &ctxt, const PubKey &key, double num, double useThisSize=-1, long precision=-1) const |
| |
| template<typename PTXT > |
| void | encrypt (Ctxt &ctxt, const PubKey &key, const PTXT &ptxt, double useThisSize, long precision=-1) const |
| |
| template<typename PTXT > |
| void | encrypt (Ctxt &ctxt, const PubKey &key, const PTXT &ptxt) const |
| |
| void | encodeUnitSelector (zzX &ptxt, long i) const override |
| | Encodes a std::vector with 1 at position i and 0 everywhere else. More...
|
| |
| double | encodeRoundingError () const |
| |
| long | encodeScalingFactor (long precision=-1, double roundErr=-1.0) const |
| |
| virtual double | defaultErr () const override |
| |
| virtual double | defaultScale (double err, OptLong prec=OptLong()) const override |
| |
| void | decode (std::vector< cx_double > &array, const zzX &ptxt, double scaling) const |
| |
| void | decode (std::vector< cx_double > &array, const NTL::ZZX &ptxt, double scaling) const |
| |
| void | decode (std::vector< double > &array, const zzX &ptxt, double scaling) const |
| |
| void | decode (std::vector< double > &array, const NTL::ZZX &ptxt, double scaling) const |
| |
| void | random (std::vector< cx_double > &array, double rad=1.0) const |
| |
| void | random (std::vector< double > &array, double rad=1.0) const |
| |
| void | random (std::vector< long > &array) const override |
| |
| void | decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< cx_double > &ptxt, OptLong prec=OptLong()) const override |
| |
| void | decrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< double > &ptxt, OptLong prec=OptLong()) const override |
| |
| void | rawDecrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< cx_double > &ptxt) const override |
| |
| void | rawDecrypt (const Ctxt &ctxt, const SecKey &sKey, std::vector< double > &ptxt) const override |
| |
| void | decrypt (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt, OptLong prec=OptLong()) const override |
| |
| void | rawDecrypt (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const override |
| |
| void | decryptComplex (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt, OptLong prec=OptLong()) const override |
| |
| void | rawDecryptComplex (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const override |
| |
| void | decryptReal (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt, OptLong prec=OptLong()) const override |
| |
| void | rawDecryptReal (const Ctxt &ctxt, const SecKey &sKey, PlaintextArray &ptxt) const override |
| |
| template<typename Scheme > |
| void | decrypt (const Ctxt &ctxt, const SecKey &sKey, Ptxt< Scheme > &ptxt, OptLong prec=OptLong()) const |
| | Decrypt ciphertext to a plaintext relative to a specific scheme. More...
|
| |
| void | extractRealPart (Ctxt &c) const |
| |
| template<typename Scheme > |
| void | extractRealPart (Ptxt< Scheme > &p) const |
| | Extract the real part of a CKKS plaintext. More...
|
| |
| template<typename Scheme > |
| void | extractImPart (Ptxt< Scheme > &p) const |
| | Extract the imaginary part of a CKKS plaintext. More...
|
| |
| void | extractImPart (Ctxt &c, DoubleCRT *dcrt=nullptr) const |
| |
|
buildLinPolyCoeffs returns in C two encoded constants such that the linear transformation(s) defined as L(1) = oneImage and L(i)=iImage can be computed as: L(x) = C[0]*x + C[1]*conjugate(x). Once C is computed, we can apply this L to a ciphertext by calling applyLinPolyLL(ctxt, C, 2). Alternatively, we can convert C to a vector of two DoubleCRT objects, then call applyLinPolyLL(ctxt, dcrtVec, 2). This lets us compute the DoubleCRT object just once, then use them many times.
|
| void | buildLinPolyCoeffs (std::vector< zzX > &C, const cx_double &oneImage, const cx_double &iImage, long precision=0) const |
| | First variant: same linear transformation in all the slots. More...
|
| |
| void | buildLinPolyCoeffs (std::vector< zzX > &C, const std::vector< cx_double > &oneImages, const std::vector< cx_double > &iImages, long precision=0) const |
| | Second variant: different linear transformation in each slots. More...
|
| |
| virtual | ~EncryptedArrayBase () |
| |
| 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 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< NTL::ZZX > &array) const =0 |
| |
| virtual void | encode (NTL::ZZX &ptxt, const std::vector< NTL::ZZX > &array) const =0 |
| |
| virtual void | encode (zzX &ptxt, const PlaintextArray &array) const =0 |
| |
| virtual void | encode (NTL::ZZX &ptxt, const PlaintextArray &array) const =0 |
| |
| virtual void | encode (zzX &ptxt, const std::vector< zzX > &array) const =0 |
| |
| virtual void | encode (EncodedPtxt &eptxt, const std::vector< NTL::ZZX > &array) const =0 |
| |
| virtual void | encode (EncodedPtxt &eptxt, const std::vector< long > &array) const =0 |
| |
| virtual double | defaultScale (UNUSED double err, UNUSED OptLong prec=OptLong()) 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< 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 | 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 |
| |
| 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 |
| |