Paper 2024/1198

ECO-CRYSTALS: Efficient Cryptography CRYSTALS on Standard RISC-V ISA

Xinyi Ji, Nanjing University of Posts and Telecommunications
Jiankuo Dong, Nanjing University of Posts and Telecommunications
Junhao Huang, Hong Kong Baptist University
Zhijian Yuan, Nanjing University of Posts and Telecommunications
Wangchen Dai, Sun Yat-sen University
Fu Xiao, Nanjing University of Posts and Telecommunications
Jingqiang Lin, University of Science and Technology of China
Abstract

The field of post-quantum cryptography (PQC) is continuously evolving. Many researchers are exploring efficient PQC implementation on various platforms, including x86, ARM, FPGA, GPU, etc. In this paper, we present an Efficient CryptOgraphy CRYSTALS (ECO-CRYSTALS) implementation on standard 64-bit RISC-V Instruction Set Architecture (ISA). The target schemes are two winners of the National Institute of Standards and Technology (NIST) PQC competition: CRYSTALS-Kyber and CRYSTALS-Dilithium, where the two most time-consuming operations are Keccak and polynomial multiplication. Notably, this paper is the first to deploy Kyber and Dilithium on the 64-bit RISC-V ISA. Firstly, we propose a better scheduling strategy for Keccak, which is specifically tailored for the 64-bit dual-issue RISC-V architecture. Our 24-round Keccak permutation (Keccak-$p$[1600,24]) achieves a 59.18% speed-up compared to the reference implementation. Secondly, we apply two modular arithmetic (Montgomery arithmetic and Plantard arithmetic) in the polynomial multiplication of Kyber and Dilithium to get a better lazy reduction. Then, we propose a flexible dual-instruction-issue scheme of Number Theoretic Transform (NTT). As for the matrix-vector multiplication, we introduce a row-to-column processing methodology to minimize the expensive memory access operations. Compared to the reference implementation, we obtain a speedup of 53.85%$\thicksim$85.57% for NTT, matrix-vector multiplication, and INTT in our ECO-CRYSTALS. Finally, our ECO-CRYSTALS implementation for key generation, encapsulation, and decapsulation in Kyber achieves 399k, 448k, and 479k cycles respectively, achieving speedups of 60.82%, 63.93%, and 65.56% compared to the NIST reference implementation. Similarly, our ECO-CRYSTALS implementation for key generation, sign, and verify in Dilithium reaches 1,364k, 3,191k, and 1,369k cycles, showcasing speedups of 54.84%, 64.98%, and 57.20%, respectively.

Metadata
Available format(s)
PDF
Category
Implementation
Publication info
Preprint.
Keywords
PQCKyberDilithiumRISC-VKeccakMatrix-vector multiplication
Contact author(s)
2022040513 @ njupt edu cn
djiankuo @ njupt edu cn
jhhuang_nuaa @ 126 com
yuanxiaojian32 @ gmail com
w dai @ my cityu edu hk
xiaof @ njupt edu cn
linjq @ ustc edu cn
History
2024-07-25: revised
2024-07-25: received
See all versions
Short URL
https://ia.cr/2024/1198
License
Creative Commons Attribution-NonCommercial-ShareAlike
CC BY-NC-SA

BibTeX

@misc{cryptoeprint:2024/1198,
      author = {Xinyi Ji and Jiankuo Dong and Junhao Huang and Zhijian Yuan and Wangchen Dai and Fu Xiao and Jingqiang Lin},
      title = {{ECO}-{CRYSTALS}: Efficient Cryptography {CRYSTALS} on Standard {RISC}-V {ISA}},
      howpublished = {Cryptology {ePrint} Archive, Paper 2024/1198},
      year = {2024},
      url = {https://eprint.iacr.org/2024/1198}
}
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.