arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2501.07535cs.PLcs.CR
收藏

在GPU上使用多字模运算的密码学内核代码生成

Code Generation for Cryptographic Kernels using Multi-word Modular Arithmetic on GPU

Naifeng Zhang, Franz Franchetti

AI总结:

针对全同态加密等密码技术计算开销大的问题,本文提出多字模运算MoMA的形式化方法及配套重写系统,在GPU上生成的密码内核性能远超现有多精度库,NTT性能接近ASIC水平。

摘要:

全同态加密(FHE)和零知识证明(ZKPs)正逐渐成为分布式环境中数据安全的解决方案。然而,这些加密技术的广泛应用受到其巨大计算开销的阻碍,开销主要源于涉及大整数运算的核心密码学操作。本文提出了多字模运算(MoMA)的形式化定义,将大位宽整数运算分解为机器字上的操作。我们进一步开发了一套重写系统,通过数据类型的递归重写来实现MoMA,该系统设计为与编译器基础设施和代码生成器兼容。我们通过生成面向多种GPU的密码学内核(包括基本线性代数子程序(BLAS)运算和数论变换(NTT))来评估MoMA。我们基于MoMA的BLAS运算性能比当前最优的多精度库高出数个数量级,且基于MoMA的NTT在消费级GPU上实现了接近专用集成电路(ASIC)的性能。

英文摘要:

Fully homomorphic encryption (FHE) and zero-knowledge proofs (ZKPs) are emerging as solutions for data security in distributed environments. However, the widespread adoption of these encryption techniques is hindered by their significant computational overhead, primarily resulting from core cryptographic operations that involve large integer arithmetic. This paper presents a formalization of multi-word modular arithmetic (MoMA), which breaks down large bit-width integer arithmetic into operations on machine words. We further develop a rewrite system that implements MoMA through recursive rewriting of data types, designed for compatibility with compiler infrastructures and code generators. We evaluate MoMA by generating cryptographic kernels, including basic linear algebra subprogram (BLAS) operations and the number theoretic transform (NTT), targeting various GPUs. Our MoMA-based BLAS operations outperform state-of-the-art multi-precision libraries by orders of magnitude, and MoMA-based NTTs achieve near-ASIC performance on commodity GPUs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑