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

Recrypt issue? #418

Closed s-naveen closed 3 years ago

s-naveen commented 3 years ago

Why do I get a error when I add this line before decrypting for bootstrapping purposes. public_key.reCrypt(encrypted_text);

libc++abi.dylib: terminating with uncaught exception of type helib::LogicError: Decrypting with too much noise

If I run without that line it works fine it seems odd that bootstrapping should reduce noise but actually increase it in this case? Can someone explain?

params used: p=1523 m=10185 r=1 bits=500 c=2 gens = {7276, 6112, 6791} ords = {6, 4, 2}

jlhcrawford commented 3 years ago

Hi @s-naveen,

Bootstrapping does not cause the noise level to return to that of a freshly encrypted ciphertext. Therefore you are unable to perform the same number of operations after bootstrapping as you were prior to bootstrapping.

This paper has more details on how bootstrapping works: https://eprint.iacr.org/2014/873

You can also have a look at the bootstrapping benchmark located in benchmarks/bgv_thinboot.cpp for an example of bootstrapping.

s-naveen commented 3 years ago

@jlhcrawford thank you will read it up 🙂

faberga commented 3 years ago

Duplicate EXC_BAD_ACCESS when calling recrypt method in v2.0.0 #419