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.14k stars 765 forks source link

Small performance improvements and cleanup #373

Closed dimhotepus closed 3 years ago

dimhotepus commented 4 years ago

Unfortunately, can't check changes via tests, as have Windows machine. Could you, please, check test results for me :)?

Also, using some CI tool like https://travis-ci.org/ + pull request hook make tests checking much more easier and disallows merging of broken changes.

Signed-off-by: Dmitry Tsarevich dimhotepus@gmail.com

faberga commented 4 years ago

@dimhotepus Thank you for the bug fix suggestions. Since we are readying our v1.1.0 release, if you agree I will incorporate your changes in this release and credit the contribution to you using your sign-off signature.

Thank you -Flavio

dimhotepus commented 4 years ago

@faberga Thank you.

A little note, I haven't tested my changes, so, please, run test suite on them. Some tests may be broken due to the fact we don't hide logical problems in norms.cpp now.

victorshoup commented 4 years ago

Note that my PR victor_initial_CKKS_review fixed one of the LogicError non-throw bugs in norms.cpp specifically, at line 503. Also note that victor_initial_CKKS_review also corrected the condition at line 502. So please be careful to ensure that the bug fix at line 502 remains intact. Lines 502-503 should read:

if (!(palg.getP() == -1 && palg.getPow2() >= 2 && sz <= m / 2)) throw LogicError("bad args to CKKS_canonicalEmbedding");

Note the <= (which replaces <, which was incorrect).

For some reason, I didn't look for other LogicError non-throw bugs when I fixed that one. Also note that NTL contains a function called LogicError which itself throws an exception...maybe this code was initially written assuming that function was called...that would explain the bug.

faberga commented 4 years ago

@dimhotepus @victorshoup We ported the fixes to our v1.1.0 release and are running our internal regression tests. Everything going well, we will prepare the public release today/tomorrow.

faberga commented 4 years ago

@dimhotepus Hi, V1.1.0-beta.0 is now available and current. Can you rebase your PR so we can review, please?

Thank you. Flavio

dimhotepus commented 4 years ago

@faberga Integrated latest changes, now pr is slim and simple.

faberga commented 3 years ago

Closing as this PR has been superceeded by more recent versions of HElib.