25 #ifndef LBCRYPTO_LATTICE_ILPARAMS_H 26 #define LBCRYPTO_LATTICE_ILPARAMS_H 31 #include "math/backend.h" 32 #include "math/nbtheory.h" 33 #include "utils/inttypes.h" 43 template <
typename IntType>
44 class ILParamsImpl :
public ElemParams<IntType> {
46 typedef IntType Integer;
66 const IntType &rootOfUnity,
const IntType &bigModulus = 0,
67 const IntType &bigRootOfUnity = 0)
68 :
ElemParams<IntType>(order, modulus, rootOfUnity, bigModulus,
79 this->rootOfUnity = RootOfUnity<IntType>(order, modulus);
127 std::ostream &doprint(std::ostream &out)
const {
135 template <
class Archive>
136 void save(Archive &ar, std::uint32_t
const version)
const {
140 template <
class Archive>
141 void load(Archive &ar, std::uint32_t
const version) {
142 if (version > SerializedVersion()) {
144 "serialized object version " + std::to_string(version) +
145 " is from a later version of the library");
150 std::string SerializedObjectName()
const {
return "ILParms"; }
151 static uint32_t SerializedVersion() {
return 1; }
ILParamsImpl(const ILParamsImpl &rhs)
Copy constructor.
Definition: ilparams.h:87
bool operator==(const ElemParams< IntType > &rhs) const
Equality operator compares ElemParams (which will be dynamic casted)
Definition: ilparams.h:119
Definition: elemparams.h:43
const ElemParams & operator=(const ElemParams &rhs)
Assignment operator using assignment operations of wrapped elements.
Definition: elemparams.h:103
const ILParamsImpl & operator=(const ILParamsImpl &rhs)
Assignment Operator.
Definition: ilparams.h:95
Definition: exception.h:147
ILParamsImpl(const usint order, const IntType &modulus)
Constructor for the case of partially pre-computed parameters.
Definition: ilparams.h:77
ILParamsImpl()
Definition: ilparams.h:52
~ILParamsImpl()
Standard Destructor method.
Definition: ilparams.h:110
Wrapper class to hold the parameters for Element types and their inheritors.
ILParamsImpl(const usint order, const IntType &modulus, const IntType &rootOfUnity, const IntType &bigModulus=0, const IntType &bigRootOfUnity=0)
Constructor for the case of partially pre-computed parameters.
Definition: ilparams.h:65
virtual bool operator==(const ElemParams< IntegerType > &other) const
Equality operator that tests the equality of all wrapped values.
Definition: elemparams.h:183
ILParamsImpl(const ILParamsImpl &&rhs)
Move constructor.
Definition: ilparams.h:105
virtual std::ostream & doprint(std::ostream &out) const
Pretty print operator for the ElemParams type.
Definition: elemparams.h:246
Definition: binfhecontext.h:36