Closed vrush0022 closed 3 years ago
Unfortunately, Homomorphic Encryption (HE) does not support comparison between ciphertexts.
You can easily translate a comparison ca > cb
into the extraction of the sign bit (MSB) of ca-cb
. However, individual bit extraction/manipulation cannot be done with HE.
This problem is treated extensively in the literature, since this functionality is required for non-linear activation functions in Neural Networks, and other comparisons in Machine Learning. The two standard approaches to implement it are:
In short, you cannot compare two ciphertexts with Pyfhel.
Is there any way I can compare two cyphertext? I would like to perform c2a<c2b.