International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems, Volume 2024

Revisiting Keccak and Dilithium Implementations on ARMv7-M


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ğdı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


Keywords: Keccak, Dilithium, ARMv7-M, Plantard arithmetic, lattice-based cryptography


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.

Publication

Transactions of Cryptographic Hardware and Embedded Systems, Volume 2024, Issue 2

Paper

Artifact

Artifact number
tches/2024/a8

Artifact published
May 31, 2024

Badge
🏆 IACR CHES Results Reproduced

README

ZIP (889068 Bytes)  

View on Github

License

Some files in this archive are licensed under a different license. See the contents of this archive for more information.


BibTeX How to cite

Huang, J., Adomnicăi, A., Zhang, J., Dai, W., Liu, Y., Cheung, R. C. C., … Chen, D. (2024). Revisiting Keccak and Dilithium Implementations on ARMv7-M. IACR Transactions on Cryptographic Hardware and Embedded Systems, 2024(2), 1–24. https://doi.org/10.46586/tches.v2024.i2.1-24 Artifact available at https://artifacts.iacr.org/tches/2024/a8