snucrypto/HEAAN

How to set parameters for binary operations?

Closed this issue · 2 comments

Hello.

I am trying to test my homomorphic circuits built up using binary operations on HEAAN. I previously created and tested on HElib.

I need to set the scheme parameters so that all operations are modulo 2. I hope this is possible.

Thank you!

Hello,

HEAAN circuits work on approximate arithmetics, not on arithmetics modulo 2.
You can encrypt 0 or 1 in the message and try to imitate arithmetics modulo 2 (addition modulo 2 can be imitated using x + y - 2xy circuit). But the error of the encryption will increase with computations. At first for example, if you encrypt 1, your decryption will be about 1.000001, and for example, after several squaring your encryption will be about 1.0001, which means your error will increase, and you are be bounded in the number of operations. For binary operations, you can try to use TFHE library. Please refer to http://homomorphicencryption.org/introduction/ for more details

Thank you, this is very helpful!