Open s-naveen opened 3 years ago
Hi @s-naveen Can you give us more information on what you are trying to do in your test.cpp program and also the parameters you used to build the context ?
-Flavio
@faberga
// Plaintext prime modulus
unsigned long p = 131;
// Cyclotomic polynomial - defines phi(m)
unsigned long m = 10075;
// Hensel lifting (default = 1)
unsigned long r = 1;
// Number of bits of the modulus chain
unsigned long bits = 2000;
// Number of columns of Key-Switching matrix (default = 2 or 3)
unsigned long c = 2;
// Generating set of Zm* group.
std::vector<long> gens = {3876, 6852, 1301};
// Orders of the previous generators.
std::vector<long> ords = {12, 20, 2};
NTL::Vec<long> mvec;
mvec.SetLength(3);
mvec[0] = 13;
mvec[1] = 25;
mvec[2] = 31;
helib::Context context = helib::ContextBuilder<helib::BGV>()
.m(m)
.p(p)
.r(r)
.gens(gens)
.ords(ords)
.bits(bits)
.c(c)
.bootstrappable(true)
.mvec(mvec)
.build();
Just a simple test of addition and couple of multiplications
helib::Ptxt<helib::BGV> query_ptxt(context);
query_ptxt[0] = 20;
public_key.Encrypt(encrypted_text, query_ptxt);
public_key.Encrypt(encrypted_text2, query_ptxt);
public_key.Encrypt(encrypted_text3, query_ptxt);
public_key.Encrypt(encrypted_text4, query_ptxt);
encrypted_text.addCtxt(encrypted_text2);
encrypted_text.multiplyBy(encrypted_text3);
encrypted_text.multiplyBy(encrypted_text4);
public_key.ReCrypt(encrypted_text); <--- Error Line
helib::Ptxt<helib::BGV> result(context);
secret_key.Decrypt(result, encrypted_text);
@s-naveen Hi Naveen, please refer to comment @jlhcrawford posted to Issue #418 .
Please let me know how to solve this.
Stack Trace: