openssl/include/crypto
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
..
__DECC_INCLUDE_EPILOGUE.H
__DECC_INCLUDE_PROLOGUE.H
aes_platform.h riscv: Clean up extension test macros 2023-03-16 13:12:19 +11:00
aria.h Add ossl_aria symbols 2021-03-18 17:52:37 +10:00
asn1_dsa.h Add ossl_encode symbols 2021-03-18 17:52:37 +10:00
asn1.h libcrypto and test: rename asn1_string_to_time_t to ossl_asn1_string_to_time_t 2022-07-19 08:44:19 +02:00
asn1err.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
async.h Update copyright year 2021-02-18 15:05:17 +00:00
asyncerr.h Update copyright year 2021-06-17 13:24:59 +01:00
bioerr.h BIO_dgram support for BIO_sendmmsg/BIO_recvmmsg 2022-09-01 18:03:10 +10:00
bn_conf.h.in Update copyright year 2021-02-18 15:05:17 +00:00
bn_dh.h Update copyright year 2021-03-11 13:27:36 +00:00
bn_srp.h Update copyright year 2021-04-08 13:04:41 +01:00
bn.h S390x: Support ME and CRT offloading 2023-02-08 16:53:12 +01:00
bnerr.h RSA keygen update: Raise an error if no prime candidate q is found. 2022-06-13 10:56:31 +02:00
buffererr.h Update copyright year 2021-06-17 13:24:59 +01:00
chacha.h Update copyright year 2021-02-18 15:05:17 +00:00
cmll_platform.h Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
cmperr.h CMP+CRMF: fix formatting nits in crypto/, include/, and test/ 2022-11-24 13:45:06 +01:00
cmserr.h CMS sign digest 2022-04-02 10:42:16 -04:00
comperr.h Update copyright year 2021-06-17 13:24:59 +01:00
conferr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
context.h Release the drbg in the global default context before engines 2022-11-02 11:01:20 +01:00
crmferr.h Update copyright year 2021-06-17 13:24:59 +01:00
cryptlib.h Fix a memleak in the FIPS provider 2021-05-24 09:39:15 +10:00
cryptoerr.h err: add additional errors 2022-01-12 20:10:21 +11:00
cterr.h Update copyright year 2021-06-17 13:24:59 +01:00
ctype.h tolower: refine the tolower code to avoid a memory access 2022-05-23 09:51:28 +10:00
decoder.h Remove the _fetch_by_number functions 2022-05-06 10:38:55 +10:00
decodererr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
des_platform.h Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
dh.h Update copyright year 2022-05-03 13:34:51 +01:00
dherr.h Stop raising ERR_R_MALLOC_FAILURE in most places 2022-10-05 14:02:03 +02:00
dsa.h Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
dsaerr.h Fix infinite loops in DSA sign code. 2023-03-01 09:20:49 +11:00
dso_conf.h.in Update copyright year 2021-02-18 15:05:17 +00:00
ec.h Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
ecerr.h Fix potential infinite loops in ECDSA signing. 2023-03-01 09:20:49 +11:00
ecx.h Support all five EdDSA instances from RFC 8032 2023-01-13 07:09:09 +00:00
encoder.h Remove the _fetch_by_number functions 2022-05-06 10:38:55 +10:00
encodererr.h Update copyright year 2021-06-17 13:24:59 +01:00
engine.h
engineerr.h Update copyright year 2021-06-17 13:24:59 +01:00
err.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
ess.h TS ESS: Move four internal aux function to where they belong in crypto/ts 2021-04-28 14:10:47 +02:00
esserr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
evp.h Add a flag so finalised contexts are not reused 2023-03-15 08:42:59 +11:00
evperr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
httperr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
lhash.h Add ossl_lhash symbols 2021-03-18 17:52:38 +10:00
md32_common.h Add ROTATE inline asm support for SM3 2022-06-22 12:46:50 +02:00
modes.h providers: Add SM4 XTS implementation 2022-11-29 16:17:30 +01:00
objects.h Update copyright year 2021-04-08 13:04:41 +01:00
objectserr.h Update copyright year 2021-06-17 13:24:59 +01:00
ocsperr.h Update copyright year 2021-06-17 13:24:59 +01:00
pem.h Fix copyrights 2022-02-03 13:56:38 +01:00
pemerr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
pkcs7.h Add library context and property query support into the PKCS12 API 2021-04-30 09:15:50 +10:00
pkcs7err.h Update copyright year 2021-06-17 13:24:59 +01:00
pkcs12err.h Allow PKCS12 export to set arbitrary bag attributes 2022-09-23 17:40:02 +01:00
poly1305.h Update copyright year 2021-02-18 15:05:17 +00:00
ppc_arch.h Update copyright year 2022-05-03 13:34:51 +01:00
punycode.h Add more punycode tests and remove ossl_a2ucompare() 2023-02-08 16:17:37 +01:00
rand_pool.h Add ossl_rand symbols 2021-03-18 17:52:37 +10:00
rand.h Pre-declare all core dispatch table functions, and fix the internal ones 2022-07-13 07:56:51 +02:00
randerr.h Update copyright year 2021-06-17 13:24:59 +01:00
riscv_arch.def Add riscv scalar crypto extension capability 2022-06-10 11:45:41 +02:00
riscv_arch.h riscv: Clean up extension test macros 2023-03-16 13:12:19 +11:00
rsa.h Remove ossl_rsa_pss_params_30_set_maskgenalg(). 2023-03-01 20:04:10 +11:00
rsaerr.h errors: update error message (to be squashed) 2021-05-27 13:01:50 +10:00
security_bits.h Fix misc external ossl_ symbols. 2021-03-18 17:52:37 +10:00
sha.h Crypto: Add deprecation compatibility declarations for SHA* message digest functions 2021-05-08 14:41:36 +02:00
siphash.h Fix a TODO(3.0) in the siphash code 2021-03-17 10:16:21 +10:00
siv.h Update copyright year 2021-04-08 13:04:41 +01:00
sm2.h Correctly calculate the length of SM2 plaintext given the ciphertext 2021-08-24 14:22:07 +01:00
sm2err.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
sm4_platform.h SM4 AESE optimization for ARMv8 2023-02-02 10:16:47 +11:00
sm4.h Add ossl_ symbols for sm3 and sm4 2021-03-18 17:52:37 +10:00
sparc_arch.h Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
sparse_array.h Add ossl_sa symbols 2021-03-18 17:52:37 +10:00
store.h Add method store cache flush and method removal to non-EVP operations 2022-05-05 15:06:12 +02:00
storeerr.h err: rename err_load_xxx_strings_int functions 2021-05-26 13:01:47 +10:00
tserr.h Update copyright year 2021-06-17 13:24:59 +01:00
types.h Internaly declare the DSA type for no-deprecated builds 2023-02-08 08:50:31 +01:00
uierr.h Update copyright year 2021-06-17 13:24:59 +01:00
x509.h Do not create DSA keys without parameters by decoder 2023-02-07 17:05:10 +01:00
x509err.h x509_att.c: improve error checking and reporting and coding style 2022-08-24 11:25:04 +02:00
x509v3err.h Update copyright year 2021-06-17 13:24:59 +01:00