CKKS RNS variant in the threshold example

In this example, we see the usage of

CCParams<CryptoContextCKKSRNS> parameters;
    parameters.SetMultiplicativeDepth(3);
    parameters.SetScalingModSize(50);
    parameters.SetBatchSize(batchSize);

    CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);
    // enable features that you wish to use
    cc->Enable(PKE);
    cc->Enable(KEYSWITCH);
    cc->Enable(LEVELEDSHE);
    cc->Enable(ADVANCEDSHE);
    cc->Enable(MULTIPARTY);

to generate the parameters.

I was reading this paper about the library and wondered,
which of the RNS variants is used in the code above?

If I’m not wrong, by default is in mode FLEXIBLEAUTOEXT that is the variant RE-CKKS-DE in this paper Approximate Homomorphic Encryption with Reduced Approximation Error.

1 Like

As @mmazz mentioned, CKKS defaults to FLEXIBLEAUTOEXT scaling if no specific technique is selected. You can set the scaling technique as follows:

CCParams<CryptoContextCKKSRNS> parameters;
parameters.SetScalingTechnique(<your_preferred_technique>);
1 Like