PALISADE Lattice Crypto Library
1.11.9
A lattice crypto library for software engineers by software engineers.
|
This class represents plaintext in the Palisade library. More...
#include <plaintext.h>
Public Member Functions | |
PlaintextImpl (shared_ptr< Poly::Params > vp, EncodingParams ep, bool isEncoded=false) | |
PlaintextImpl (shared_ptr< NativePoly::Params > vp, EncodingParams ep, bool isEncoded=false) | |
PlaintextImpl (shared_ptr< DCRTPoly::Params > vp, EncodingParams ep, bool isEncoded=false) | |
PlaintextImpl (const PlaintextImpl &rhs) | |
PlaintextImpl (const PlaintextImpl &&rhs) | |
virtual PlaintextEncodings | GetEncodingType () const =0 |
double | GetScalingFactor () const |
void | SetScalingFactor (double sf) |
bool | IsEncoded () const |
const EncodingParams | GetEncodingParams () const |
virtual bool | Encode ()=0 |
virtual bool | Decode ()=0 |
int64_t | LowBound () const |
int64_t | HighBound () const |
void | SetFormat (Format fmt) const |
template<typename Element > | |
Element & | GetElement () |
template<typename Element > | |
const Element & | GetElement () const |
usint | GetElementRingDimension () const |
const BigInteger | GetElementModulus () const |
virtual size_t | GetLength () const =0 |
virtual void | SetLength (size_t newSize) |
size_t | GetDepth () const |
void | SetDepth (size_t d) |
size_t | GetLevel () const |
void | SetLevel (size_t l) |
virtual double | GetLogError () const |
virtual double | GetLogPrecision () const |
virtual const std::string & | GetStringValue () const |
virtual const vector< int64_t > & | GetCoefPackedValue () const |
virtual const vector< int64_t > & | GetPackedValue () const |
virtual const std::vector< std::complex< double > > & | GetCKKSPackedValue () const |
virtual const std::vector< double > | GetRealPackedValue () const |
virtual void | SetStringValue (const std::string &) |
virtual void | SetIntVectorValue (const vector< int64_t > &) |
virtual bool | CompareTo (const PlaintextImpl &other) const =0 |
bool | operator== (const PlaintextImpl &other) const |
bool | operator!= (const PlaintextImpl &other) const |
virtual void | PrintValue (std::ostream &out) const =0 |
template<> | |
const Poly & | GetElement () const |
template<> | |
Poly & | GetElement () |
template<> | |
const NativePoly & | GetElement () const |
template<> | |
NativePoly & | GetElement () |
template<> | |
const DCRTPoly & | GetElement () const |
template<> | |
DCRTPoly & | GetElement () |
Protected Attributes | |
bool | isEncoded |
PtxtPolyType | typeFlag |
EncodingParams | encodingParams |
Poly | encodedVector |
NativePoly | encodedNativeVector |
DCRTPoly | encodedVectorDCRT |
double | scalingFactor |
size_t | level |
size_t | depth |
Static Protected Attributes | |
static const int | intCTOR = 0x01 |
static const int | vecintCTOR = 0x02 |
static const int | fracCTOR = 0x04 |
static const int | vecuintCTOR = 0x08 |
Friends | |
std::ostream & | operator<< (std::ostream &out, const PlaintextImpl &item) |
This class represents plaintext in the Palisade library.
PlaintextImpl is primarily intended to be used as a container and in conjunction with specific encodings which inherit from this class which depend on the application the plaintext is used with. It provides virtual methods for encoding and decoding of data.
|
pure virtual |
Method to compare two plaintext to test for equivalence. This method is called by operator==
other | - the other plaintext to compare to. |
Implemented in lbcrypto::CKKSPackedEncoding, lbcrypto::PackedEncoding, lbcrypto::CoefPackedEncoding, and lbcrypto::StringEncoding.
|
pure virtual |
Decode the polynomial into the plaintext
Implemented in lbcrypto::CKKSPackedEncoding, lbcrypto::PackedEncoding, lbcrypto::StringEncoding, and lbcrypto::CoefPackedEncoding.
|
pure virtual |
Encode the plaintext into a polynomial
Implemented in lbcrypto::CKKSPackedEncoding, lbcrypto::PackedEncoding, lbcrypto::StringEncoding, and lbcrypto::CoefPackedEncoding.
Element& lbcrypto::PlaintextImpl::GetElement | ( | ) |
GetElement
|
inline |
GetElement
|
inline |
GetElement
|
inline |
GetElement
|
inline |
GetElementModulus
|
inline |
GetElementRingDimension
|
inline |
GetEncodingParams
|
pure virtual |
GetEncodingType
Implemented in lbcrypto::CKKSPackedEncoding, lbcrypto::PackedEncoding, lbcrypto::StringEncoding, and lbcrypto::CoefPackedEncoding.
|
pure virtual |
Get method to return the length of plaintext
Implemented in lbcrypto::CKKSPackedEncoding, lbcrypto::PackedEncoding, lbcrypto::StringEncoding, and lbcrypto::CoefPackedEncoding.
|
inline |
Get the scaling factor of the plaintext.
|
inline |
Calculate and return upper bound that can be encoded with the plaintext modulus the number to encode MUST be less than or equal to this value
|
inline |
IsEncoded
|
inline |
Calculate and return lower bound that can be encoded with the plaintext modulus the number to encode MUST be greater than this value
|
inline |
operator== for plaintexts. This method makes sure the plaintexts are of the same type.
other | - the other plaintext to compare to. |
|
pure virtual |
PrintValue is called by operator<<
out |
Implemented in lbcrypto::CKKSPackedEncoding, lbcrypto::PackedEncoding, lbcrypto::CoefPackedEncoding, and lbcrypto::StringEncoding.
|
inline |
SetFormat - allows format to be changed for PlaintextImpl evaluations
fmt |
|
inlinevirtual |
resize the plaintext; only works for plaintexts that support a resizable vector (coefpacked)
newSize |
Reimplemented in lbcrypto::CKKSPackedEncoding, lbcrypto::PackedEncoding, and lbcrypto::CoefPackedEncoding.
|
inline |
Set the scaling factor of the plaintext.
|
friend |
operator<< for ostream integration - calls PrintValue
out | |
item |