Is it possible to have CKKS with N=1024 and Security of 128 bits

Hello,

I am trying to configure the parameters for CKKS such that I have a security of 128 bits and a ring dimension of 1024. I intend to do only additions thus I set the multiplicativeDepth to 0. By default the minimum Ring dimension for this security and this depth is 8192. Can I tweak the parameters (for example the number of bits of the primes) such that CKKS work with N=1024 ; indeed with BFV or BGV we can tweak some parameters for it to work with N=1024 and which keep a security of 128 bits.

Here are my current parameters (which don’t work):
params = fhe.CCParamsCKKSRNS()
params.SetMultiplicativeDepth(0)
params.SetSecurityLevel(fhe.SecurityLevel.HEStd_128_classic)
params.SetRingDim(1024)
cc = fhe.GenCryptoContext(params)
cc.Enable(fhe.PKESchemeFeature.PKE)
cc.Enable(fhe.PKESchemeFeature.LEVELEDSHE)

Thank you for your help!

You could, but you might be very limited in precision. Try the following configurations (which worked for me using OpenFHE v1.2.3 (C++) ):

    uint32_t multDepth = 0;
    uint32_t firstModSize = 26;
    uint32_t scaleModSize = 20;
    uint32_t batchSize = 4;

    CCParams<CryptoContextCKKSRNS> parameters;
    parameters.SetMultiplicativeDepth(multDepth);
    parameters.SetScalingModSize(scaleModSize);
    parameters.SetFirstModSize(firstModSize);
    parameters.SetScalingTechnique(FIXEDMANUAL);
    parameters.SetBatchSize(batchSize);
    parameters.SetRingDim(1024);
    parameters.SetKeySwitchTechnique(BV);

    CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);

    // Enable the features that you wish to use
    cc->Enable(PKE);
    cc->Enable(KEYSWITCH);
    cc->Enable(LEVELEDSHE);

Thanks a lot, it works.

Are the parameters that you chose the one that let the most space for noise to grow, or do you know parameters that works with N=1024 and 128 bit security which let more space (more precision)?
As I’m doing many additions, the final result is not having enough precision.

Try to experiment with increasing/decreasing the parameter scaleModSize whose value should not exceed the value of firstModSize.

You could also try to scale down your inputs to a smaller range; this might help a bit with the precision.

Other than that, I am out of tricks under your problem constraints.