openssl/providers
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
..
common Add option to FIPS module to enforce EMS check during KDF TLS1_PRF. 2023-03-07 18:24:45 +01:00
fips fips: Use salt >= 16 bytes in PBKDF2 selftest 2023-03-07 18:28:54 +01:00
implementations riscv: Clean up extension test macros 2023-03-16 13:12:19 +11:00
baseprov.c Cleanup : directly include of internal/nelem.h when required. 2022-11-23 18:08:25 +01:00
build.info Add VERSIONINFO resource to legacy provider if it is not builtin 2022-06-02 11:09:10 -04:00
decoders.inc Support decode SM2 parameters 2022-08-23 11:08:11 +10:00
defltprov.c Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
encoders.inc ENCODER PROV: Add encoders with EncryptedPrivateKeyInfo output 2021-09-05 21:34:51 +02:00
fips-sources.checksums Rationalize FIPS sources 2023-02-08 16:20:55 +01:00
fips.checksum Rationalize FIPS sources 2023-02-08 16:20:55 +01:00
fips.module.sources Rationalize FIPS sources 2023-02-08 16:20:55 +01:00
legacyprov.c Fix regression in default key length for Blowfish CFB and OFB ciphers 2022-05-23 08:50:42 +02:00
nullprov.c null prov: fix gettable param array type. 2020-10-16 10:33:38 +10:00
prov_running.c keygen: add FIPS error state management to conditional self tests 2020-09-12 16:46:51 +10:00
stores.inc Add support for loading root CAs from Windows crypto API 2022-09-14 14:10:18 +01:00