Homomorphic encryption (HE) is a practical approach to secure computation over encrypted data. However, writing programs with efficient HE implementations remains the purview of experts. A difficult barrier for programmability is that efficiency requires operations to be vectorized in inobvious ways, forcing efficient HE programs to manipulate ciphertexts with complex data layouts and to interleave computations with data movement primitives. We present Viaduct-HE, a compiler generates efficient vectorized HE programs. Viaduct-HE can generate both the operations and complex data layouts required for efficient HE programs. The source language of Viaduct-HE is array-oriented, enabling the compiler to have a simple representation of possible vectorization schedules. With such a representation, the compiler searches the space of possible vectorization schedules and finds those with efficient data layouts. After finding a vectorization schedule, Viaduct-HE further optimizes HE programs through term rewriting. The compiler has extension points to customize the exploration of vectorization schedules, to customize the cost model for HE programs, and to add back ends for new HE libraries. Our evaluation of the prototype Viaduct-HE compiler shows that it produces efficient vectorized HE programs with sophisticated data layouts and optimizations comparable to those designed by experts.
翻译:同态加密是一种实现加密数据安全计算的实用方法。然而,编写具有高效同态加密实现的程序目前仍局限于专家领域。可编程性面临的一个关键障碍在于,效率要求以不直观的方式实现操作向量化,这迫使高效的同态加密程序需要操作具有复杂数据布局的密文,并将计算与数据移动原语交错进行。我们提出Viaduct-HE编译器,它能生成高效的向量化同态加密程序。Viaduct-HE可同时生成高效同态加密程序所需的操作和复杂数据布局。其源语言面向数组,使得编译器能够简洁表示可能的向量化调度方案。基于这种表示,编译器能够搜索所有可能的向量化调度空间,并找到具有高效数据布局的方案。在确定向量化调度后,Viaduct-HE通过项重写进一步优化同态加密程序。该编译器提供扩展点,用于自定义向量化调度的探索策略、定制同态加密程序的开销模型,以及添加新的同态加密库后端。我们对Viaduct-HE原型编译器的评估表明,它能生成具有复杂数据布局和优化的高效向量化同态加密程序,其性能可与专家设计的方案相媲美。