Class CKKSPackedEncoding
Defined in File ckkspackedencoding.h
Page Contents
Inheritance Relationships
Base Type
public lbcrypto::PlaintextImpl
(Class PlaintextImpl)
Class Documentation
-
class lbcrypto::CKKSPackedEncoding : public lbcrypto::PlaintextImpl
Inheritence diagram for lbcrypto::CKKSPackedEncoding:
Collaboration diagram for lbcrypto::CKKSPackedEncoding:
Type used for representing IntArray types. Provides conversion functions to encode and decode plaintext data as type vector<uint64_t>. This class uses bit packing techniques to enable efficient computing on vectors of integers. It is NOT supported for DCRTPoly.
Public Functions
-
inline explicit CKKSPackedEncoding(const std::vector<std::complex<double>> &rhs, size_t slots)
Constructs a container with a copy of each of the elements in rhs, in the same order.
- Parameters
rhs – - The input object to copy.
-
inline CKKSPackedEncoding()
Default empty constructor with empty uninitialized data elements.
-
inline CKKSPackedEncoding(const CKKSPackedEncoding &rhs)
-
inline CKKSPackedEncoding(CKKSPackedEncoding &&rhs)
-
virtual bool Encode()
Encode the plaintext into a polynomial
- Returns
true on success
-
inline virtual bool Decode()
Decode the polynomial into the plaintext
- Returns
-
bool Decode(size_t depth, double scalingFactor, ScalingTechnique scalTech, ExecutionMode executionMode)
-
inline virtual const std::vector<std::complex<double>> &GetCKKSPackedValue() const
-
inline virtual const std::vector<double> GetRealPackedValue() const
-
inline virtual PlaintextEncodings GetEncodingType() const
GetEncodingType
- Returns
CKKS_PACKED_ENCODING
-
inline virtual size_t GetLength() const
Get method to return the length of plaintext
- Returns
the length of the plaintext in terms of the number of bits.
-
inline virtual double GetLogError() const
Get method to return log2 of estimated standard deviation of approximation error
-
inline virtual double GetLogPrecision() const
Get method to return log2 of estimated precision
-
inline virtual void SetLength(size_t siz)
SetLength of the plaintext to the given size
- Parameters
siz –
-
inline virtual bool CompareTo(const PlaintextImpl &other) const
Method to compare two plaintext to test for equivalence. This method does not test that the plaintext are of the same type.
- Parameters
other – - the other plaintext to compare to.
- Returns
whether the two plaintext are equivalent.
-
inline virtual void PrintValue(std::ostream &out) const
PrintValue is called by operator<<
- Parameters
out –
Public Static Functions
-
static std::vector<DCRTPoly::Integer> CRTMult(const std::vector<DCRTPoly::Integer> &a, const std::vector<DCRTPoly::Integer> &b, const std::vector<DCRTPoly::Integer> &mods)
Static utility method to multiply two numbers in CRT representation. CRT representation is stored in a vector of native integers, and each position corresponds to the remainder of the number against one of the moduli in mods.
- Parameters
a – is the first number in CRT representation.
b – is the second number in CRT representation.
- Returns
the product of the two numbers in CRT representation.
-
static void Destroy()
Destructor method.
Protected Functions
-
void FitToNativeVector(const std::vector<int64_t> &vec, int64_t bigBound, NativeVector *nativeVec) const
Set modulus and recalculates the vector values to fit the modulus
- Parameters
&vec – input vector
&bigValue – big bound of the vector values.
&modulus – modulus to be set for vector.
-
inline explicit CKKSPackedEncoding(const std::vector<std::complex<double>> &rhs, size_t slots)