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

last minute api changes for parameters to the CKKS encoding functions #403

Closed victorshoup closed 3 years ago

victorshoup commented 3 years ago

After consultation with Shai, I made some last minute API changes to the parameters used for CKKS encoding. The two optional parameters are now:

double mag, long prec;

The semantics are now as follows:

// mag: defaults to Norm(array). // prec: defaults to r=getAlMod().getR(), which // is usually the same as context.getDefaultPrecision().

// mag should be an upper bound on Norm(array). // If an encoding will be encrypted, the user may wish // to hide Norm(array) by setting mag to some data-independent // upper bound. A warning is issued if Norm(array) > mag.

// The encoding will normally have an accuracy of 2^{-prec}, meaning that // Norm(array - decode(encode(array))) <= 2^{-prec}. // Note that prec may be positive, negative, or zero. // The exact logic is a bit heuristic, and a warning is // issued if the the accuracy exceeds 2^{-prec}.

// NOTE: Norm above is the infinity (i.e., max) norm.

I wanted to make this tweak before working on the mitigation branch, which I will work on next week.

faberga commented 3 years ago

PR raised against the wrong upstream repo. Closing and creating new one. -Flavio