Skip to content

UPSTREAM PR #30787: RISC-V: Port dot-asm ChaCha20 assembly implementation with rv64gc and zbb#685

Open
loci-dev wants to merge 1 commit into
mainfrom
loci/pr-30787-riscv64-chacha20
Open

UPSTREAM PR #30787: RISC-V: Port dot-asm ChaCha20 assembly implementation with rv64gc and zbb#685
loci-dev wants to merge 1 commit into
mainfrom
loci/pr-30787-riscv64-chacha20

Conversation

@loci-dev
Copy link
Copy Markdown

Note

Source pull request: openssl/openssl#30787

Current OpenSSL's RISC-V ChaCha20 only has vector implementation and C fallback. I ported dot-asm/cryptogams chacha-riscv.pl to provide an assembly implementation with rv64gc and Zbb.

Removed vector part since we already have a mix of scalar ALU and vector ALU implementation in OpenSSL.

Benchmark result:

Implementation 16 bytes 64 bytes 256 bytes 1024 bytes 8192 bytes 16384 bytes
C + 64gc 45115.42k 72483.46k 79416.58k 81696.77k 82389.67k 82367.83k
ASM + 64gc 54152.23k 97591.68k 111571.46k 115686.74k 116965.38k 116943.53k
ASM + Zbb 64986.74k 140371.84k 170241.88k 181301.59k 184866.13k 184964.44k
C + 64gc 100% 100% 100% 100% 100% 100%
ASM + 64gc 120.03% 134.64% 140.49% 141.60% 141.96% 141.98%
ASM + Zbb 144.05% 193.65% 214.36% 221.93% 224.38% 224.57%

… Zbb

Current OpenSSL's RISC-V ChaCha20 only has vector implementation and C fallback. So we port dot-asm/cryptogams chacha-riscv.pl to provide assembly implementation with rv64gc and Zbb.

Signed-off-by: Julian Zhu <julian.oerv@isrc.iscas.ac.cn>
@loci-dev loci-dev force-pushed the main branch 2 times, most recently from 421b135 to 770bf14 Compare April 28, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants