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

modDownBy & modDownTo #46

Open
TaihouKai opened this issue Sep 6, 2020 · 1 comment
Open

modDownBy & modDownTo #46

TaihouKai opened this issue Sep 6, 2020 · 1 comment

Comments

@TaihouKai
Copy link

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
Copy link

let's say you have to do a+(bc)
you initialize ciphers a,b,c with logQ=200; logp=30
you first do b
c -> 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(b
c, 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:

  1. 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
  2. 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

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