Throw for non-relinearized ciphertexts in relinearizing ops
Nov 30 find · published Nov 24tzasacky opened pull request #1422 to add error checking in EvalMult, EvalSquare, rotation, and BFV EvalRotate/EvalAtIndex operations. These operations silently returned wrong results when given ciphertexts with more than 2 elements. The CryptoContext wrappers pass only the relinearization key for s^2 to the scheme; given a 3-element ciphertext (e.g., from EvalMultNoRelin), the scheme computes the full tensor product, key switches only the third element, and drops the rest, producing wrong decryptions without error. The fix throws an exception and directs users to Relinearize() or EvalMultAndRelinearize(). Rotations had the same issue: LeveledSHEBase::EvalAutomorphism had the check, but LeveledSHEBFVRNS overrides it, and EvalFastRotation had no check. The fix adds the check to all affected operations.
Comments
Sign in to join the conversation.