homenc / HElib

HElib is an open-source software library that implements homomorphic encryption. It supports the BGV scheme with bootstrapping and the Approximate Number CKKS scheme. HElib also includes optimizations for efficient homomorphic evaluation, focusing on effective use of ciphertext packing techniques and on the Gentry-Halevi-Smart optimizations.
https://homenc.github.io/HElib
Other
3.11k stars 760 forks source link

Ctxt::addConstantCKKS: Use type long for denominator #421

Closed dubek closed 3 years ago

dubek commented 3 years ago

Small bug in Ctxt::addConstantCKKS(double x) -- if the value of r is bigger than 30, then the left-shift is an undefined behavior.

The fix converts the 1 to long so that we can shift-left by all allowed values of r (the allowed range is 1 to 59).

faberga commented 3 years ago

Passed all the Build&Regression tests.