Inconsistent minimum value for scalingModSize

Hello,

I noticed a potential inconsistency regarding the minimum allowed value of scalingModSize.

In commit 2052e64, the following condition checking and exception message was introduced in src/pke/lib/scheme/gen-cryptocontext-params-validation.cpp:

if (COMPOSITESCALING_MAX_MODULUS_SIZE <= parameters.GetScalingModSize() || 15 > parameters.GetScalingModSize()) {
  OPENFHE_THROW("scalingModSize should be greater than 15 and less than " + 
                std::to_string(COMPOSITESCALING_MAX_MODULUS_SIZE));
}

The message implies that scalingModSize must be greater than 15 (i.e., minimum 16), while the condition is considering 15 valid (i.e., the actual minimal is 15).

However, in src/pke/include/schemerns/rns-parametergeneration.h, the minimum value still appears to be set to 14:

protected:
    enum DCRT_MODULUS {
        DEFAULT_EXTRA_MOD_SIZE = 20,
        MIN_SIZE               = 14,
        MAX_SIZE               = 60,
    };

Should these constraints be unified?

It would be helpful to clarify which lower bound is intended by design and make the parameter generation logic, runtime check, and exception message consistent.

Thanks in advance!

Thank you for reporting it. I’ve created a corresponding issue: Inconsistency in the minimum value of scaling mod size for CKKS · Issue #1133 · openfheorg/openfhe-development · GitHub