Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add invariant noise to decryptor #545

Open
wants to merge 1 commit into
base: contrib
Choose a base branch
from

Conversation

rickwebiii
Copy link

Allow users to read the invariant noise as a double precision value. This provides more fidelity when validating noise models.

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);
Copy link
Author

@rickwebiii rickwebiii Aug 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant