Currently, I want to do basic calculations and comparison operators (+, -, *, /, ==, AND, OR, !=, …) for data types, including (int, real, boolean, string, and char).
In the long run, when my system is running, there will be a lot of those calculations and comparisons for each type.
My idea was to change each value(int, real values) to 32 bits, encrypt each bit with the FHEW scheme, and do the calculation over those encrypted vectors.
However, even for only adding integer values, it takes too much time, 40 secs.
Do you think this is a good approach? Or is there any way that you recommend implementing these the most?
If you need comparisons and arithmetic operations, then binary FHEW is the best (most general) approach available in OpenFHE. If you only need arithmetic operations, than BGV and BFV would work better (these schemes are more efficient but do not easily support comparisons). For comparisons of 32-bit integers, it is cheaper to use EvalSign instead of doing it bit by bit. In principle, you can use a larger digit size (than a bit, i.e., 3 or 4 bits), but it would become more difficult to support operations such as multiplications (more involved than using boolean FHEW, and not all functions are exposed in OpenFHE for these larger data types).
There is also a new, more efficient method that can do FHEW-like arithmetic on batches of numbers (General Functional Bootstrapping using CKKS), but it will only be supported in a future version of OpenFHE.