Member-only story
Processing Floating Point Values for Paillier Homomorphic Addition and RSA Homomorphic Multiplication
With Partially Homomorphic Encryption (PHE), we can have RSA, ElGamal, Exponential ElGamal, Elliptic Curve ElGamal, Paillier, Damgard-Jurik, Okamoto–Uchiyama, Benaloh, Naccache–Stern, and Goldwasser–Micali. Overall, RSA and ElGamal are multiplicative homomorphic, and Paillier and Naccache-Stern are additive homomorphic:
These methods will work well with integer values, but we have to modify them if we use floating-point values. For this, we create fraction values, and which scale the floating point values into integers.
For this, we have a precision of five decimal places. Thus an addition of:
13.43 + 5.32
can become:
13.43000 + 5.32000
Now, we need to convert these to integer values with a scalar value (10^x). We would then get:
1343000 x 10⁵ + 532000 x 10⁵
This would be become:
(1343000 + 532000) x 10⁵
