Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to compute a comparison between 2 encrypted texts using Microsoft SEAL?

I am new to this area of homomorphic encryption and I wonder how to compute a comparison between 2 ciphertexts using Microsoft SEAL. Using the BFV scheme, how could I compare 2 ciphertexts? My main goal is to find the maximum value in an encrypted array. Thanks!

like image 981
Cristian Chindriș Avatar asked Sep 06 '25 10:09

Cristian Chindriș


1 Answers

Comparison is not implemented in SEAL. Moreover, creating an exact comparison circuit for BFV is certainly possible, but very challenging and probably would not have the kind of performance you would hope. It's very close to the complexity of bootstrapping for BFV: both require bit-extraction from batching slots.

Instead, in the CKKS scheme it is possible to implement approximate comparison algorithms which are vastly more performant, but only work in some predetermined intervals. Some recent work in this direction is in https://eprint.iacr.org/2019/1234. This is probably going to be the approach you'll want to take, unless you have some very strong reason to use BFV.

like image 138
Kim Laine Avatar answered Sep 11 '25 03:09

Kim Laine



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!