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

How to select nBits according to level L in function buildModChain #368

Closed WeiBenqiang closed 4 years ago

WeiBenqiang commented 4 years ago

void buildModChain(Context& context, long nBits, long nDgts, bool willBeBootstrappable, long skHwt, long resolution, long bitsInSpecialPrimes) parameter L has become nBits.For example,the level is L=10,what should the nBits is?Is there any connection?

esteffin commented 4 years ago

@WeiBenqiang The parameter L used to be the number of levels in the modulus chain when we had fixed-size moduli in the ciphertext modulus Q. The maximum number of modulus switching operation was less or equal to L.

Since the introduction of the current finer grain noise management in 2018 HElib abandoned the concept of levels and moved onto the total number of bits of the modulus chain. In the current release of HElib that total number is nBits.

If you are still thinking in levels, start by considering 30-40 bits per level, so in your case nBits can be ~300-400 and see how you can accommodate the depth of your computation.

WeiBenqiang commented 4 years ago

THX!