Mbed OS Reference
Loading...
Searching...
No Matches
check_crypto_config.h
Go to the documentation of this file.
1/**
2 * \file check_crypto_config.h
3 *
4 * \brief Consistency checks for PSA configuration options
5 */
6/*
7 * Copyright The Mbed TLS Contributors
8 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 */
22
23/*
24 * It is recommended to include this file from your crypto_config.h
25 * in order to catch dependency issues early.
26 */
27
28#ifndef MBEDTLS_CHECK_CRYPTO_CONFIG_H
29#define MBEDTLS_CHECK_CRYPTO_CONFIG_H
30
31#if defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA) && \
32 !( defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR) || \
33 defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) )
34#error "PSA_WANT_ALG_DETERMINISTIC_ECDSA defined, but not all prerequisites"
35#endif
36
37#if defined(PSA_WANT_ALG_ECDSA) && \
38 !( defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR) || \
39 defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) )
40#error "PSA_WANT_ALG_ECDSA defined, but not all prerequisites"
41#endif
42
43#if defined(PSA_WANT_ALG_RSA_PKCS1V15_CRYPT) && \
44 !( defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) || \
45 defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) )
46#error "PSA_WANT_ALG_RSA_PKCS1V15_CRYPT defined, but not all prerequisites"
47#endif
48
49#if defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN) && \
50 !( defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) || \
51 defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) )
52#error "PSA_WANT_ALG_RSA_PKCS1V15_SIGN defined, but not all prerequisites"
53#endif
54
55#if defined(PSA_WANT_ALG_RSA_OAEP) && \
56 !( defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) || \
57 defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) )
58#error "PSA_WANT_ALG_RSA_OAEP defined, but not all prerequisites"
59#endif
60
61#if defined(PSA_WANT_ALG_RSA_PSS) && \
62 !( defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) || \
63 defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) )
64#error "PSA_WANT_ALG_RSA_PSS defined, but not all prerequisites"
65#endif
66
67#if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR) && \
68 !defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
69#error "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR defined, but not all prerequisites"
70#endif
71
72#endif /* MBEDTLS_CHECK_CRYPTO_CONFIG_H */