Hi,
I am curious why the if-else branch(probably Line645-647) i touched following from src/pke/lib/scheme/ckksrns/ckksrns-leveledshe.cpp still need to add compositeDegree in the condition check after we did the modreduce option?
if (c1lvl < c2lvl) {
if (c1depth == 2) {
if (c2depth == 2) {
double scf1 = ciphertext1->GetScalingFactor();
double scf2 = ciphertext2->GetScalingFactor();
double scf = cryptoParams->GetScalingFactorReal(c1lvl);
double q1 = cryptoParams->GetModReduceFactor(sizeQl1 - 1);
for (uint32_t j = 1; j < compositeDegree; j++) {
q1 *= cryptoParams->GetModReduceFactor(sizeQl1 - j - 1);
}
EvalMultCoreInPlace(ciphertext1, scf2 / scf1 * q1 / scf);
ModReduceInternalInPlace(ciphertext1, compositeDegree);
if (c1lvl + compositeDegree < c2lvl) {
LevelReduceInternalInPlace(ciphertext1, c2lvl - c1lvl - compositeDegree);
}
ciphertext1->SetScalingFactor(ciphertext2->GetScalingFactor());
}
...
}}
Great thanks for your help.