Class PlaintextFactory
Defined in File plaintextfactory.h
Page Contents
Class Documentation
-
class lbcrypto::PlaintextFactory
Static factory that creates plaintexts of a given encoding type (coefficient-packed, packed, string or CKKS packed) over given element and encoding parameters.
Public Static Functions
Creates an empty plaintext of the given encoding type.
- Parameters
encoding – the encoding type
vp – element parameters of the polynomial (Poly, NativePoly or DCRTPoly parameters)
ep – encoding parameters
schemeID – scheme the plaintext is created for (used by the coefficient-packed encoding)
cdt – CKKS data type (used by the CKKS packed encoding)
- Returns
the plaintext
Creates and encodes a plaintext from an integer vector (packed or coefficient-packed encoding). The vector may hold at most ringDim values (ringDim/2 for CKKS).
- Parameters
value – the integer values to encode
encoding – the encoding type
vp – element parameters of the polynomial (Poly, NativePoly or DCRTPoly parameters)
ep – encoding parameters
schemeID – scheme the plaintext is created for
noiseScaleDeg – noise scale degree of the plaintext (BGV)
level – level of the plaintext
scalingFactor – integer scaling factor of the plaintext (BGV)
- Returns
the encoded plaintext
Creates and encodes a plaintext from a string (string encoding). The string may hold at most ringDim characters (ringDim/2 for CKKS).
- Parameters
value – the string to encode
encoding – the encoding type
vp – element parameters of the polynomial (Poly, NativePoly or DCRTPoly parameters)
ep – encoding parameters
schemeID – scheme the plaintext is created for
noiseScaleDeg – noise scale degree of the plaintext (BGV)
level – level of the plaintext
scalingFactor – integer scaling factor of the plaintext (BGV)
- Returns
the encoded plaintext