Paper 2024/1198

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

Xinyi Ji
Jiankuo Dong
Junhao Huang
Zhijian Yuan
Wangchen Dai
Fu Xiao
Jingqiang Lin
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.

PDF
BibTeX
ePrint ↗
@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}
}
Category
Implementation
License
CC BY-NC-SA
Submitted
Updated
Versions

Report a problem

Comments

Log in or create an account

Privacy