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

CKKS params Issue - squeezing multiplication issue #316

Closed
macknight opened this issue Dec 15, 2022 · 4 comments
Closed

CKKS params Issue - squeezing multiplication issue #316

macknight opened this issue Dec 15, 2022 · 4 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@macknight
Copy link

macknight commented Dec 15, 2022

Hi,
Is there any error here? https://github.com/tuneinsight/lattigo/tree/master/ckks
image

we pre-multiply the plaintext by d^(1/5) and evaluate a + b/(d^(1/5))x + c/(d^(3/5)) + x^5
should be
we pre-multiply the plaintext by d^(-1/5) and evaluate a + b/(d^(1/5))x + c/(d^(3/5))x^3 + x^5

And when evaluating a + b/(d^(1/5))x + c/(d^(3/5))x^3 + x^5 , why could it be faster when using
image
The action of squeezing two multiplications in a single level, what does it actually do?
Does it mean regarding (x*x) * x as a entire one action although it uses two multiplication?

BR

@ChristianMct ChristianMct added documentation Improvements or additions to documentation question Further information is requested labels Dec 15, 2022
@ChristianMct
Copy link
Contributor

ChristianMct commented Dec 15, 2022

we pre-multiply the plaintext by d^(1/5) and evaluate a + b/(d^(1/5))x + c/(d^(3/5)) + x^5
should be
we pre-multiply the plaintext by d^(-1/5) and evaluate a + b/(d^(1/5))x + c/(d^(3/5))x^3 + x^5

Yes, this is correct.

The action of squeezing two multiplications in a single level, what does it actually do?

It means that you perform two multiplications and rescale only once. For the example above, you have an input scale of 30 bits and the next level in the chain is a modulus of ~60 bits. So after the two multiplications, the scale is ~90 bits and the rescale brings it back to ~30 bits. The point is that this is faster than having a chain of ~30 bits moduli and rescaling after every multiplication.

@macknight
Copy link
Author

macknight commented Dec 15, 2022

we pre-multiply the plaintext by d^(1/5) and evaluate a + b/(d^(1/5))x + c/(d^(3/5)) + x^5
should be
we pre-multiply the plaintext by d^(-1/5) and evaluate a + b/(d^(1/5))x + c/(d^(3/5))x^3 + x^5

Yes, this is correct.

The action of squeezing two multiplications in a single level, what does it actually do?

It means that you perform two multiplications and rescale only once. For the example above, you have an input scale of 30 bits and the next level in the chain is a modulus of ~60 bits. So after the two multiplications, the scale is ~90 bits and the rescale brings it back to ~30 bits. The point is that this is faster than having a chain of ~30 bits moduli and rescaling after every multiplication.

Hi,
for 2 multiplication, base 30bits scale + 30bitsscale(first multiplication) + 30bits(second multiplication) = 90bits scale after the two multiplication, right?

And then the next modulus is 60bits, so 90-60=30bits (this is the broght back bits)
this is quicker than normal because the there's only one homomorphic rescaling opertion.
Am I correct?

BR

@macknight macknight changed the title CKKS params Issue CKKS params Issue - squeezing multiplication issue Dec 21, 2022
@ChristianMct
Copy link
Contributor

for 2 multiplication, base 30bits scale + 30bitsscale(first multiplication) + 30bits(second multiplication) = 90bits scale after the two multiplication, right?

And then the next modulus is 60bits, so 90-60=30bits (this is the broght back bits)
this is quicker than normal because the there's only one homomorphic rescaling opertion.
Am I correct?

Yes. This is what I meant in my previous message.

@ChristianMct
Copy link
Contributor

I can understand this. But why should I firstly pre-multiply the plaintext by d^(-1/5)? Seems irrelevant to the squeezing operation?

This is because you want the scale to match the powers of x for each of the products.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants