Mbed TLS v3.5.0
crypto_adjust_config_key_pair_types.h
Go to the documentation of this file.
1 
14 /*
15  * Copyright The Mbed TLS Contributors
16  * SPDX-License-Identifier: Apache-2.0
17  *
18  * Licensed under the Apache License, Version 2.0 (the "License"); you may
19  * not use this file except in compliance with the License.
20  * You may obtain a copy of the License at
21  *
22  * http://www.apache.org/licenses/LICENSE-2.0
23  *
24  * Unless required by applicable law or agreed to in writing, software
25  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
26  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27  * See the License for the specific language governing permissions and
28  * limitations under the License.
29  */
30 
31 #ifndef PSA_CRYPTO_ADJUST_KEYPAIR_TYPES_H
32 #define PSA_CRYPTO_ADJUST_KEYPAIR_TYPES_H
33 
34 /*****************************************************************
35  * ANYTHING -> BASIC
36  ****************************************************************/
37 
38 #if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT) || \
39  defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT) || \
40  defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE) || \
41  defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE)
42 #define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC 1
43 #endif
44 
45 #if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT) || \
46  defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT) || \
47  defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE) || \
48  defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE)
49 #define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC 1
50 #endif
51 
52 #if defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT) || \
53  defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT) || \
54  defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE) || \
55  defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_DERIVE)
56 #define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC 1
57 #endif
58 
59 /*****************************************************************
60  * BASIC -> corresponding PUBLIC
61  ****************************************************************/
62 
63 #if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC)
64 #define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY 1
65 #endif
66 
67 #if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC)
68 #define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY 1
69 #endif
70 
71 #if defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC)
72 #define PSA_WANT_KEY_TYPE_DH_PUBLIC_KEY 1
73 #endif
74 
75 /*****************************************************************
76  * BASIC -> IMPORT+EXPORT
77  *
78  * (Implementation-specific, may change in the future.)
79  ****************************************************************/
80 
81 /* Even though KEY_PAIR symbols' feature several level of support (BASIC, IMPORT,
82  * EXPORT, GENERATE, DERIVE) we're not planning to have support only for BASIC
83  * without IMPORT/EXPORT since these last 2 features are strongly used in tests.
84  * In general it is allowed to include more feature than what is strictly
85  * requested.
86  * As a consequence IMPORT and EXPORT features will be automatically enabled
87  * as soon as the BASIC one is. */
88 #if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC)
89 #define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT 1
90 #define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT 1
91 #endif
92 
93 #if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC)
94 #define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT 1
95 #define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT 1
96 #endif
97 
98 #if defined(PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC)
99 #define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT 1
100 #define PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT 1
101 #endif
102 
103 #endif /* PSA_CRYPTO_ADJUST_KEYPAIR_TYPES_H */