Return
CHEHAB: Automatic Compiler Code Optimization for Fully Homomorphic Encryption
DOI:10.1145/3771775.3786269.png)
Abstract
En 中文
Fully Homomorphic Encryption (FHE) enables meaningful computations directly on encrypted data, without requiring decryption. Despite its transformative potential, FHE is still computationally expensive. Moreover, writing efficient code for FHE is an error-prone, tedious, and time-consuming task that requires cryptographic expertise. Programmers may not be aware of all possible optimizations, and some optimizations require substantial effort. In this paper, we propose CHEHAB, a compiler that automatically vectorizes scalar code, optimizes it, and generates highly efficient code for FHE. CHEHAB supports the optimization of both structured and unstructured code. It takes as input a program expressed in the CHEHAB domain-specific language (embedded in C++) and uses a Term Rewriting System (TRS) to simplify it. CHEHAB targets two problems: 1) the vectorization of scalar code and 2) the reduction of instruction execution latency and noise growth. It solves these two problems using a TRS that leverages equality saturation to vectorize code, reduce the number of instructions, and reduce the circuit depth. Compared to related work, the proposed approach not only scales better to larger arithmetic circuits but also generates faster code. We evaluate CHEHAB on a set of kernels and compare it to Coyote, a state-of-the-art vectorizing compiler for FHE. We show that CHEHAB generates code that is, on average, 7.38 Chi faster in execution, 2.49 Chi lower in accumulated noise, and 251 Chi faster in compilation.
Keywords:
Automatic Code Optimization
Compiler
FHE
Fully Homomorphic Encryption
Equality Saturation
Journal
P
IF:
0
Papers:
18
Citations:
0

