openfhe-development icon indicating copy to clipboard operation
openfhe-development copied to clipboard

CloneZero either buggy or confusing

Open shaih opened this issue 11 months ago • 0 comments

The name suggests that ct->CloneZero() should return an encryption of zero with the bookkeeping information of ct, but this doesn't seem to be the case. For example, the following code coredumps:

    // below slots is an array of slots, cc is CryptoContext, ct is a ciphertext

    Plaintext pt = cc->MakeCKKSPackedPlaintext(slots);
    Ciphertext<DCRTPoly>acc = ct->CloneZero();
    auto tmp = cc->EvalMult(ct, pt);
    cc->EvalAddInPlace(acc, tmp); // <== coredumps in this line

shaih avatar Feb 10 '25 23:02 shaih