Open
Description
I have an algorithm that iteratively performs multiple homomorphic multiplications and needs to decrypt once in each iteration. Although the calculation is small, an error will be reported: Overflow detected in decrypted number.
I wrote a test code to describe the problem as below.
from phe import paillier
import random
public_key, private_key = paillier.generate_paillier_keypair(n_length=1024)
x = random.random()
y = random.random()
E_x = public_key.encrypt(x)
iter_k = 100
for i in range(iter_k):
print("iterations:",i)
E_x = y*E_x
private_key.decrypt(E_x)
print(private_key.decrypt(E_x))
I know that increasing the value of n_length
can alleviate the problem, but this reduces efficiency and does not eliminate the problem. So, what should I do, thank you.
Metadata
Metadata
Assignees
Labels
No labels