Rework macros expressing dependencies

Fix usage with sed:

s/MBEDTLS_OR_PSA_WANT_\([A-Z_0-9]*\)/MBEDTLS_HAS_\1_VIA_LOWLEVEL_OR_PSA/
s/MBEDTLS_USE_PSA_WANT_\([A-Z_0-9]*\)/MBEDTLS_HAS_\1_VIA_MD_OR_PSA_BASED_ON_USE_PSA/

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/library/hash_info.c b/library/hash_info.c
index b45d1d2..f2a4ba0 100644
--- a/library/hash_info.c
+++ b/library/hash_info.c
@@ -21,7 +21,7 @@
  */
 
 #include "hash_info.h"
-#include "or_psa_helpers.h"
+#include "legacy_or_psa.h"
 
 typedef struct
 {
@@ -32,25 +32,25 @@
 } hash_entry;
 
 static const hash_entry hash_table[] = {
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_MD5)
+#if defined(MBEDTLS_HAS_ALG_MD5_VIA_LOWLEVEL_OR_PSA)
     { PSA_ALG_MD5, MBEDTLS_MD_MD5, 16, 64 },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_RIPEMD160)
+#if defined(MBEDTLS_HAS_ALG_RIPEMD160_VIA_LOWLEVEL_OR_PSA)
     { PSA_ALG_RIPEMD160, MBEDTLS_MD_RIPEMD160, 20, 64 },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_1)
+#if defined(MBEDTLS_HAS_ALG_SHA_1_VIA_LOWLEVEL_OR_PSA)
     { PSA_ALG_SHA_1, MBEDTLS_MD_SHA1, 20, 64 },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_224)
+#if defined(MBEDTLS_HAS_ALG_SHA_224_VIA_LOWLEVEL_OR_PSA)
     { PSA_ALG_SHA_224, MBEDTLS_MD_SHA224, 28, 64 },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_256)
+#if defined(MBEDTLS_HAS_ALG_SHA_256_VIA_LOWLEVEL_OR_PSA)
     { PSA_ALG_SHA_256, MBEDTLS_MD_SHA256, 32, 64 },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_384)
+#if defined(MBEDTLS_HAS_ALG_SHA_384_VIA_LOWLEVEL_OR_PSA)
     { PSA_ALG_SHA_384, MBEDTLS_MD_SHA384, 48, 128 },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_512)
+#if defined(MBEDTLS_HAS_ALG_SHA_512_VIA_LOWLEVEL_OR_PSA)
     { PSA_ALG_SHA_512, MBEDTLS_MD_SHA512, 64, 128 },
 #endif
     { PSA_ALG_NONE, MBEDTLS_MD_NONE, 0, 0 },
diff --git a/library/legacy_or_psa.h b/library/legacy_or_psa.h
new file mode 100644
index 0000000..184e139
--- /dev/null
+++ b/library/legacy_or_psa.h
@@ -0,0 +1,193 @@
+/**
+ *  Internal macros to express dependencies for code and tests
+ *  that may use either the legacy API or PSA in various builds.
+ *
+ *  Copyright The Mbed TLS Contributors
+ *  SPDX-License-Identifier: Apache-2.0
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License"); you may
+ *  not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/*
+ * These macros are for code that wants to use <crypto feature> and will do so
+ * using <legacy API> or PSA depending on <condition>, where:
+ * - <crypto feature> will generally be an algorithm (SHA-256, ECDH) but may
+ *   also be a key type (AES, RSA, EC) or domain parameters (elliptic curve);
+ * - <legacy API> will be either:
+ *      - low-level module API (aes.h, sha256.h), or
+ *      - an abstraction layer (md.h, cipher.h);
+ * - <condition> will be either:
+ *      - depending on what's available in the build, or
+ *      - depending on whether MBEDTLS_USE_PSA_CRYPTO is defined.
+ *
+ * Examples:
+ * - TLS 1.2 will compute hashes using either mbedtls_md_xxx() (and
+ *   mbedtls_sha256_xxx()) or psa_aead_xxx() depending on whether
+ *   MBEDTLS_USE_PSA_CRYPTO is defined;
+ * - RSA PKCS#1 v2.1 will, in the near future*, compute hashes (for padding)
+ *   using either `mbedtls_md()` if it's available, or `psa_hash_compute()`
+ *   otherwise;
+ * - PEM decoding of PEM-encrypted keys will, in the near future*, compute MD5
+ *   hashes using either `mbedtls_md5_xxx()` if it's available, or
+ *   `psa_hash_xxx()` otherwise.
+ * *See docs/architecture/psa-migration/strategy.md, section "Supporting
+ * builds with drivers without the software implementation", strategy for step
+ * 1 (libmbedcrypto except the RNG subsystem).
+ *
+ * Note: the macros are essential to express test dependencies. Inside code,
+ * we could instead just use the equivalent pre-processor condition, but
+ * that's not possible in test dependencies where we need a single macro.
+ * Hopefully, using these macros in code will also help with consistency.
+ *
+ * The naming scheme for these macros is:
+ *      MBEDTLS_HAS_feature_VIA_legacy_OR_PSA(_condition)
+ * where:
+ * - feature is expressed the same way as in PSA_WANT macros, for example:
+ *   KEY_TYPE_AES, ALG_SHA_256, ECC_SECP_R1_256;
+ * - legacy is either LOWLEVEL or the name of the layer: MD, CIPHER;
+ * - condition is ommitted if it's based on availability, else it's
+ *   BASED_ON_USE_PSA.
+ *
+ * Coming back to the examples above:
+ * - TLS 1.2 will determine if it can use SHA-256 using
+ *      MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+ *   for the purposes of negotiation, and in test dependencies;
+ * - RSA PKCS#1 v2.1 tests that used SHA-256 will depend on
+ *      MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA
+ * - PEM decoding code and its associated tests will depend on
+ *      MBEDTLS_HAS_ALG_MD5_VIA_LOWLEVEL_OR_PSA
+ *
+ * Note: every time it's possible to use, say SHA-256, via the MD API, then
+ * it's also possible to used it via the low-level API. So, code that wants to
+ * use SHA-256 via both APIs only needs to depend on the MD macro. Also, it
+ * just so happens that all the choosing which API to use based on
+ * MBEDTLS_USE_PSA_CRYPTO (X.509, TLS 1.2/shared), always uses the abstraction
+ * layer (sometimes in addition to the low-level API), so we don't need the
+ * MBEDTLS_HAS_feature_VIA_LOWLEVEL_OR_PSA_BASED_ON_USE_PSA macros.
+ * (PK, while obeying MBEDTLS_USE_PSA_CRYPTO, doesn't compute hashes itself,
+ * even less makes use of ciphers.)
+ *
+ * Note: the macros MBEDTLS_HAS_feature_VIA_LOWLEVEL_OR_PSA are the minimal
+ * condition for being able to use <feature> at all. As such, they should be
+ * used for guarding data about <feature>, such as OIDs or size. For example,
+ * OID values related to SHA-256 are only useful when SHA-256 can be used at
+ * least in some way.
+ */
+
+#ifndef MBEDTLS_OR_PSA_HELPERS_H
+#define MBEDTLS_OR_PSA_HELPERS_H
+
+#include "common.h"
+
+/*
+ * Hashes
+ */
+
+/* Hashes using low-level or PSA based on availability */
+#if defined(MBEDTLS_MD5_C) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_MD5) )
+#define MBEDTLS_HAS_ALG_MD5_VIA_LOWLEVEL_OR_PSA
+#endif
+#if defined(MBEDTLS_RIPEMD160_C) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_RIPEMD160) )
+#define MBEDTLS_HAS_ALG_RIPEMD160_VIA_LOWLEVEL_OR_PSA
+#endif
+#if defined(MBEDTLS_SHA1_C) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_1) )
+#define MBEDTLS_HAS_ALG_SHA_1_VIA_LOWLEVEL_OR_PSA
+#endif
+#if defined(MBEDTLS_SHA224_C) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_224) )
+#define MBEDTLS_HAS_ALG_SHA_224_VIA_LOWLEVEL_OR_PSA
+#endif
+#if defined(MBEDTLS_SHA256_C) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_256) )
+#define MBEDTLS_HAS_ALG_SHA_256_VIA_LOWLEVEL_OR_PSA
+#endif
+#if defined(MBEDTLS_SHA384_C) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_384) )
+#define MBEDTLS_HAS_ALG_SHA_384_VIA_LOWLEVEL_OR_PSA
+#endif
+#if defined(MBEDTLS_SHA512_C) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_512) )
+#define MBEDTLS_HAS_ALG_SHA_512_VIA_LOWLEVEL_OR_PSA
+#endif
+
+/* Hashes using MD or PSA based on availability */
+#if ( defined(MBEDTLS_MD_C) && defined(MBEDTLS_MD5_C) ) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_MD5) )
+#define MBEDTLS_HAS_ALG_MD5_VIA_MD_OR_PSA
+#endif
+#if ( defined(MBEDTLS_MD_C) && defined(MBEDTLS_RIPEMD160_C) ) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_RIPEMD160) )
+#define MBEDTLS_HAS_ALG_RIPEMD160_VIA_MD_OR_PSA
+#endif
+#if ( defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA1_C) ) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_1) )
+#define MBEDTLS_HAS_ALG_SHA_1_VIA_MD_OR_PSA
+#endif
+#if ( defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA224_C) ) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_224) )
+#define MBEDTLS_HAS_ALG_SHA_224_VIA_MD_OR_PSA
+#endif
+#if ( defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA256_C) ) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_256) )
+#define MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA
+#endif
+#if ( defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA384_C) ) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_384) )
+#define MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA
+#endif
+#if ( defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA512_C) ) || \
+    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_512) )
+#define MBEDTLS_HAS_ALG_SHA_512_VIA_MD_OR_PSA
+#endif
+
+/* Hashes using MD or PSA based on MBEDTLS_USE_PSA_CRYPTO */
+#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && \
+        defined(MBEDTLS_MD_C) && defined(MBEDTLS_MD5_C) ) || \
+    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_MD5) )
+#define MBEDTLS_HAS_ALG_MD5_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+#endif
+#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && \
+        defined(MBEDTLS_MD_C) && defined(MBEDTLS_RIPEMD160_C) ) || \
+    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_RIPEMD160) )
+#define MBEDTLS_HAS_ALG_RIPEMD160_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+#endif
+#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && \
+        defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA1_C) ) || \
+    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_1) )
+#define MBEDTLS_HAS_ALG_SHA_1_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+#endif
+#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && \
+        defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA224_C) ) || \
+    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_224) )
+#define MBEDTLS_HAS_ALG_SHA_224_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+#endif
+#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && \
+        defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA256_C) ) || \
+    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_256) )
+#define MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+#endif
+#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && \
+        defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA384_C) ) || \
+    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_384) )
+#define MBEDTLS_HAS_ALG_SHA_384_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+#endif
+#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && \
+        defined(MBEDTLS_MD_C) && defined(MBEDTLS_SHA512_C) ) || \
+    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_512) )
+#define MBEDTLS_HAS_ALG_SHA_512_VIA_MD_OR_PSA_BASED_ON_USE_PSA
+#endif
+
+#endif /* MBEDTLS_OR_PSA_HELPERS_H */
diff --git a/library/oid.c b/library/oid.c
index aba256b..9c3b429 100644
--- a/library/oid.c
+++ b/library/oid.c
@@ -27,7 +27,7 @@
 #include "mbedtls/rsa.h"
 #include "mbedtls/error.h"
 
-#include "or_psa_helpers.h"
+#include "legacy_or_psa.h"
 
 #include <stdio.h>
 #include <string.h>
@@ -598,43 +598,43 @@
 
 static const oid_md_alg_t oid_md_alg[] =
 {
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_MD5)
+#if defined(MBEDTLS_HAS_ALG_MD5_VIA_LOWLEVEL_OR_PSA)
     {
         OID_DESCRIPTOR( MBEDTLS_OID_DIGEST_ALG_MD5,       "id-md5",       "MD5" ),
         MBEDTLS_MD_MD5,
     },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_1)
+#if defined(MBEDTLS_HAS_ALG_SHA_1_VIA_LOWLEVEL_OR_PSA)
     {
         OID_DESCRIPTOR( MBEDTLS_OID_DIGEST_ALG_SHA1,      "id-sha1",      "SHA-1" ),
         MBEDTLS_MD_SHA1,
     },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_224)
+#if defined(MBEDTLS_HAS_ALG_SHA_224_VIA_LOWLEVEL_OR_PSA)
     {
         OID_DESCRIPTOR( MBEDTLS_OID_DIGEST_ALG_SHA224,    "id-sha224",    "SHA-224" ),
         MBEDTLS_MD_SHA224,
     },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_256)
+#if defined(MBEDTLS_HAS_ALG_SHA_256_VIA_LOWLEVEL_OR_PSA)
     {
         OID_DESCRIPTOR( MBEDTLS_OID_DIGEST_ALG_SHA256,    "id-sha256",    "SHA-256" ),
         MBEDTLS_MD_SHA256,
     },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_384)
+#if defined(MBEDTLS_HAS_ALG_SHA_384_VIA_LOWLEVEL_OR_PSA)
     {
         OID_DESCRIPTOR( MBEDTLS_OID_DIGEST_ALG_SHA384,    "id-sha384",    "SHA-384" ),
         MBEDTLS_MD_SHA384,
     },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_SHA_512)
+#if defined(MBEDTLS_HAS_ALG_SHA_512_VIA_LOWLEVEL_OR_PSA)
     {
         OID_DESCRIPTOR( MBEDTLS_OID_DIGEST_ALG_SHA512,    "id-sha512",    "SHA-512" ),
         MBEDTLS_MD_SHA512,
     },
 #endif
-#if defined(MBEDTLS_OR_PSA_WANT_ALG_RIPEMD160)
+#if defined(MBEDTLS_HAS_ALG_RIPEMD160_VIA_LOWLEVEL_OR_PSA)
     {
      OID_DESCRIPTOR( MBEDTLS_OID_DIGEST_ALG_RIPEMD160, "id-ripemd160", "RIPEMD-160" ),
         MBEDTLS_MD_RIPEMD160,
diff --git a/library/or_psa_helpers.h b/library/or_psa_helpers.h
deleted file mode 100644
index 105449f..0000000
--- a/library/or_psa_helpers.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- *  Internal macros for parts of the code that depend on an algorithm being
- *  available either via the legacy API or the PSA Crypto API.
- *
- *  Copyright The Mbed TLS Contributors
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-#ifndef MBEDTLS_OR_PSA_HELPERS_H
-#define MBEDTLS_OR_PSA_HELPERS_H
-
-#include "common.h"
-
-/* Hash algorithms */
-#if defined(MBEDTLS_MD5_C) || \
-    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_MD5) )
-#define MBEDTLS_OR_PSA_WANT_ALG_MD5
-#endif
-#if defined(MBEDTLS_RIPEMD160_C) || \
-    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_RIPEMD160) )
-#define MBEDTLS_OR_PSA_WANT_ALG_RIPEMD160
-#endif
-#if defined(MBEDTLS_SHA1_C) || \
-    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_1) )
-#define MBEDTLS_OR_PSA_WANT_ALG_SHA_1
-#endif
-#if defined(MBEDTLS_SHA224_C) || \
-    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_224) )
-#define MBEDTLS_OR_PSA_WANT_ALG_SHA_224
-#endif
-#if defined(MBEDTLS_SHA256_C) || \
-    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_256) )
-#define MBEDTLS_OR_PSA_WANT_ALG_SHA_256
-#endif
-#if defined(MBEDTLS_SHA384_C) || \
-    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_384) )
-#define MBEDTLS_OR_PSA_WANT_ALG_SHA_384
-#endif
-#if defined(MBEDTLS_SHA512_C) || \
-    ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_512) )
-#define MBEDTLS_OR_PSA_WANT_ALG_SHA_512
-#endif
-
-#endif /* MBEDTLS_OR_PSA_HELPERS_H */
diff --git a/library/use_psa_helpers.h b/library/use_psa_helpers.h
deleted file mode 100644
index 4f990a8..0000000
--- a/library/use_psa_helpers.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- *  Internal macros for parts of the code governed by MBEDTLS_USE_PSA_CRYPTO.
- *  Some macros allow checking if an algorithm is available, either via the
- *  legacy API or the PSA Crypto API, depending on MBEDTLS_USE_PSA_CRYPTO;
- *  when possible, they're named after the corresponding PSA_WANT_ macro.
- *  Other macros provide max sizes or similar information in a USE_PSA-aware
- *  way; they're name after a similar constant from the legacy API or PSA.
- *
- *  Copyright The Mbed TLS Contributors
- *  SPDX-License-Identifier: Apache-2.0
- *
- *  Licensed under the Apache License, Version 2.0 (the "License"); you may
- *  not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *  http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-#ifndef MBEDTLS_USE_PSA_HELPERS_H
-#define MBEDTLS_USE_PSA_HELPERS_H
-
-#include "common.h"
-
-/* Hash algorithms */
-#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_MD5_C) ) || \
-    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_MD5) )
-#define MBEDTLS_USE_PSA_WANT_ALG_MD5
-#endif
-#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_RIPEMD160_C) ) || \
-    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_RIPEMD160) )
-#define MBEDTLS_USE_PSA_WANT_ALG_RIPEMD160
-#endif
-#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SHA1_C) ) || \
-    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_1) )
-#define MBEDTLS_USE_PSA_WANT_ALG_SHA_1
-#endif
-#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SHA224_C) ) || \
-    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_224) )
-#define MBEDTLS_USE_PSA_WANT_ALG_SHA_224
-#endif
-#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SHA256_C) ) || \
-    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_256) )
-#define MBEDTLS_USE_PSA_WANT_ALG_SHA_256
-#endif
-#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SHA384_C) ) || \
-    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_384) )
-#define MBEDTLS_USE_PSA_WANT_ALG_SHA_384
-#endif
-#if ( !defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_SHA512_C) ) || \
-    ( defined(MBEDTLS_USE_PSA_CRYPTO) && defined(PSA_WANT_ALG_SHA_512) )
-#define MBEDTLS_USE_PSA_WANT_ALG_SHA_512
-#endif
-
-#endif /* MBEDTLS_USE_PSA_HELPERS_H */