Home GnuPG

Add RISC-V vector cryptography implementation of GHASH

Description

Add RISC-V vector cryptography implementation of GHASH

* cipher/Makefile.am: Add 'cipher-gcm-riscv-zvkg.c'.
* cipher/cipher-gcm-riscv-zbb-zbc.c: Fix cipher-internal.h include.
* cipher/cipher-gcm-riscv-zvkg.c: New.
* cipher/cipher-gcm.c [GCM_USE_RISCV_ZVKG] (_gcry_ghash_setup_riscv_zvkg)
(_gcry_ghash_riscv_zvkg, _gcry_polyval_riscv_zvkg): New.
(setupM) [GCM_USE_RISCV_ZVKG]: Add setup for Zvkg implementation.
* cipher/cipher-internal.h (GCM_USE_RISCV_ZVKG): New.
* configure.ac: Add 'cipher-gcm-riscv-zvkg.lo'.
(GCRY_RISCV_VECTOR_CRYPTO_INTRINSICS_TEST): Add check for Zvkg instrinsic.
* src/g10lib.h (HWF_RISCV_ZVKG): Insert before HWF_RISCV_ZVKNED.
* src/hwdf-riscv.h (HWF_RISCV_HWPROBE_EXT_ZVKG): New.
(hwprobe_features): Add HWF_RISCV_ZVKG.
* src/hwfeatures.c (hwflist) [HAVE_CPU_ARCH_RISCV]: Add "riscv-zvkg".

Implementation has been tested against QEMU emulator as there is no
actual HW available with these instructions yet.

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

Details

Provenance
jukiviliAuthored on Fri, Aug 8, 6:44 PM
Parents
rC85927387741f: mpi: Fix redefinition of types.
Branches
Unknown
Tags
Unknown