python-paillier
python-paillier copied to clipboard
Extending support to numpy
It would be useful to support numpy arrays. The following example does not work. We should aim to get a vector of encrypted numbers as result.
import phe as paillier
import numpy as np
pubkey, prikey = paillier.generate_paillier_keypair(n_length=1024)
x = np.ones(10)
e = pubkey.encrypt(x)
Additionally, we must be able to multiply encrypted scalar with numpy arrays in the clear.
e = pubkey.encrypt(1.0)
e * x