International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems, Volume 2024

Optimized Hardware-Software Co-Design for Kyber and Dilithium on RISC-V SoC FPGA


Tengfei Wang
School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, Beijing, China

Chi Zhang
School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, Beijing, China

Xiaolin Zhang
School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, Beijing, China

Dawu Gu
School of Electronic Information and Electrical Engineering, Shanghai Jiao Tong University, Shanghai, China; State Key Laboratory of Cryptology, Beijing, China

Pei Cao
Viewsource (Shanghai) Technology Company Limited, Shanghai, China


Keywords: Post-quantum cryptography, RISC-V, Kyber, Dilithium, Hardwaresoftware co-design, FPGA


Abstract

Kyber and Dilithium are both lattice-based post-quantum cryptography (PQC) algorithms that have been selected for standardization by the American National Institute of Standards and Technology (NIST). NIST recommends them as two primary algorithms to be implemented for most use cases. As the applications of RISC-V processors move from specialized scenarios to general scenarios, efficient implementations of PQC algorithms on general-purpose RISC-V platforms are required. In this work, we present an optimized hardware-software co-design for Kyber and Dilithium on the industry’s first RISC-V System-on-Chip (SoC) Field Programmable Gate Array (FPGA) platform. The performance of both algorithms is enhanced through the utilization of hardware acceleration and software optimization, while a certain level of flexibility is still maintained. The polynomial arithmetic operations in Kyber and Dilithium are accelerated by the customized accelerators. We employ a unified high-level architecture to depict their shared characteristics and design dedicated underlying modular multipliers to explore their distinctive features. The hashing functions are optimized using RISC-V assembly instructions, resulting in improved performance and reduced code size without additional hardware resources. For other operations involving matrices and vectors, we present a multi-core acceleration scheme based on the multi-core RISC-V Microprocessor Sub-System (MSS). Combining these acceleration and optimization methods, experimental results show that the overall performance of Kyber and Dilithium across different security levels improves by 3 to 5 times, while the utilized FPGA resources account for less than 5% of the total resources provided by the platform.

Publication

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

Paper

Artifact

Artifact number
tches/2024/a18

Artifact published
August 15, 2024

Badge
IACR CHES Artifacts Available

README

ZIP (8642546 Bytes)  

License
This work is licensed under the MIT License.


BibTeX How to cite

Tengfei Wang, Chi Zhang, Xiaolin Zhang, Dawu Gu, Pei Cao. Optimized Hardware-Software Co-Design for Kyber and Dilithium on RISC-V SoC FPGA. (2024). IACR Transactions on Cryptographic Hardware and Embedded Systems, 2024(3), 99-135. https://doi.org/10.46586/tches.v2024.i3.99-135 Artifact available at https://artifacts.iacr.org/tches/2024/a18