Class PackedEncoding
Defined in File packedencoding.h
Page Contents
Inheritance Relationships
Base Type
public lbcrypto::PlaintextImpl
(Class PlaintextImpl)
Class Documentation
-
class lbcrypto::PackedEncoding : public lbcrypto::PlaintextImpl
Inheritence diagram for lbcrypto::PackedEncoding:
Collaboration diagram for lbcrypto::PackedEncoding:
Type used for representing IntArray types. Provides conversion functions to encode and decode plaintext data as type vector<int64_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 PackedEncoding(const std::vector<int64_t> &rhs)
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 PackedEncoding(std::initializer_list<int64_t> arr)
Constructs a container with a copy of each of the elements in il, in the same order.
- Parameters
arr – the list to copy.
-
inline PackedEncoding()
Default empty constructor with empty uninitialized data elements.
-
virtual bool Encode()
Encode the plaintext into a polynomial
- Returns
true on success
-
virtual bool Decode()
Decode the polynomial into the plaintext
- Returns
-
inline virtual const std::vector<int64_t> &GetPackedValue() const
-
inline virtual void SetIntVectorValue(const std::vector<int64_t> &val)
SetIntVectorValue
- Parameters
val – integer vector to initialize the plaintext
-
inline virtual PlaintextEncodings GetEncodingType() const
GetEncodingType
- Returns
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 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 Members
- void EncodingParams p
Public Static Functions
-
static void SetParams(usint m, EncodingParams params)
Method to set encoding params.
- Parameters
m – the encoding cyclotomic order. @params params data structure storing encoding parameters
- static void SetParams (usint m, const PlaintextModulus &modulus) __attribute__((deprecated("use SetParams(usint m
Method to set encoding params (this method should eventually be replaced by void SetParams(usint m, EncodingParams params);)
- Parameters
m – the encoding cyclotomic order. @params modulus is the plaintext modulus
-
static void Destroy()
Destructor method.
-
inline explicit PackedEncoding(const std::vector<int64_t> &rhs)