nucypher / nufhe

NuCypher fully homomorphic encryption (NuFHE) library implemented in Python
https://nufhe.readthedocs.io/en/latest/
GNU General Public License v3.0
441 stars 53 forks source link

Indexable and computable LweSampleArray's #15

Open drbh opened 5 years ago

drbh commented 5 years ago

I can

vm.gate_nand(cipherbit1,cipherbit2)

and get

<nufhe.lwe.LweSampleArray at  ... >

but I can't

vm.gate_nand(cipherbit1[0],cipherbit2[0])

cause I get

ERROR:root:Failed to compile
...

Can we make LweSampleArray indexable, and make it possible to compute on a single subset of bits from a larger LweSampleArray?

fjarri commented 5 years ago

Currently you can do, as a workaround:

vm.gate_nand(cipherbit1[0:1],cipherbit2[0:1])

(or any other view, as long as it has a shape longer than 0). I agree that having scalar ciphertexts would be convenient, so I'm not closing the issue.