You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#include "openfhe.h"
#include <vector>
#include <iostream>
using namespace lbcrypto;
using namespace std;
int main(){
uint32_t multDepth = 50;
uint32_t scaleModSize = 59;
CCParams<CryptoContextCKKSRNS> parameters;
parameters.SetMultiplicativeDepth(multDepth);
parameters.SetScalingModSize(scaleModSize);
CryptoContext<DCRTPoly> cc = GenCryptoContext(parameters);
cc->Enable(PKE);
cc->Enable(LEVELEDSHE);
auto keys = cc->KeyGen();
auto val = cc->Encrypt(keys.publicKey, cc->MakeCKKSPackedPlaintext(vector < double > {1}));
for (int i = 0; i < 41; i++) {
auto added = cc->EvalAdd(val, i);
Plaintext p;
cc->Decrypt(keys.secretKey, added, &p);
p->SetLength(1);
cout << "Added " << to_string(i) << ":\t" << p << endl;
}
}
You'll see that after the first few iterations (which produce the correct result), we start encountering the wrong result
The text was updated successfully, but these errors were encountered:
yspolyakov
changed the title
When mult depth is high, repeated additions produces incorrect result.
When the scaling method is set to FLEXIBLEAUTEXT (Default), repeated additions produces incorrect result.
May 2, 2023
I verified that this example works (also for smaller depths and scaling factors) as long as the scaling mode is to FIXEDMANUAL, FIXEDAUTO, or FLEXIBLEAUTO.
yspolyakov
changed the title
When the scaling method is set to FLEXIBLEAUTEXT (Default), repeated additions produces incorrect result.
When the scaling method is set to FLEXIBLEAUTOEXT (Default), repeated additions produce incorrect result.
May 3, 2023
Based off of [EvalAdd does not add in some cases](https://openfhe.discourse.group/t/evaladd-does-not-add-in-some-cases/517)
You'll see that after the first few iterations (which produce the correct result), we start encountering the wrong result
The text was updated successfully, but these errors were encountered: