JOURNAL ARTICLE

Design and Implementation of a Compiler Supporting RISC-V Custom Cryptographic and Vector Instructions

Abstract

Post-quantum cryptographic algorithms capable of resisting quantum computing attacks have received increasing attention in recent years, especially lattice-based cryptographic algorithms have become mainstream. Since their specialization and complex computation, the cryptographic computation is inefficient on general-purpose processors. In order to improve the performance of the processor in post-quantum cryptography computing, we have extended a set of cryptographic and vector instruction sets for the CRYSTALS-Kyber algorithm, and implemented support for custom cryptographic and vector instructions based on the open-source toolchain. These efforts can realize the compilation and disassembly of the CRYSTALS-Kyber encryption/decryption algorithm programs, and optimized the performance of the compilation. This paper mainly introduces how to design an extended instruction set based on the target algorithm and enable the compiler to support these instructions. Compared to the situation before extending custom instructions, the total number of instructions for key generation, encryption, and decryption assembly programs has decreased by 3651 times, and the total number of execution cycles has decreased by 2195 times.

Keywords:
Computer science Cryptography Compiler Cryptographic primitive Encryption Instruction set Parallel computing Computation Cryptographic protocol Programming language Algorithm Operating system

Metrics

3
Cited By
0.77
FWCI (Field Weighted Citation Impact)
9
Refs
0.74
Citation Normalized Percentile
Is in top 1%
Is in top 10%

Citation History

Topics

Cryptographic Implementations and Security
Physical Sciences →  Computer Science →  Artificial Intelligence
Coding theory and cryptography
Physical Sciences →  Computer Science →  Artificial Intelligence
Cryptography and Data Security
Physical Sciences →  Computer Science →  Artificial Intelligence
© 2026 ScienceGate Book Chapters — All rights reserved.