PALISADE Lattice Crypto Library  1.11.9
A lattice crypto library for software engineers by software engineers.
Public Member Functions | List of all members
lbcrypto::LPLeveledSHEAlgorithmCKKS< Element > Class Template Reference

Concrete feature class for Leveled SHECKKS operations. This class adds leveled (CKKS scheme) features to the CKKS scheme. More...

#include <ckks.h>

Inheritance diagram for lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >:
Inheritance graph
[legend]
Collaboration diagram for lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >:
Collaboration graph
[legend]

Public Member Functions

 LPLeveledSHEAlgorithmCKKS ()
 
void ModReduceInPlace (Ciphertext< Element > &ciphertext, size_t levels=1) const override
 
Ciphertext< Element > ModReduceInternal (ConstCiphertext< Element > ciphertext, size_t levels=1) const override
 
void ModReduceInternalInPlace (Ciphertext< Element > &ciphertext, size_t levels=1) const override
 
Ciphertext< Element > Compress (ConstCiphertext< Element > ciphertext, size_t towersLeft=1) const override
 
Ciphertext< Element > ComposedEvalMult (ConstCiphertext< Element > cipherText1, ConstCiphertext< Element > cipherText2, const LPEvalKey< Element > quadKeySwitchHint) const override
 
Ciphertext< Element > LevelReduce (ConstCiphertext< Element > ciphertext, const LPEvalKey< Element > linearKeySwitchHint, size_t levels) const override
 
Ciphertext< Element > LevelReduceInternal (ConstCiphertext< Element > ciphertext, const LPEvalKey< Element > linearKeySwitchHint, size_t levels) const override
 
void LevelReduceInternalInPlace (Ciphertext< Element > &ciphertext, const LPEvalKey< Element > linearKeySwitchHint, size_t levels) const override
 
Ciphertext< Element > EvalPoly (ConstCiphertext< Element > cipherText, const std::vector< double > &coefficients) const override
 
template<class Archive >
void save (Archive &ar) const
 
template<class Archive >
void load (Archive &ar)
 
std::string SerializedObjectName () const
 
template<>
void ModReduceInternalInPlace (Ciphertext< Poly > &ciphertext, size_t levels) const
 
template<>
void ModReduceInternalInPlace (Ciphertext< NativePoly > &ciphertext, size_t levels) const
 
template<>
void ModReduceInternalInPlace (Ciphertext< DCRTPoly > &ciphertext, size_t levels) const
 
template<>
Ciphertext< PolyModReduceInternal (ConstCiphertext< Poly > ciphertext, size_t levels) const
 
template<>
Ciphertext< NativePolyModReduceInternal (ConstCiphertext< NativePoly > ciphertext, size_t levels) const
 
template<>
Ciphertext< DCRTPolyModReduceInternal (ConstCiphertext< DCRTPoly > ciphertext, size_t levels) const
 
template<>
void ModReduceInPlace (Ciphertext< DCRTPoly > &ciphertext, size_t levels) const
 
template<>
Ciphertext< PolyCompress (ConstCiphertext< Poly > ciphertext, size_t towersLeft) const
 
template<>
Ciphertext< NativePolyCompress (ConstCiphertext< NativePoly > ciphertext, size_t towersLeft) const
 
template<>
Ciphertext< DCRTPolyCompress (ConstCiphertext< DCRTPoly > ciphertext, size_t towersLeft) const
 
template<>
Ciphertext< PolyLevelReduceInternal (ConstCiphertext< Poly > ciphertext, const LPEvalKey< Poly > linearKeySwitchHint, size_t levels) const
 
template<>
void LevelReduceInternalInPlace (Ciphertext< Poly > &ciphertext, const LPEvalKey< Poly > linearKeySwitchHint, size_t levels) const
 
template<>
Ciphertext< NativePolyLevelReduceInternal (ConstCiphertext< NativePoly > ciphertext, const LPEvalKey< NativePoly > linearKeySwitchHint, size_t levels) const
 
template<>
void LevelReduceInternalInPlace (Ciphertext< NativePoly > &ciphertext, const LPEvalKey< NativePoly > linearKeySwitchHint, size_t levels) const
 
template<>
Ciphertext< DCRTPolyLevelReduceInternal (ConstCiphertext< DCRTPoly > ciphertext, const LPEvalKey< DCRTPoly > linearKeySwitchHint, size_t levels) const
 
template<>
void LevelReduceInternalInPlace (Ciphertext< DCRTPoly > &ciphertext, const LPEvalKey< DCRTPoly > linearKeySwitchHint, size_t levels) const
 
template<>
Ciphertext< DCRTPolyLevelReduce (ConstCiphertext< DCRTPoly > ciphertext, const LPEvalKey< DCRTPoly > linearKeySwitchHint, size_t levels) const
 
template<>
Ciphertext< DCRTPolyEvalPoly (ConstCiphertext< DCRTPoly > x, const std::vector< double > &coefficients) const
 
- Public Member Functions inherited from lbcrypto::LPLeveledSHEAlgorithm< Element >
virtual Ciphertext< Element > ModReduce (ConstCiphertext< Element > ciphertext, size_t levels=1) const
 
template<class Archive >
void save (Archive &ar, std::uint32_t const version) const
 
template<class Archive >
void load (Archive &ar, std::uint32_t const version)
 
std::string SerializedObjectName () const
 

Detailed Description

template<class Element>
class lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >

Concrete feature class for Leveled SHECKKS operations. This class adds leveled (CKKS scheme) features to the CKKS scheme.

We use advances from the CKKS scheme for levelled homomorphic capabilities from here:

Springer, Berlin, Heidelberg (https://eprint.iacr.org/2011/277.pdf).

Template Parameters
Elementa ring element.

Constructor & Destructor Documentation

◆ LPLeveledSHEAlgorithmCKKS()

template<class Element >
lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::LPLeveledSHEAlgorithmCKKS ( )
inline

Default constructor

Member Function Documentation

◆ ComposedEvalMult()

template<class Element >
Ciphertext<Element> lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::ComposedEvalMult ( ConstCiphertext< Element >  cipherText1,
ConstCiphertext< Element >  cipherText2,
const LPEvalKey< Element >  quadKeySwitchHint 
) const
inlineoverridevirtual

Method for Composed EvalMult, which includes homomorphic multiplication, key switching, and modulo reduction. Not implemented for the CKKS/CKKS scheme.

Parameters
cipherText1ciphertext1, first input ciphertext to perform multiplication on.
cipherText2cipherText2, second input ciphertext to perform multiplication on.
quadKeySwitchHintis used for EvalMult operation.
Returns
resulting ciphertext.

Implements lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ Compress()

template<class Element >
Ciphertext<Element> lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::Compress ( ConstCiphertext< Element >  ciphertext,
size_t  towersLeft = 1 
) const
overridevirtual

Method for compressing the ciphertext before decryption.

Parameters
ciphertextis the ciphertext to perform compress on.
towersLeftis the number of towers after compression
Returns
ciphertext after the compression performed.

Reimplemented from lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ EvalPoly()

template<class Element >
Ciphertext<Element> lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::EvalPoly ( ConstCiphertext< Element >  cipherText,
const std::vector< double > &  coefficients 
) const
inlineoverridevirtual

Method for polynomial evaluation for polynomials represented as power series.

Parameters
&cipherTextinput ciphertext
&coefficientsis the vector of coefficients in the polynomial; the size of the vector is the degree of the polynomial + 1
Returns
the result of polynomial evaluation.

Reimplemented from lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ LevelReduce()

template<class Element >
Ciphertext< Element > lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::LevelReduce ( ConstCiphertext< Element >  ciphertext,
const LPEvalKey< Element >  linearKeySwitchHint,
size_t  levels 
) const
overridevirtual

Wrapper method for level reduce in CKKS. If APPROXRESCALE is used, then the method directly calls LevelReduceInternal. If EXACTRESCALE is used, the method does nothing and returns the origin ciphertext.

Parameters
ciphertextis the original ciphertext to be level reduced.
linearKeySwitchHintnot used in the CKKS scheme.
levelsthe number of towers to drop.
Returns
resulting ciphertext.

Implements lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ LevelReduceInternal()

template<class Element >
Ciphertext<Element> lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::LevelReduceInternal ( ConstCiphertext< Element >  ciphertext,
const LPEvalKey< Element >  linearKeySwitchHint,
size_t  levels 
) const
overridevirtual

Method for Level Reduction in the CKKS scheme. It just drops "levels" number of the towers of the ciphertext without changing the underlying plaintext.

Parameters
ciphertextis the original ciphertext to be level reduced.
linearKeySwitchHintnot used in the CKKS scheme.
levelsthe number of towers to drop.
Returns
resulting ciphertext.

Reimplemented from lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ LevelReduceInternalInPlace()

template<class Element >
void lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::LevelReduceInternalInPlace ( Ciphertext< Element > &  ciphertext,
const LPEvalKey< Element >  linearKeySwitchHint,
size_t  levels 
) const
overridevirtual

Method for In-place Level Reduction in the CKKS scheme. It just drops "levels" number of the towers of the ciphertext without changing the underlying plaintext.

Parameters
ciphertextis the original ciphertext to be level reduced.
linearKeySwitchHintnot used in the CKKS scheme.
levelsthe number of towers to drop.
Returns
ciphertext Contains the level-reduced cipheretext

Reimplemented from lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ ModReduceInPlace()

template<class Element >
void lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::ModReduceInPlace ( Ciphertext< Element > &  ciphertext,
size_t  levels = 1 
) const
overridevirtual

Wrapper method for rescaling. If APPROXRESCALE is used, then it directly calls the ModReduceInternalInPlace method, that corresponds to the original rescaling operation in the CKKS scheme.

If EXACTRESCALE is used, rescaling is done automatically, and therefore calling ModReduceInPlace does nothing and returns the original ciphertext. This behavior was chosen to allow running applications written for APPROXRESCALE in the exact scheme.

Parameters
ciphertextis the ciphertext to perform modreduce on.
Returns
ciphertext after the modulus reduction performed.

Implements lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ ModReduceInternal()

template<class Element >
Ciphertext<Element> lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::ModReduceInternal ( ConstCiphertext< Element >  ciphertext,
size_t  levels = 1 
) const
overridevirtual

Method for rescaling.

Parameters
ciphertextis the ciphertext to perform modreduce on.
Returns
ciphertext after the modulus reduction performed.

Reimplemented from lbcrypto::LPLeveledSHEAlgorithm< Element >.

◆ ModReduceInternalInPlace()

template<class Element >
void lbcrypto::LPLeveledSHEAlgorithmCKKS< Element >::ModReduceInternalInPlace ( Ciphertext< Element > &  ciphertext,
size_t  levels = 1 
) const
overridevirtual

Method for rescaling in-place.

Parameters
cipherTextis the ciphertext to perform modreduce on.
levelsthe number of towers to drop.

cipherText will have modulus reduction performed in-place.

Reimplemented from lbcrypto::LPLeveledSHEAlgorithm< Element >.


The documentation for this class was generated from the following files: