Range query settings

Is there any OpenFHE libarary that does range query settings in the server environment? For say having an encrypted range query (>= or <=) operation to perform?

In OpenFHE, you can use the EvalFunc method in binfhe. You would need to specify the lookup table for the function. It works out-of-the-box for plaintext modulus up to 8.

Alternatively, you can use EvalSign (comparison) twice (a larger precision is supported).

Both will be callable from CKKS in v1.1 (once it is released).

There is also a much faster commercial (not open-source) query capability (SecurePlus Query by Duality Tech - Privacy-Preserving Tools) that supports range queries, but this is beyond the scope of the OpenFHE discourse forum.

The closest functionality in the current version of OpenFHE (v1.0.4) is illustrated in openfhe-development/src/binfhe/examples/eval-sign.cpp at v1.0.4 · openfheorg/openfhe-development · GitHub You would need to run this for 100 different LWE ciphertexts twice, but the current interface is not easy to use (requires advanced crypto knowledge).

We will expose an easier/cleaner way in v1.1 (by the end of July), where the input will be a CKKS ciphertext with a vector of numbers. I suggest waiting until that version is available.

Note that the encrypted output will also have 100 numbers (where 1 one could correspond to the range condition being satisfied and 0 corresponding to the opposite). These encrypted 1’s and 0’s could then be used as a filter for further operations (via multiplication).

Seems like your question has been answered. I’m marking this as solved but feel free to open this discussion again if you have any specific questions