Home GnuPG

Add GHASH RISC-V Zbb+Zbc implementation

Description

Add GHASH RISC-V Zbb+Zbc implementation

* cipher/Makefile.am: Add 'cipher-gcm-riscv-zbb-zbc.c'.
* cipher/cipher-gcm-riscv-zbb-zbc.c: New.
* cipher/cipher-gcm.c [GCM_USE_RISCV_ZBB_ZBC]
(_gcry_ghash_setup_riscv_zbb_zbc, _gcry_ghash_riscv_zbb_zbc): New.
(setupM) [GCM_USE_RISCV_ZBB_ZBC]: Check for HWF_RISCV_IMAFDC,
HWF_RISCV_ZBB and HWF_RISCV_ZBC to enable RISC-V Zbb+Zbc implementation.
* cipher/cipher-internal.h (GCM_USE_RISCV_ZBB_ZBC): New.
* configure.ac: Add 'cipher-gcm-riscv-zbb-zbc.lo'.

Patch adds RISC-V Zbb+Zbc extension accelerated GHASH implementation.

Benchmark on SpacemiT K1 (1600 Mhz):

Before:

|  nanosecs/byte   mebibytes/sec   cycles/byte

GMAC_AES | 14.32 ns/B 66.60 MiB/s 22.91 c/B

After (19x faster):

|  nanosecs/byte   mebibytes/sec   cycles/byte

GMAC_AES | 0.744 ns/B 1281 MiB/s 1.19 c/B

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Jan 1 2025, 12:12 PM
Parents
rCb24ebd616304: Add RISC-V vector permute AES
Branches
Unknown
Tags
Unknown