Scheme conversion

I want to use the CKKS scheme during initialization, and then use CKKS->FHEW for scheme conversion on the server side. In order to perform some comparison operations, since I think the server cannot have public and private keys, can I generate the parameters for the conversion scheme during initialization? How can I generate this scheme conversion?

The FHEW secret key and bootstrapping key need to be generated by the owner of the CKKS secret key. EvalCKKStoFHEWKeyGen needs to be called at this entity during initialization. The public parameters and keys have to then be separately transmitted to the server. You should look at scheme-switching-serial.cpp for an example. The naming convention there is different: server is the generator of the keys and clientProcess is the evaluator.

ok,thers is a question.
Does the SchemeSwitchingDataSerializer class have to be used for scheme conversion serialization? I need to perform scheme conversion during initialization. I save the cryptocontext using the regularClientside chronicle file, and then obtain the cryptocontext using deserialization on the server side. Is it possible to obtain the clientBinCC in the following way
CryptoContext cc;
if (!Serial::DeserializeFromFile(DATAFOLDERC + “/cryptocontext.txt”, cc, SerType::BINARY)) {
std::cerr << "I cannot read serialization from " << DATAFOLDER + “/cryptocontext.txt” << std::endl;
}
std::shared_ptrlbcrypto::BinFHEContext clientBinCC{cc->GetBinCCForSchemeSwitch()};

I don’t understand your question.
The example I mentioned does at the entity which should perform the scheme switching, here called client:
CryptoContext clientCC{deserializer.getCryptoContext()};
std::shared_ptrlbcrypto::BinFHEContext clientBinCC{clientCC->GetBinCCForSchemeSwitch()};
Isn’t this what you are asking for?

What does initialization mean to you? Setup, KeyGen, Serialization/Deserialization and Precomputations for scheme switching have to be performed in an initialization or pre-processing step, i.e., before the actual scheme switching of some ciphertexts is performed.

1 Like