PYthon For Homomorphic Encryption Libraries, perform encrypted computations such as sum, mult, scalar product or matrix multiplication in Python, with NumPy compatibility. Uses SEAL/PALISADE as backends, implemented using Cython.
Description
I encrypted an integer and attempted to multiply it by a cleartext integer. This resulted in the following error:
TypeError: multiplicand must be either PyCtxt, PyPtxt or numerical(is <class 'int'> instead)
This works well with the BFV scheme and the error message indicates that numerical values are supported, so I'm not sure why this fails.
Description I encrypted an integer and attempted to multiply it by a cleartext integer. This resulted in the following error: TypeError: multiplicand must be either PyCtxt, PyPtxt or numerical(is <class 'int'> instead)
This works well with the BFV scheme and the error message indicates that numerical values are supported, so I'm not sure why this fails.
Code To Reproduce Error def bgv_mult(): HE = Pyfhel() bgv_params = { 'scheme': 'BGV', 'n': 2 13, 't': 65537, 'sec': 128, } HE.contextGen(bgv_params) # Generate context for bgv scheme HE.keyGen() # Key Generation: generates a pair of public/secret keys HE.rotateKeyGen() # Rotate key generation --> Allows rotation/shifting HE.relinKeyGen() # Relinearization key generation integer1 = np.array([127], dtype=np.int64) ctxt1 = HE.encryptBGV(integer1) ctxtMul1 = ctxt1 * 2
Expected behavior an encrypted value of [254]
Setup: