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

EncryptionParameters setup problem #56

Closed
lidh15 opened this issue Apr 7, 2021 · 2 comments
Closed

EncryptionParameters setup problem #56

lidh15 opened this issue Apr 7, 2021 · 2 comments

Comments

@lidh15
Copy link

lidh15 commented Apr 7, 2021

Hi, I was using BFV with the following setup:
`
parms = EncryptionParameters(scheme_type.bfv)

poly_modulus_degree = 2048

parms.set_poly_modulus_degree(poly_modulus_degree)

parms.set_coeff_modulus(CoeffModulus.Create(poly_modulus_degree, [27, 27]))
`
My encrypted numbers take part into only addition, no multiplication, so I set two coefficient modulus.
Everything was fine, but I still want to make it faster so I cut the poly_modulus_degree to 1024, and I think that means I have to change coefficient modulus from 27, 27 to 13, 13.
And then it threw logit error: failed to find enough qualifying primes
But I cannot increase that coefficient modulus bit length, right? 14+14=28>27
In the example code 1_bfv_basics.cpp Microsoft said 1024 was a legal poly_modulus_degree, I just wonder how to use it, or Microsoft made a mistake?

@Huelse
Copy link
Owner

Huelse commented Apr 7, 2021

The program is right, it is too small to find enough valid primes, you can use decryptor.invariant_noise_budget(x_encrypted) to get the noise budget. If the poly_modulus_degree is 1024, there is only 6, 6 <<13, but 2048 has 32, large more.
By default, I recommend you use CoeffModulus.BFVDefault(poly_modulus_degree) to init the bfv params, it will easily work well.

@lidh15
Copy link
Author

lidh15 commented Apr 7, 2021

well, I used default coefficient modulus for 1024, printed it I found that it simply set only one coefficient modulus size as 27,
and that makes the decryption result a polynomial rather than a number so I think that means I cannot do addition with this setup so I have to use 2048, thank you

@lidh15 lidh15 closed this as completed Apr 7, 2021
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