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 761 forks source link

How to bootstrap in CKKS ? #341

Closed naynajain closed 3 years ago

naynajain commented 4 years ago

Nayna Jain Linux/x86

If my understanding is right, CKKS scheme replaces bootstrapping with rescaling. And the idea of rescaling is that we cannot predict value of L perfectly at the start itself. In such case, if at runtime L seems to be not sufficient, we can try to rescale.

However, I couldn't find any example on how to do rescale ? what function to call and what value is the recommended one ?

Can someone help with this please ?

Thanks & Regards,

naynajain commented 4 years ago

As I continued to read more, I think scaling basically takes care of the level. It is not a replacement of bootstrapping. There is a different way of doing bootstrapping in CKKS ? Is it supported in HELib ? If yes how do we do that ?

shaih commented 4 years ago

HElib takes care of CKKS rescaling on its own so you do not need to worry about it. It does not yet support CKKS bootstrapping, however.

hamishun commented 3 years ago

This seems to have been answered. CKKS boostrapping is not yet supported, this is under review.

liuyi1231 commented 3 years ago

In fact, I have run HElib/examples/tutorial/02_ckks_depth.cpp(for example, version 2.1.0 ) and I found the error increase a lot when call "c*=c" 10 times iteratively. However, the error should be stable since 'rescale' in ckks homomorphic scheme, isn't it? I even has not know how to do 'polyeval' by ckks scheme. where I can find an example to do "polyeval" by ckks scheme?

DylanWangWQF commented 2 years ago

@liuyi1231 @shaih I'm also confused about this. When I run the application (including mul, encoding, rotation) with the implementation of HEAAN, it performs well. But when I rewrite it using HElib, the ciphertext generated by the same parameters (means get same slots and at least 80-bit security) is not enough to run the application (exceed the depth). In HEAAN, we run reScaleByAndEqual(ctxt, cBits); reScaleByAndEqual(ctxt, ctxt.logp); to rescale the ciphertext. In HElib, I found the ctxt.bumpNoiseBound(1e-6);to reduce the errorBound before the next operation.