tuneinsight/lattigo

Question:Can I use rlwe.MemEvaluationKeySet to complete the bootstrapping?

yellow123Nike opened this issue · 4 comments

I found that bootstrapping can only be initialized using sk,but i want use rlwe.MemEvaluationKeySet to complete the bootstrapping

Or, how can the bootstrapping of v2.2.0 generated by the following code be used in v5.0.2?
btpKey := ckks.BootstrappingKey{Rlk: rlk, Rtks: rotkeys} if btp, err = ckks.NewBootstrapper(params, btpParams, btpKey); err != nil { panic(err) }

@yellow123Nike Lattigo v5 is not backward compatible with any of the previous major versions (this includes serialization). However, it is possible to instantiate a specific case of the bootstrapping by just using the rlwe.MemEvaluationKeySet. I'll let you look at the struct bootstrapping.EvaluationKeys. Essentially, you need to instantiate the bootstrapping such that it would require only the keys stored in the rlwe.MemEvaluationKeySet, and none the other special evaluation keys listed in the struct bootstrapping.EvaluationKeys.

"Well, my program cannot know the secret key (sk), it only knows the RelinearizationKey. When calculating with polynomials, it reports an error: panic: 0 levels < 5 log(d) -> cannot evaluate poly. Is there a simple way to make the polynomial evaluation's mul change to MulRelin?"

The issue you are running into is not related to the relinearization key but to the homomorphic capacity of the ciphertext. The error says that you would need 5 levels to evaluate the polynomial, but your ciphertext is already at level 0 (it has exhausted all its homomorphic capacity)