blob: 105449f6a432b9e8d710b0ce3a5133553e068b42 [file] [log] [blame]
Manuel Pégourié-Gonnardf88b1b52022-07-15 11:05:05 +02001/**
2 * Internal macros for parts of the code that depend on an algorithm being
3 * available either via the legacy API or the PSA Crypto API.
4 *
5 * Copyright The Mbed TLS Contributors
6 * SPDX-License-Identifier: Apache-2.0
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License"); you may
9 * not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21#ifndef MBEDTLS_OR_PSA_HELPERS_H
22#define MBEDTLS_OR_PSA_HELPERS_H
23
24#include "common.h"
25
26/* Hash algorithms */
27#if defined(MBEDTLS_MD5_C) || \
28 ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_MD5) )
29#define MBEDTLS_OR_PSA_WANT_ALG_MD5
30#endif
31#if defined(MBEDTLS_RIPEMD160_C) || \
32 ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_RIPEMD160) )
33#define MBEDTLS_OR_PSA_WANT_ALG_RIPEMD160
34#endif
35#if defined(MBEDTLS_SHA1_C) || \
36 ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_1) )
37#define MBEDTLS_OR_PSA_WANT_ALG_SHA_1
38#endif
39#if defined(MBEDTLS_SHA224_C) || \
40 ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_224) )
41#define MBEDTLS_OR_PSA_WANT_ALG_SHA_224
42#endif
43#if defined(MBEDTLS_SHA256_C) || \
44 ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_256) )
45#define MBEDTLS_OR_PSA_WANT_ALG_SHA_256
46#endif
47#if defined(MBEDTLS_SHA384_C) || \
48 ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_384) )
49#define MBEDTLS_OR_PSA_WANT_ALG_SHA_384
50#endif
51#if defined(MBEDTLS_SHA512_C) || \
52 ( defined(MBEDTLS_PSA_CRYPTO_C) && defined(PSA_WANT_ALG_SHA_512) )
53#define MBEDTLS_OR_PSA_WANT_ALG_SHA_512
54#endif
55
56#endif /* MBEDTLS_OR_PSA_HELPERS_H */