International Association for Cryptologic Research

International Association
for Cryptologic Research

CryptoDB

Revisiting Keccak and Dilithium Implementations on ARMv7-M

Authors:
Junhao Huang , Guangdong Provincial Key Laboratory IRADS, BNU-HKBU United International College, Zhuhai, China; Hong Kong Baptist University, Hong Kong, China
Alexandre Adomnicăi , Independent researcher, Paris, France
Jipeng Zhang , Nanjing University of Aeronautics and Astronautics, Nanjing, China
Wangchen Dai , Zhejiang Lab, Hangzhou, China
Yao Liu , Sun Yat-sen University, Zhuhai, China
Ray C. C. Cheung , City University of Hong Kong, Hong Kong, China
Çetin Kaya Koç , Nanjing University of Aeronautics and Astronautics, Nanjing, China; Iˇgdır University, Merkez, Turkey; University of California Santa Barbara, Santa Barbara, USA
Donglong Chen , Guangdong Provincial Key Laboratory IRADS, BNU-HKBU United International College, Zhuhai, China
Download:
DOI: 10.46586/tches.v2024.i2.1-24
URL: https://tches.iacr.org/index.php/TCHES/article/view/11419
Search ePrint
Search Google
Abstract: Keccak is widely used in lattice-based cryptography (LBC) and its impact to the overall running time in LBC scheme can be predominant on platforms lacking dedicated SHA-3 instructions. This holds true on embedded devices for Kyber and Dilithium, two LBC schemes selected by NIST to be standardized as quantumsafe cryptographic algorithms. While extensive work has been done to optimize the polynomial arithmetic in these schemes, it was generally assumed that Keccak implementations were already optimal and left little room for enhancement.In this paper, we revisit various optimization techniques for both Keccak and Dilithium on two ARMv7-M processors, i.e., Cortex-M3 and M4. For Keccak, we improve its efficiency using two architecture-specific optimizations, namely lazy rotation and memory access pipelining, on ARMv7-M processors. These optimizations yield performance gains of up to 24.78% and 21.4% for the largest Keccak permutation instance on Cortex-M3 and M4, respectively. As for Dilithium, we first apply the multi-moduli NTT for the small polynomial multiplication cti on Cortex-M3. Then, we thoroughly integrate the efficient Plantard arithmetic to the 16-bit NTTs for computing the small polynomial multiplications csi and cti on Cortex-M3 and M4. We show that the multi-moduli NTT combined with the efficient Plantard arithmetic could obtain significant speed-ups for the small polynomial multiplications of Dilithium on Cortex-M3. Combining all the aforementioned optimizations for both Keccak and Dilithium, we obtain 15.44% ∼ 23.75% and 13.94% ∼ 15.52% speed-ups for Dilithium on Cortex-M3 and M4, respectively. Furthermore, we also demonstrate that the Keccak optimizations yield 13.35% to 15.00% speed-ups for Kyber, and our Keccak optimizations decrease the proportion of time spent on hashing in Dilithium and Kyber by 2.46% ∼ 5.03% on Cortex-M4.
BibTeX
@article{tches-2024-34043,
  title={Revisiting Keccak and Dilithium Implementations on ARMv7-M},
  journal={IACR Transactions on Cryptographic Hardware and Embedded Systems},
  publisher={Ruhr-Universität Bochum},
  volume={024 No. 2},
  pages={1-24},
  url={https://tches.iacr.org/index.php/TCHES/article/view/11419},
  doi={10.46586/tches.v2024.i2.1-24},
  author={Junhao Huang and Alexandre Adomnicăi and Jipeng Zhang and Wangchen Dai and Yao Liu and Ray C. C. Cheung and Çetin Kaya Koç and Donglong Chen},
  year=2024
}