Open bear1988520 opened 5 years ago
It should return (-5) mod p where p is the plaintext base.
It should return (-5) mod p where p is the plaintext base.
however, it return a wrong answer
It should return (-5) mod p where p is the plaintext base.
and where p is 1021 in my code. THX very much.
-5 mod 1021 == 1016 When you decrypt you should add -1021 to the result if it's larger than 510.
-5 mod 1021 == 1016 When you decrypt you should add -1021 to the result if it's larger than 510.
THX
Technical Lead: Expected Effort (Days, Weeks or Months): Expected Start Date: People or Skills Needed:
Brief Description:
I use Helib for data encryption and calculation, but it seems that it gives a wrong answer when I set a=-2 and b=3. Have I used the wrong method? The code is as below:
publicKey.Encrypt(ctx1, to_ZZX(-2)); // Encrypt the value 2 publicKey.Encrypt(ctx2, to_ZZX(-3)); // Encrypt the value 3