openssl/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
..
aes aes/asm/bsaes-armv7.pl: Replace adrl with add 2023-03-15 08:22:51 +11:00
aria
asn1 Improve the performance of d2i_AutoPrivateKey and friends 2023-03-15 08:39:25 +11:00
async
bf Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
bio bss_dgram.c: Use BIO_ADDR_sockaddr() and BIO_ADDR_sockaddr_size() 2023-03-07 15:24:54 +01:00
bn Add missing copyright header 2023-03-15 08:11:53 +11:00
buffer
camellia
cast Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
chacha Fix big-endian issue in chacha20 SVE implementation on aarch64 2023-01-16 17:03:34 +01:00
cmac
cmp OSSL_CMP_certConf_cb(): fix regression on checking newly enrolled cert 2023-02-13 11:56:10 +01:00
cms Fix size_t/int mismatch in cms_ec.c and rsa_sig.c 2023-03-15 08:24:42 +11:00
comp
conf
crmf Compensate for CMP-related TODOs removed by PR #15539 2022-12-07 21:57:36 +01:00
ct
des Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
dh S390x: Support ME and CRT offloading 2023-02-08 16:53:12 +01:00
dsa Coverity 1521557: Error handling issues 2023-03-03 10:10:22 +11:00
dso
ec Fix potential infinite loops in ECDSA signing. 2023-03-01 09:20:49 +11:00
encode_decode
engine
err Add option to FIPS module to enforce EMS check during KDF TLS1_PRF. 2023-03-07 18:24:45 +01:00
ess
evp Add a flag so finalised contexts are not reused 2023-03-15 08:42:59 +11:00
ffc Fix FFC mdprop setting bugs. 2023-03-01 09:36:49 +11:00
hmac
hpke prevent HPKE sender setting seq unwisely 2022-12-08 10:59:03 +01:00
http Fixes #20278: Fixed double free bug in crypto/http/http_client.c 2023-02-23 20:07:35 +11:00
idea Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
kdf
lhash
md2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
md4 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
md5 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
mdc2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
modes riscv: Clean up extension test macros 2023-03-16 13:12:19 +11:00
objects Allow OBJ_create() to create an OBJ and NID with a NULL OID 2022-12-13 15:40:16 +01:00
ocsp Fix incomplete check on X509V3_add1_i2d() 2023-01-31 11:05:51 +11:00
pem Avoid dangling ptrs in header and data params for PEM_read_bio_ex 2023-02-07 17:05:10 +01:00
perlasm Restrict the Arm 'LDR REG, =VALUE' pseudo instruction on Neon, to appease clang 2023-02-08 09:30:08 -05:00
pkcs7 Support signedAndEnveloped content in PKCS7_decrypt() 2023-02-07 17:05:10 +01:00
pkcs12 Fix PKCS12_newpass() to work with PBES2. 2023-03-15 08:49:03 +11:00
poly1305
property Only call OPENSSL_init_crypto on fetch if using the default libctx 2023-02-22 10:03:14 +11:00
rand
rc2 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
rc4 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
rc5 Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
ripemd Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
rsa Remove ossl_rsa_pss_params_30_set_maskgenalg(). 2023-03-01 20:04:10 +11:00
seed Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
sha
siphash
sm2
sm3
sm4 Fix SM4-XTS build failure on Mac mini M1 2023-02-06 12:36:07 +01:00
srp
stack
store
thread VMS knows POSIX threads too! 2023-03-06 12:18:43 +01:00
ts
txt_db
ui
whrlpool Avoid duplicating symbols in legacy.a with some build options 2023-01-31 11:10:22 +11:00
x509 doc/man3/X509_STORE_CTX_get_error.pod: make order consistent, add some missing entries 2023-03-15 08:32:18 +11:00
alphacpuid.pl
arm64cpuid.pl
arm_arch.h Apply aes-gcm unroll8+eor3 optimization patch to Neoverse V2 2023-02-08 16:54:57 +01:00
armcap.c Tidy up aarch64 feature detection code in armcap.c 2023-03-03 10:28:17 +11:00
armv4cpuid.pl
asn1_dsa.c
bsearch.c
build.info Use of sparse_array.c only in the shared libssl 2023-02-14 16:01:19 +01:00
c64xpluscpuid.pl
context.c Add functions supporting thread pool only when it is enabled 2022-11-22 17:08:23 +01:00
core_algorithm.c
core_fetch.c
core_namemap.c
cpt_err.c
cpuid.c
cryptlib.c
ctype.c Fixed typos in documentation and comments 2023-01-04 12:53:05 +01:00
cversion.c
der_writer.c
deterministic_nonce.c Address coverity issue CID 1517105 2022-12-16 18:57:42 +01:00
dllmain.c
ebcdic.c
ex_data.c
getenv.c
ia64cpuid.S
info.c info.c: Fix typos in seed macro name and description string 2023-01-10 12:15:42 +01:00
init.c
initthread.c
loongarch64cpuid.pl
loongarch_arch.h
loongarchcap.c
LPdir_nyi.c
LPdir_unix.c
LPdir_vms.c
LPdir_win32.c
LPdir_win.c
LPdir_wince.c
mem_clr.c
mem_sec.c Do not check definition of a macro and use it in a single condition 2023-01-12 10:46:52 +01:00
mem.c
mips_arch.h
o_dir.c
o_fopen.c
o_init.c
o_str.c
o_time.c
packet.c Rationalize FIPS sources 2023-02-08 16:20:55 +01:00
param_build_set.c
param_build.c OSSL_PARAM_BLD and BIGNUM; ensure at least one byte is allocated 2023-01-11 23:38:13 +01:00
params_dup.c
params_from_text.c
params.c In OSSL_PARAM_set_BN(), make sure that the data_size field is at least 1 2023-01-11 23:38:13 +01:00
pariscid.pl
passphrase.c
ppccap.c
ppccpuid.pl
provider_child.c Fix a potential memory leak in crypto/provider_child.c 2023-02-01 08:20:08 +11:00
provider_conf.c
provider_core.c Implement OSSL_PROVIDER_get0_default_search_path, add docs and tests. 2022-12-06 18:24:06 +01:00
provider_local.h
provider_predefined.c
provider.c
punycode.c Add more punycode tests and remove ossl_a2ucompare() 2023-02-08 16:17:37 +01:00
quic_vlint.c QUIC: Enable building with QUIC support disabled 2023-01-13 13:20:16 +00:00
README-sparse_array.md
riscv32cpuid.pl
riscv64cpuid.pl
riscvcap.c
s390x_arch.h S390X: Accelerate keccak XOF 2023-03-07 18:21:51 +01:00
s390xcap.c S390x: Support ME and CRT offloading 2023-02-08 16:53:12 +01:00
s390xcpuid.pl
self_test_core.c
sleep.c
sparccpuid.S
sparcv9cap.c
sparse_array.c
threads_lib.c
threads_none.c
threads_pthread.c
threads_win.c
time.c
trace.c add OSSL_TRACE_STRING(), OSSL_TRACE_STRING_MAX, and OSSL_trace_string() 2023-01-26 09:16:51 +01:00
uid.c
vms_rms.h
x86_64cpuid.pl
x86cpuid.pl