arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.18129cs.DC
收藏

截断乘法与批量软件SIMD AVX512实现以加速蒙哥马利乘法与模幂运算

Truncated multiplication and batch software SIMD AVX512 implementation for faster Montgomery multiplications and modular exponentiation

Laurent-Stéphane Didier, Nadia Mrabet, Léa Glandus, Jean-Marc Robert

AI总结:

本文提出基于AVX512的批量多精度整数运算实现,通过截断蒙哥马利模乘将模运算速度较GMP和OpenSSL提升4倍以上,并在模幂运算中取得显著加速。

摘要:

本文介绍了处理多精度整数运算的批量计算软件实现。在本工作中,我们使用x86-64处理器的单指令多数据(SIMD)AVX512指令集,特别是向量化融合乘加器VPMADD52。我们重点研究使用字切片存储方式对8个值进行批量乘法、平方、模乘、模平方以及常数时间模幂运算。我们探索了使用Schoolbook和Karatsuba方法,操作数分别最高可达4108位和4154位。我们还引入了一种截断乘法,在软件实现背景下加速蒙哥马利模约简的计算。我们改进的截断蒙哥马利模乘法相比传统的非截断版本提供了接近20%的速度提升。与最先进的GMP和OpenSSL库相比,我们的加速模运算速度快了4倍以上。与在256位寄存器中使用AVX512和madd52*(madd52hi或madd52lo)的OpenSSL BN_mod_exp_mont_consttimex2相比,在1024位和2048位固定窗口指数运算中,我们的512位实现分别提供了1.75倍和1.38倍的加速,而256位版本在1024位和2048位规模(此情况下为4个值的批量)上的加速分别为1.51倍和1.05倍。

英文摘要:

This paper presents software implementations of batch computations, dealing with multi-precision integer operations. In this work, we use the Single Instruction Multiple Data (SIMD) AVX512 instruction set of the x86-64 processors, in particular the vectorized fused multiplier-adder VPMADD52. We focus on batch multiplications, squarings, modular multiplications, modular squarings and constant time modular exponentiations of 8 values using a word-slicing storage. We explore the use of Schoolbook and Karatsuba approaches with operands up to 4108 and 4154 bits respectively. We also introduce a truncated multiplication that speeds up the computation of the Montgomery modular reduction in the context of software implementation. Our Truncated Montgomery modular multiplication improvement offers speed gains of almost 20 % over the conventional non-truncated versions. Compared to the state-of-the-art GMP and OpenSSL libraries, our speedup modular operations are more than 4 times faster. Compared to OpenSSL BN_mod_exp_mont_consttimex2 using AVX512 and madd52* (madd52hi or madd52lo) in 256-bit registers, in fixed-window exponentiations of sizes 1024 and 2048 , our 512-bit implementation provides speedups of respectively 1.75 and 1.38, while the 256-bit version speedups are 1.51 and 1.05 for 1024 and 2048 -bit sizes (batch of 4 values in this case).

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

↑