Improved Plantard Arithmetic for Lattice-based Cryptography

Junhao Huang, Jipeng Zhang, Haosong Zhao, Zhe Liu, Ray C. C. Cheung, Çetin Kaya Koç, Donglong Chen

As the cryptographic community transitions toward Post-Quantum Cryptography (PQC), lattice-based schemes like Kyber and NTRU have emerged as frontrunners. However, these schemes are computationally intensive, particularly on resource-constrained embedded hardware. This paper, published in IACR Transactions on Cryptographic Hardware and Embedded Systems (TCHES), introduces a significant optimization for the "engine room" of these protocols: modular arithmetic.

The Bottleneck: Modular Multiplication

The primary performance bottleneck in lattice-based cryptography (LBC) is polynomial multiplication, typically executed via the Number Theoretic Transform (NTT). The efficiency of the NTT relies heavily on modular multiplication—the process of multiplying two numbers and finding the remainder relative to a modulus $q$. Standard techniques like Montgomery and Barrett reduction often require three multiplications per operation.

In 2021, Thomas Plantard proposed a theoretical arithmetic that could save one multiplication when one operand is a constant (such as the "twiddle factors" in NTT). However, the original design was impractical for LBC because it only supported unsigned integers and had a restrictive input range, necessitating frequent and costly "cleanup" reductions.

Improved Plantard Arithmetic

The authors redesigned Plantard arithmetic to make it viable for real-world LBC by introducing several key modifications:

  1. Signed Integer Support: The algorithm was adapted to handle signed inputs and outputs. This is vital for LBC implementations that use signed arithmetic to avoid extra additions during NTT "butterfly" operations.
  2. Enlarged Input Range: By exploiting the fact that LBC moduli (e.g., $q=3329$ for Kyber) are significantly smaller than the 16-bit word size, the authors expanded the range of acceptable inputs.
  3. Tighter Output Range: The improved version produces results in the range $(-q/2, q/2)$, which is narrower than Montgomery's output. This facilitates "lazy reduction" strategies, where multiple operations are performed before a reduction is required.
  4. Platform-Specific Optimization: The algorithm was implemented using the ARMv7E-M instruction set, leveraging the smulw{b,t} instruction to create a highly efficient 2-cycle modular multiplication on ARM Cortex-M4 processors.

Application to Kyber and NTTRU

The authors evaluated their improved arithmetic on two primary targets: Kyber, a NIST-standardized Key Encapsulation Mechanism (KEM), and NTTRU, an NTT-friendly variant of NTRU.

Algorithm 1: Kyber.PKE Key Generation, illustrating the context where optimized arithmetic is applied.

For Kyber, the optimized NTT and Inverse NTT (INTT) achieved speedups of 25.02% and 18.56%, respectively. While overall KEM operations (KeyGen, Encaps, Decaps) saw more modest gains (1.3% to 2.5%) due to the dominance of hashing functions, the core mathematical operations were significantly accelerated.

Algorithms 5 and 6: NTTRU.PKE Encryption and Decryption, showing the modular operations optimized by the improved arithmetic.

The impact on NTTRU was even more dramatic. The NTT was 83.21% faster, and the INTT was 78.64% faster. Overall KEM operations for NTTRU were approximately 50% faster than the reference implementation, setting new performance records for the platform.

Key Insights and Performance Gains

The "aha moment" of this research lies in exploiting the "slack" between LBC moduli and theoretical limits. By precomputing the product of twiddle factors and the Plantard reduction constant, the authors moved complexity out of the runtime "hot path." The synergy between the improved arithmetic's range and lazy reduction techniques allowed for skipping modular reductions across several layers of the transform.

Conclusion and Future Directions

While the 2-cycle optimization is specific to architectures supporting instructions like smulw (e.g., ARM Cortex-M4/M7), the underlying mathematical improvements to Plantard arithmetic provide a blueprint for optimizing LBC across various platforms. Future work may involve extending these techniques to 32-bit moduli used in schemes like Dilithium and further refining implementations for emerging post-quantum hardware.

Summary updated

BibTeX
@article{huang2022improved,
  author = {Junhao Huang and Jipeng Zhang and Haosong Zhao and Zhe Liu and Ray C. C. Cheung and Çetin Kaya Koç and Donglong Chen},
  title = {{Improved Plantard Arithmetic for Lattice-based Cryptography}},
  journal = {IACR Trans. Cryptogr. Hardw. Embed. Syst.},
  year = {2022},
  doi = {10.46586/tches.v2022.i4.614-636},
}
Figure