Abstract
Homomorphic Encryption (HE) enables secure data processing on encrypted values, but its practical adoption is hindered by significant computational overhead. This paper introduces a universal, high-performance GPU framework for the Brakerski-Fan-Vercauteren (BFV) scheme. By implementing novel kernel fusion strategies and extending support for the "Halevi-Polyakov-Shoup" (HPS) variant to large parameter sets, the proposed framework achieves up to a 31.9× speedup over leading CPU-based libraries and outperforms state-of-the-art GPU implementations.
Introduction
Homomorphic Encryption (HE) is often regarded as the "holy grail" of privacy-preserving computation, allowing for data processing without decryption. Despite its potential, the BFV scheme—a popular integer-based HE method—suffers from severe performance bottlenecks. These primarily stem from massive ciphertext moduli and the complex "division-and-rounding" operations required for decryption and multiplication.
While Residue Number System (RNS) variants like BEHZ and HPS were developed to decompose large numbers into machine-word-sized chunks, they remain computationally intensive. Previous GPU acceleration efforts were often limited to specific variants or constrained by hardware precision limits. This work addresses these gaps by providing a unified, scalable framework for all major BFV variants.
Methodology
The framework utilizes a three-tiered hierarchical architecture designed to maximize GPU throughput and minimize memory latency.
1. Low-level Ring Arithmetic
At the base level, the framework optimizes modular reduction (Barrett reduction) using CUDA PTX instructions. This approach minimizes instruction counts and maximizes the efficiency of 64-bit integer arithmetic, which is crucial for the underlying polynomial operations.
2. RNS-level Operations
The framework employs a two-kernel approach for RNS base conversion. This design balances parallelism with memory efficiency by utilizing loop unrolling to reduce pipeline overhead. Figure 2 illustrates the representation of ciphertexts in RNS form and the associated conversion logic used for scaling and rounding.
3. High-level Homomorphic Modules
The core of the framework integrates several advanced techniques:
- Kernel Fusion: Intra-arithmetic and inter-conversion operations are fused to reduce slow Global Memory (GMEM) access. By keeping data in registers or shared memory longer, the framework mitigates the primary bottleneck in GPU-accelerated HE.
- Digit Decomposition for HPS: To overcome the floating-point precision limits that previously restricted HPS to small parameters, the authors implement a digit decomposition technique. This allows HPS to scale to the large moduli required for modern security.
- Leveled HPS Support: A leveled approach is adopted where the ciphertext modulus is reduced as computation depth increases, eliminating redundant work in deep circuits.
Evaluation and Results
The framework was evaluated on NVIDIA RTX 3090 Ti and Tesla A100 GPUs using standard BFV parameter sets (log N: 13-15, log Q: 120-660 bits). It was benchmarked against OpenFHE (CPU) and existing state-of-the-art GPU implementations.
Key Performance Metrics
- CPU Comparison: The A100 implementation achieved a 31.9× speedup over the multi-threaded OpenFHE library.
- GPU Comparison: Compared to previous BEHZ implementations, this framework improved tensoring speed by 39.7% and relinearization by 29.9%.
- Decryption: Speedups of 14.3× to 16.6× were observed compared to CPU baselines.
- Scalability: The leveled HPS variant maintained high performance even at a multiplication depth of 20, outperforming traditional variants by up to 4× in deep circuits.
Discussion
A critical insight from this work is that memory bandwidth, rather than raw compute, is the primary bottleneck for GPU-accelerated HE. Kernel fusion is the most effective optimization because it minimizes data movement between the GPU's global memory and its processing cores. Furthermore, the successful implementation of HPS with digit decomposition proves that HPS is a superior choice for GPU acceleration due to its mathematical efficiency in scaling operations, provided the precision issues are managed.
Conclusion
This paper significantly advances the state of BFV acceleration by providing a unified and highly optimized GPU framework. By addressing both low-level arithmetic and high-level module design, the authors demonstrate that HE can be made practical for real-world applications. Future work includes exploring noise management for HPS variants, scaling to multi-GPU environments for even larger workloads, and extending the hierarchical design to other HE schemes such as CKKS and BGV.
Summary updated