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.
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.
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.