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

Reuse bootstrapping keys for evaluation #137

Closed
crockeea opened this issue Jul 13, 2021 · 4 comments · Fixed by #139
Closed

Reuse bootstrapping keys for evaluation #137

crockeea opened this issue Jul 13, 2021 · 4 comments · Fixed by #139

Comments

@crockeea
Copy link

In Lattigo v2.1.1, the BootstrappingKey rotation and relinearization keys are not exported, so they cannot be re-used during evaluation. The result is that I have to generate rotation keys, relinearization keys, and bootstrapping keys (which in many cases will be a superset of the former keys), serialize all of them, and send them to the server. This double memory and communication. Is there a way around this issue?

@ChristianMct
Copy link
Contributor

Hi @crockeea,

Thanks for reporting this issue, but I'm afraid there is no solution in v2.1.1.

However, as mentioned in #138, there will be a version release this week that brings a lot of improvements to the keys and key-generation procedures. In this new version, the ckks.BootstrappingKey type has public fields which enables the standalone use of the underlying relinearization and rotation keys.

@crockeea
Copy link
Author

I also noticed that there's no way to serialize bootstrapping keys; will this be possible with the new API?

@ChristianMct
Copy link
Contributor

In the new interface, the ckks.BootstrappingKey type is an alias for generic rlwe.EvaluationKey and

package rlwe

type EvaluationKey struct {
	Rlk  *RelinearizationKey
	Rtks *RotationKeySet
}

where both RelinearizationKey and RotationKeySet types implement the BinaryMarshaler interface. So, you will be able to serialize bootstrapping keys in two calls. Given the usual size of bootstrapping keys and the facts that you mentioned above, we were not planning to implement BinaryMarshaler directly for ckks.BootstrappingKey. We might however provide a more convient interface to read and write them to streams in upcoming release.

@Pro7ech
Copy link
Contributor

Pro7ech commented Jul 15, 2021

Note that it is also possible to serialize each rotation key individually by looping over the map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants