Asiacrypt’19 – Numerical Method for Comparison on Homomorphically Encrypted Numbers

One of the Asiacrypt 2019 papers invited to submit to Journal of Cryptology has been presented in the Homomorphic Encryption session. The paper, by Jung Hee Cheon, Dongwoo Kim, Duhyeong Kim, Hun Hee Lee and Keewoo Lee, presents new numerical methods to evaluate homomorphically the min/max and the comparison functions. These functions can be largely used in real-world applications but their homomorphic evaluation is not always easy. The best homomorphic encryption (HE) schemes for the evaluation of comparisons are the ones computing Boolean functions on bitwise data (messages in \(\{0,1\}\)). But these schemes are less efficient than word-wise HE schemes (messages in \(\mathbb{C}\) or \(\mathbb{Z}_p\)) for the evaluation of polynomial or SIMD operations. Some of the word-wise HE schemes, in particular, use polynomial approximations (such as Taylor) to homomorphically evaluate comparisons: the degree of the polynomial approximation is strictly related to the precision of the evaluation, but the more the degree increases, the more the evaluation becomes expensive.

So, is there a way to efficiently evaluate non-polynomial functions (such as min/max and comparison) by using a polynomial approximation? This work answers to the question positively and proposes iterative algorithms to achieve the purpose. For the evaluation of the max function, they start from the following fact:

\[
max(a,b) = \frac{a+b}{2} + \frac{|a-b|}{2} = \frac{a+b}{2} + \frac{\sqrt{(a-b)^2}}{2}.
\]

They approximate the square root function by using an iterative method proposed by Wilkes in 1951: the precision of the approximation depends on the number of iterations. For the evaluation of the comparison they observe that it can be computed as an approximation of the step function

\[
(a = max(a,b)?, b=max(a,b)?) = \left( \frac{a^{2^t}}{ a^{2^t} + b^{2^t}} , \frac{b^{2^t}}{ a^{2^t} + b^{2^t}} \right),
\]

with precision depending on the choice of \(t\). The inverse function is approximated by using the Goldschmidt’s division algorithm.

The authors implement their techniques for the homomorphic scheme HEAAN: the computational complexity of their algorithms is asymptotically optimal for the min/max and quasi-optimal for the comparison (in terms of polynomial approximation). They also provide experimental results showing that their method is better than previous polynomial approximation methods proposed for word-wise HE schemes. In particular, they perform experiments to evaluate the max and the comparison on \(2^{16}\) pairs of 32-bit integers: the max is computed in in 75 s, i.e 1.14 ms per slot, by preserving the top-10 most significant bits, and the comparison is computed in 230 s, i.e. 3.5 ms per slot, by preserving 14-bits of precision.