snucrypto / HEAAN

Other
359 stars 94 forks source link

Setting parameters for Bootstrapping #22

Closed mayank26saxena closed 5 years ago

mayank26saxena commented 5 years ago

I'm having trouble in setting up the parameters for using the following function:

void Scheme::bootstrapAndEqual(Ciphertext& cipher, long logq, long logQ, long logT, long logI)

Thank you!

kimandrik commented 5 years ago

Hello, for logQ you set the maximum possible value used in Ciphertexts. For example use logQ from params.h. Parameter logI is normally 4, and for parameter logT you can check the paper https://eprint.iacr.org/2018/153.pdf (in the paper r = logT+logI)

In TestScheme there is an example testBootstrap (where Bootstrapping divided into parts to check the time for each of the parts)

mayank26saxena commented 5 years ago

Could you provide an example as to how one can find logQ for a given logq? Is there any relationship between the two?

I have checked the example parameters mentioned in the code but they don't work for my data.

kimandrik commented 5 years ago

There is no relationship between logq and logQ. You should set logQ the largest possible value. For example in the paper https://eprint.iacr.org/2018/153.pdf you can use logN=16, logQ=1240 (at that time it was about 80 bits security)

mayank26saxena commented 5 years ago

Okay. I used the parameters from the paper and it works!