Abstract
Fully Homomorphic Encryption (FHE) enables secure computation on encrypted data, yet non-linear operations such as comparison and division remain significant bottlenecks. This paper introduces optimized algorithms for these operations by leveraging the properties of "odd" polynomials and Fermat’s Little Theorem. The proposed methods achieve a 14.5x speedup for comparison and a 1.45x speedup for division compared to previous state-of-the-art implementations in the BGV scheme.
Introduction
Fully Homomorphic Encryption (FHE) is often regarded as the "holy grail" of data privacy, allowing for the processing of sensitive information without decryption. However, integer-based FHE schemes like BGV or BFV exhibit a performance imbalance: while linear operations like addition and multiplication are efficient, non-linear operations such as comparison ($a \ge b$) and division ($a / d$) are computationally intensive.
In the encrypted domain, these operations cannot be implemented via standard branching logic. Instead, they must be represented as high-degree polynomials. Evaluating these polynomials is expensive, requiring significant multiplicative depth and a high number of homomorphic multiplications. This research aims to bridge the efficiency gap, making FHE more viable for practical applications like private machine learning and secure multiparty computation.
Methods
Optimized Comparison: The HalfCheck Approach
Previous comparison methods were often limited by input range or high computational complexity ($O(p)$). The authors introduce a subroutine called "HalfCheck", which determines if a value lies in the lower half of a range.
A key observation is that the polynomial for "HalfCheck" can be constructed as an odd polynomial. By exploiting this symmetry, the evaluation can skip all even powers, effectively halving the required work. To extend this to the full integer range $[0, p-1]$, the authors combine "HalfCheck" results using a logic-based truth table.
Furthermore, the authors utilize the Paterson-Stockmeyer (PS) method for polynomial evaluation. This reduces the number of homomorphic multiplications from $O(p)$ to $O(\sqrt{p})$, significantly improving performance without increasing multiplicative depth.
Optimized Division: The Fermat Approach
Standard homomorphic division typically involves evaluating multiple interpolated polynomials to perform equality checks across all possible values. The authors optimize this by replacing standard equality checks with a method based on Fermat’s Little Theorem ($a^{p-1} \equiv 1 \pmod p$).
While this approach slightly increases the number of homomorphic multiplications, it drastically reduces the volume of "cheap" but numerous constant multiplications and additions. As the plaintext space $p$ increases, these constant operations often become the dominant bottleneck. By bypassing this "death by a thousand cuts," the Fermat-based approach offers a significant efficiency trade-off.
Evaluation and Results
The proposed algorithms were implemented using the HElib library (BGV scheme) and evaluated across various plaintext spaces ($\mathbb{Z}_{67}, \mathbb{Z}_{131}, \mathbb{Z}_{257}, \mathbb{Z}_{521}$). Benchmarks were performed on a 2 GHz Intel Core i5 system.
In the $\mathbb{Z}_{257}$ plaintext space (approximately 8-bit integers), the results were:
- Comparison: The proposed method was 14.5x faster than the previous benchmark by Iliashenko and Zucca (2021).
- Division: The proposed method was 1.45x faster than the previous standard established by Okada et al. (2018).
The complexity of comparison was successfully reduced to $O(\sqrt{p})$ homomorphic multiplications, maintaining a manageable multiplicative depth.
Discussion and Conclusion
The research demonstrates that mathematical symmetries and number-theoretic properties can be leveraged to optimize the "hard parts" of FHE. By recognizing that comparison functions can be modeled as odd polynomials, the authors reduced the computational burden of polynomial evaluation. Additionally, the division algorithm highlights that minimizing constant operations is as critical as minimizing homomorphic multiplications in large plaintext spaces.
Future work includes scaling these methods to 32-bit or 64-bit integers, which remains challenging due to the exponential growth of polynomial degrees. Further refinements to the Paterson-Stockmeyer method specifically for odd polynomials may yield additional performance gains.
Summary updated