python-paillier icon indicating copy to clipboard operation
python-paillier copied to clipboard

Extending support to numpy

Open giorgiop opened this issue 7 years ago • 1 comments

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)

giorgiop avatar Jun 15 '17 00:06 giorgiop

Additionally, we must be able to multiply encrypted scalar with numpy arrays in the clear.

e = pubkey.encrypt(1.0)
e * x

giorgiop avatar Jun 15 '17 01:06 giorgiop