SEAL icon indicating copy to clipboard operation
SEAL copied to clipboard

BFV Example – printing incorrect results when x=6?

Open iavssw opened this issue 2 years ago • 1 comments

Hello, I am new to the code base and HE in general. As a learning experience, I was following the 1_bfv_basics.cpp and tried computing “4(x^2+1)(x+1)^2”. Out of the box, the decrypted results are printed as 0X54, even though the correct value should be 0X1C54. As a sanity check, when X=2, I find that the BFV example is working correctly and printing out the correct result.

Not sure where the problem is at the moment (maybe to_string() is broken), and any help on this would be appreciated.

iavssw avatar Feb 04 '23 05:02 iavssw

BFV has a parameter to define the range of plaintext say t Any thing that overflow that maximum value >=t will be rounded as mod t So check whether 0x1c54 = 0x54 mod t in your case.

fionser avatar Feb 06 '23 00:02 fionser