HelibBgvContext#
- class HelibBgvContext#
An implementation of HeContext using the HElib BGV backend.
- init(*args, **kwargs)#
Overloaded function.
init(self: pyhelayers.HelibBgvContext, p: int, m: int, r: int, L: int) -> None
Initializes context with given parameters.
init(self: pyhelayers.HelibBgvContext, conf: pyhelayers.HelibConfig) -> None
Initializes context with the given configuration.
- param conf:
User configuration.
- type conf:
Helibconfig
-
class HelibBgvContext : public helayers::HelibContext#
An implementation of HeContext for BGV scheme in HElib.
It can be either initialized via parameters, via an HelibConfig, or loaded from a file.
It is recommended not to use directly after initialization, but use an HeContext reference instead.
It is currently in beta version, as not all BGV operators are covered.
Public Functions
-
HelibBgvContext()#
-
virtual ~HelibBgvContext()#
-
void init(unsigned long p, unsigned long m, unsigned long r, unsigned long L)#
Initializes this HelibBgvContext with the given parameters.
- Parameters:
p – The prime modulos.
m – Cyclotomic polynomial, defines phi(m).
r – Hensel lifting.
L – Number of bits of the modulus chain.
-
virtual void init(const HelibConfig &conf) override#
Initializes context with given configuration.
- Parameters:
conf – [in] user configuration
-
virtual std::shared_ptr<AbstractCiphertext> createAbstractCipher() const override#
Returns a pointer to HelibBgvCiphertext, initialized with this HelibBgvContext.
-
virtual std::shared_ptr<AbstractPlaintext> createAbstractPlain() const override#
Returns a pointer to HelibBgvPlaintext, initialized with this HelibBgvContext.
-
virtual std::shared_ptr<AbstractFunctionEvaluator> getFunctionEvaluator() override#
Returns a pointer to HelibBgvNativeFunctionEvaluator, initialized with this HelibBgvContext.
-
inline virtual int getMinFeasibleNumSlots(const HeConfigRequirement &req) const override#
Returns the smallest number of slots that guarantees the other requirements in the given HeConfigRequirement.
If there is not such a number of slots, returns -1. All the fields of the given requirement other than req.numSlots are expected to be present, while any value in numSlots will be ignored.
- Parameters:
req – The HeConfigRequirement.
- Throws:
invalid_argument – If one of the fields of
req
other than req.numSlots is not present.
-
virtual std::shared_ptr<AbstractEncoder> getEncoder() const override#
Returns a pointer to HelibBgvEncoder, initialized with this HelibBgvContext.
-
inline virtual const helib::EncryptedArray &getEncryptedArray() const#
Returns the EncryptedArray used to perform operation on ciphertexts and plaintexts that are initialized with this scheme.
-
inline virtual std::string getSchemeName() const override#
Returns the name of this scheme (i.e. “BGV”).
-
void init(const HeConfigRequirement &req) override#
Not yet implemented.
- Throws:
runtime_error – When called.
-
void init(const HelibConfig &conf)
Initialize context with given configuration.
- Parameters:
conf – Configuration details
-
HelibBgvContext()#