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

Noise budget above 0 in BFV example #61

Closed
MarkusRa1 opened this issue Oct 7, 2019 · 1 comment
Closed

Noise budget above 0 in BFV example #61

MarkusRa1 opened this issue Oct 7, 2019 · 1 comment

Comments

@MarkusRa1
Copy link

Went through the bfv basics example, and came across this:

/*
Finally, we multiply (x^2 + 1) * (x + 1)^2 * 2.
*/
print_line(__LINE__);
cout << "Compute encrypted_result (2(x^2+1)(x+1)^2)." << endl;
Ciphertext encrypted_result;
Plaintext plain_two("2");
evaluator.multiply_plain_inplace(x_sq_plus_one, plain_two);
evaluator.multiply(x_sq_plus_one, x_plus_one_sq, encrypted_result);
cout << " + size of encrypted_result: " << encrypted_result.size() << endl;
cout << " + noise budget in encrypted_result: "
<< decryptor.invariant_noise_budget(encrypted_result) << " bits" << endl;
cout << "NOTE: Decryption can be incorrect if noise budget is zero." << endl;
cout << endl;
cout << "~~~~~~ A better way to calculate 2(x^2+1)(x+1)^2. ~~~~~~" << endl;
/*
Noise budget has reached 0, which means that decryption cannot be expected
to give the correct result. This is because both ciphertexts x_sq_plus_one
and x_plus_one_sq consist of 3 polynomials due to the previous squaring
operations, and homomorphic operations on large ciphertexts consume much more
noise budget than computations on small ciphertexts. Computing on smaller
ciphertexts is also computationally significantly cheaper.

To me the comment seems to suggest that the noise budget should be 0 when the operations are done. However when I'm running them the noise budget end up on 7 to 10 bits.

@WeiDaiWD
Copy link
Contributor

This was caused by some changes in code increasing noise budget, which is not a bad news. The issue is now fixed internally. You will see noise budget 0 in the next release. Thank you.

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

No branches or pull requests

2 participants