riscv: GCM: Implement GHASH()
authorChristoph Müllner <christoph.muellner@vrull.eu>
Wed, 18 Jan 2023 11:11:53 +0000 (12:11 +0100)
committerPauli <pauli@openssl.org>
Thu, 16 Mar 2023 02:12:19 +0000 (13:12 +1100)
commitf3fed0d5fc11a3406951884b9739a93639697a56
tree54e9716ed64d9e7285dc18f19553552db0dbb01a
parentb24684369b76df8b226fe9aa95fca2bccfc6a175
riscv: GCM: Implement GHASH()

RISC-V currently only offers a GMULT() callback for accelerated
processing. Let's implement the missing piece to have GHASH()
available as well. Like GMULT(), we provide a variant for
systems with the Zbkb extension (including brev8).

The integration follows the existing pattern for GMULT()
in RISC-V. We keep the C implementation as we need to decide
if we can call an optimized routine at run-time.
The C implementation is the fall-back in case we don't have
any extensions available that can be used to accelerate
the calculation.

Tested with all combinations of possible extensions
on QEMU (limiting the available instructions accordingly).
No regressions observed.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20078)
crypto/modes/asm/ghash-riscv64.pl
crypto/modes/gcm128.c