Add invariant noise to decryptor#545
Conversation
| for (size_t i = 0; i < coeff_modulus_size; i++) { | ||
| auto power = static_cast<double>(sizeof(uint64_t) * 8 * i); | ||
| auto word = static_cast<double>(norm.get()[i]); | ||
| invariant_noise += word * exp2(power); |
There was a problem hiding this comment.
Looking through other code, I suspect this is the wrong way to reduce a coefficient into a double precision number as this doesn't take into account the coefficient modulus values.
There was a problem hiding this comment.
Nevermind, I now think this is correct. The coefficients are indeed stored as RNS, which is what led to my doubt. However, invariant_noise_internal (the code I factored out of the existing invariant_noise_budget function) calls compose_array(noise_poly, coeff_count, pool_) before computing the infinity norm. This converts the RNS to multi-precision, so the infinity norm is a multi-precision value, which is what I was assuming here.
|
Interesting approach. I've been working on a related noise management feature for BFV — PR #746 with TrueBootstrapper. Would appreciate any feedback from reviewers familiar with this area. |
Allow users to read the invariant noise as a double precision value. This provides more fidelity when validating noise models.