TL;DR
This paper introduces an improved Plantard arithmetic for modular multiplication, specifically tailored for lattice-based cryptography (LBC) schemes like Kyber and NTTRU. By adapting Plantard arithmetic to handle signed integers and optimizing it for the Cortex-M4 microcontroller, the authors achieve significant speedups in polynomial arithmetic, setting new performance records for these LBC schemes on embedded platforms.
What Problem Does This Paper Address?
The increasing threat of quantum computers breaking current public-key cryptosystems has spurred research into post-quantum cryptography (PQC). Lattice-based cryptography (LBC) is a promising candidate, with schemes like Kyber and NTTRU being standardized by NIST. A critical bottleneck in these LBC schemes is polynomial multiplication, often accelerated using the Number Theoretic Transform (NTT). The efficiency of NTT heavily relies on fast modular multiplication. While Montgomery and Barrett arithmetic are standard, they have limitations for the specific moduli used in LBC. Thomas Plantard proposed a specialized modular multiplication that saves a multiplication when one operand is a constant, but it was limited to unsigned integers and had a restricted input range, making it impractical for LBC. This paper addresses the need for a more efficient and practical modular arithmetic for LBC on resource-constrained embedded systems like the Cortex-M4.
Methods
The core contribution is an improved Plantard arithmetic that overcomes the limitations of the original design. Key modifications include:
- Support for Signed Integers: The original Plantard arithmetic only handled unsigned integers. The improved version supports signed inputs and outputs, which is crucial for efficiency in NTT/INTT operations by avoiding extra additions.
- Enlarged Input Range and Narrowed Output Range: The input range is extended, and the output range is narrowed compared to the original Plantard arithmetic. This allows for better "lazy reduction" strategies, reducing the need for expensive modular reductions during NTT/INTT.
- Optimization for Cortex-M4: The authors leverage the Cortex-M4's specific instructions, particularly the
smulw{b,t}instruction for 16x32-bit multiplication, to implement the improved Plantard arithmetic efficiently. This leads to a 2-cycle modular multiplication by a constant. - Integration into LBC Schemes: The improved arithmetic is integrated into the NTT/INTT modules of Kyber and NTTRU. This involves adapting twiddle factors and optimizing butterfly units and layer merging techniques.
Datasets
Not discussed in the paper. The evaluation is based on performance metrics (cycle counts) on a specific hardware platform.
Key Insights and Ideas
- Signed Arithmetic is Key for NTT Efficiency: The paper reinforces the known benefit of using signed integers in NTT/INTT, as it eliminates an extra addition in butterfly operations, leading to faster computations.
- Plantard's Advantage is Realized with Signed Inputs: The original Plantard arithmetic's advantage of saving a multiplication with constant operands is now practically usable for LBC by extending it to signed integers.
- "Lazy Reduction" Boosted by Input/Output Range: The modified input and output ranges of the improved Plantard arithmetic significantly enhance the effectiveness of lazy reduction techniques in NTT/INTT, further reducing computational overhead.
- Microcontroller-Specific Optimizations Pay Off: Tailoring the arithmetic to the specific instruction set of the Cortex-M4 (e.g.,
smulw{b,t}) unlocks substantial performance gains that wouldn't be achievable with generic implementations. - NTTRU on Cortex-M4 is a New Benchmark: The paper presents the first assembly implementation of NTTRU on Cortex-M4, setting new speed records.
Key Results
- Kyber Speedups:
- NTT: 25.02% speedup (compared to the stack-friendly implementation of [AHKS22]).
- INTT: 20.84% (Kyber512), 18.56% (Kyber768), and 17.97% (Kyber1024) speedups.
- NTTRU Speedups:
- NTT: 83.21% speedup.
- INTT: 78.64% speedup.
- Base Multiplication: 76.40% speedup.
- Base Inversion: 59.34% speedup.
- New Speed Records: The paper sets new speed records for Kyber and NTTRU KEM schemes running on Cortex-M4.
- Reduced Cycle Counts: The improved Plantard arithmetic leads to a significant reduction in cycle counts for core polynomial operations, particularly NTT and INTT. For example, the double CT butterfly is reduced to 7 instructions.
Limitations and Future Work
- Platform Dependency: The efficiency of the 16-bit Plantard arithmetic relies heavily on the
smulw{b,t}instruction. This makes direct application difficult on architectures like AVX2 and NEON, which lack this specific instruction. - Twiddle Factor Loading Overhead: Using 32-bit twiddle factors (due to the improved arithmetic) can introduce extra cycles for data loading, although the authors argue this is offset by the arithmetic improvements.
- Extensibility to Other Platforms: While the authors discuss potential extensibility to Cortex-M7 and some RISC-V cores, further exploration is needed.
- Future Work: The authors suggest exploring the practical applications of Plantard arithmetic on various LBC schemes and platforms beyond the scope of this paper. They also mention that the improved Plantard reduction is applicable inside NTT/INTT but still requires a standard modular reduction outside these operations to ensure positive results.
Summary updated