MechFroG88 / PyMIFE

Functional encryption library for python
MIT License
8 stars 0 forks source link

negative values for the LWE scheme #4

Open JackeyNgKY opened 1 week ago

JackeyNgKY commented 1 week ago

Firstly, thanks for the library which helps me a lot in my coursework.

I'm sorry if this is naive question as I'm new to the functional encryption. Is it possible to support negative values in LWE scheme?

JackeyNgKY commented 1 week ago

I just found that if I remove % key.p from the example, the negative value can be supported.

[Example from the Readme] from mife.single.selective.lwe import FeLWE

n = 10 x = [i - 10 for i in range(n)] y = [i for i in range(n)] key = FeLWE.generate(n, 4, 4) c = FeLWE.encrypt(x, key) sk = FeLWE.keygen(y, key) m = FeLWE.decrypt(c, key.get_publickey(), sk) **% key.p_**