openssl/providers/implementations
Christoph Müllner 86c69fe841 riscv: Clean up extension test macros
In RISC-V we have multiple extensions, that can be
used to accelerate processing.
The known extensions are defined in riscv_arch.def.
From that file test functions of the following
form are generated: RISCV_HAS_$ext().

In recent commits new ways to define the availability
of these test macros have been defined. E.g.:
  #define RV32I_ZKND_ZKNE_CAPABLE   \
          (RISCV_HAS_ZKND() && RISCV_HAS_ZKNE())
  [...]
  #define RV64I_ZKND_ZKNE_CAPABLE   \
          (RISCV_HAS_ZKND() && RISCV_HAS_ZKNE())

This leaves us with two different APIs to test capabilities.
Further, creating the same macros for RV32 and RV64 results
in duplicated code (see example above).

This inconsistent situation makes it hard to integrate
further code. So let's clean this up with the following steps:
* Replace RV32I_* and RV64I_* macros by RICSV_HAS_* macros
* Move all test macros into riscv_arch.h
* Use "AND" and "OR" to combine tests with more than one extension
* Rename include files for accelerated processing (remove extension
  postfix).

We end up with compile time tests for RV32/RV64 and run-time tests
for available extensions. Adding new routines (e.g. for vector crypto
instructions) should be straightforward.

Testing showed no regressions.

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)
2023-03-16 13:12:19 +11:00
..
asymciphers rsa: Add option to disable implicit rejection 2022-12-12 11:30:52 +01:00
ciphers riscv: Clean up extension test macros 2023-03-16 13:12:19 +11:00
digests S390X: Accelerate keccak XOF 2023-03-07 18:21:51 +01:00
encode_decode Do not create DSA keys without parameters by decoder 2023-02-07 17:05:10 +01:00
exchange Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
include/prov Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
kdfs Add option to FIPS module to enforce EMS check during KDF TLS1_PRF. 2023-03-07 18:24:45 +01:00
kem Implements Hybrid Public Key Encryption (HPKE) as per RFC9180. 2022-11-25 16:26:55 +00:00
keymgmt Updated rsa_has() for correct validation 2023-03-15 08:28:39 +11:00
macs Rationalize FIPS sources 2023-02-08 16:20:55 +01:00
rands Segmentation fault in parent rng cleanup 2023-03-15 08:30:41 +11:00
signature Fix size_t/int mismatch in cms_ec.c and rsa_sig.c 2023-03-15 08:24:42 +11:00
storemgmt Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
build.info Add KEM (Key encapsulation mechanism) support to providers 2020-09-19 18:08:46 +10:00