modDownBy & modDownTo
Opened this issue · 1 comments
TaihouKai commented
What is the difference between these two?
I am sorry if I missed anything, but I didn't find any document related to this.
imtiyazuddin commented
let's say you have to do a+(bc)
you initialize ciphers a,b,c with logQ=200; logp=30
you first do bc -> logp=60; logQ=200
so to add a with logp=30 and logQ=200 you have to reduce scalefactor of bc cipher
so you do reScaleByAndEqual(bc, logp)
you get cipher b*c with logp=30; logQ=170
Now cipher a has logp=30 but logQ=200
so you have scale down mod to lower level i.e. 170
you can do this by two way:
- use a = modDownBy(a, 30) here we use 30 because that is logp. This also mean you are adding this cipher to a cipher which had undergone one multiplication depth
- use a = modDownTo(a, bc.logq) here we use cipher bc.logq to indicate the level of logQ in the ciphertext b*c. this is useful when you don't know at what multiplicative depth that cipher is