Improving ChaCha20 by RISC-V Vector Extension: Design and Engineering Implementation
2026-06-09 , Poster Island B

ChaCha20 is a high-performance stream cipher widely deployed in TLS and SSH, typically combined with Poly1305 for authenticated encryption. This paper presents a practical vectorized implementation of ChaCha20 using the RISC-V Vector (RVV) extension, with complete engineering code in the Go ecosystem. We outline how ChaCha20's add--xor--rotate structure maps to RVV instructions and describe a fully vectorized design covering register allocation, rotation implementation, and 64-byte block processing. Experiments on a real RISC-V 64 platform (Spacemit X60) show up to 1.5X throughput improvement on large data blocks and a 35.58% geometric mean speedup over the generic Go implementation. The implementation is suitable for direct integration into open-source cryptographic stacks on RVV-enabled RISC-V platforms.


The paper is organized as follows: Section 2 reviews the ChaCha20 algorithm; Section 3 introduces the RVV extension and its key instructions for ChaCha20; Section 4 details the vectorized design and engineering implementation; Section 5 presents the experimental results and performance analysis; Section 6 discusses future work; Section 7 concludes the paper.

RISC-V Engineer, mainly focus on Go compiler/toolchains developement