Abstract
Homomorphic Encryption (HE) is a transformative technology for privacy-preserving computation, yet it is traditionally limited by its inability to efficiently perform non-polynomial operations such as comparisons. This paper introduces a novel approach using composite polynomial approximation to evaluate the sign function. By composing low-degree polynomials rather than evaluating a single high-degree minimax approximation, the proposed method achieves the theoretical optimal complexity of $\Theta(\log(1/\epsilon))$. Our implementation demonstrates a 30x speedup over existing state-of-the-art methods for 20-bit integers, achieving an amortized latency of 1.43 milliseconds per comparison.
Introduction
Homomorphic Encryption (HE) allows for computation on encrypted data, providing a robust solution for secure outsourcing. However, standard HE schemes natively support only addition and multiplication. Non-polynomial operations, specifically the comparison function ($a > b$) and the sign function, are notoriously difficult to implement efficiently. Previous attempts have relied on high-degree minimax polynomials or rational functions. The former suffers from astronomical computational costs for high precision, while the latter requires expensive division operations that are themselves challenging to implement in HE. This work addresses these limitations by proposing a division-free, computationally optimal method for comparison.
Methodology: Composite Polynomial Approximation
The core innovation of this work is the use of Composite Polynomial Approximation. Instead of approximating the sign function with a single high-degree polynomial, the authors design a base polynomial $f$ with specific geometric properties and compose it with itself multiple times ($f \circ f \circ \dots \circ f$).
Design Principles of the Base Polynomial
To ensure convergence and efficiency, the base polynomial $f$ must satisfy three key properties:
- Origin Symmetry: $f$ must be an odd function ($f(-x) = -f(x)$).
- Fixed Points: It must satisfy $f(1)=1$ and $f(-1)=-1$ to ensure the iteration converges to the desired values.
- Derivative Control: The derivative $f'(x)$ is designed to have maximal multiple roots at 1 and -1. This "pushes" values toward the fixed points faster with each iteration.
As shown in the figure above, each successive composition ($f_0^{(2)}, f_0^{(3)}$) increases the steepness of the function near the transition point, effectively transforming a smooth curve into a sharp step function. This approach is exponentially more efficient than direct evaluation; for instance, composing a degree-3 polynomial 10 times results in a degree-59,049 polynomial but requires only 20 multiplications.
Heuristic Acceleration
To further optimize performance, the authors introduce a secondary family of polynomials, $g_n$, used in the initial phase of the computation. These "booster" polynomials have a steeper slope at the origin, moving values away from zero quickly before the $f_n$ family takes over to refine the result toward $\pm 1$.
Experimental Results
The proposed algorithms were evaluated using the HEAAN (Homomorphic Encryption for Arithmetic of Approximate Numbers) library on encrypted integers ranging from 8 to 20 bits.
Performance Benchmarks
The composite method achieves significant performance gains:
- Speedup: For 20-bit integers, the method is 30 times faster than the previous state-of-the-art rational-function-based approach.
- Latency: The amortized running time for a 20-bit comparison is reduced to just 1.43 milliseconds.
- Max/Min Operations: By leveraging the improved sign function, the "NewMax" algorithm is approximately 4.5 times faster than previous HE implementations.
Computational Efficiency
Beyond raw speed, the method is "depth-efficient." Multiplicative depth is a critical constraint in HE, as each level of depth increases noise in the ciphertext. By reaching the asymptotic lower bound of $\Theta(\log(1/\epsilon)) + \Theta(\log \alpha)$, this method minimizes the required circuit depth for a given precision.
Conclusion
This work demonstrates that the geometric "shape" of a function is more critical than exact minimax approximation when designing iterative HE algorithms. By sticking to a division-free polynomial composition strategy, the authors have established a new benchmark for homomorphic comparison. Future work may extend this composite approach to other non-polynomial piecewise functions, such as the ReLU or step functions common in neural network inference.
Summary updated