Mistake on this page?
Report an issue in GitHub or email us
pal_crypto_config_check.h
Go to the documentation of this file.
1 /** @file
2  * Copyright (c) 2019, Arm Limited or its affiliates. All rights reserved.
3  * SPDX-License-Identifier : Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16 **/
17 
18 /**
19  * \file pal_crypto_config_check.h
20  *
21  * \brief Consistency checks for configuration options
22  *
23  */
24 
25 #ifndef _PAL_CRYPTO_CONFIG_CHECK_H_
26 #define _PAL_CRYPTO_CONFIG_CHECK_H_
27 
28 #if defined(ARCH_TEST_RSA_1024) && !defined(ARCH_TEST_RSA)
29 #error "ARCH_TEST_RSA_1024 defined, but not all prerequisites"
30 #endif
31 
32 #if defined(ARCH_TEST_RSA_2048) && !defined(ARCH_TEST_RSA)
33 #error "ARCH_TEST_RSA_2048 defined, but not all prerequisites"
34 #endif
35 
36 #if defined(ARCH_TEST_RSA_3072) && !defined(ARCH_TEST_RSA)
37 #error "ARCH_TEST_RSA_3072 defined, but not all prerequisites"
38 #endif
39 
40 #if defined(ARCH_TEST_ECC_CURVE_SECP192R1) && !defined(ARCH_TEST_ECC)
41 #error "ARCH_TEST_ECC_CURVE_SECP192R1 defined, but not all prerequisites"
42 #endif
43 
44 #if defined(ARCH_TEST_ECC_CURVE_SECP224R1) && !defined(ARCH_TEST_ECC)
45 #error "ARCH_TEST_ECC_CURVE_SECP224R1 defined, but not all prerequisites"
46 #endif
47 
48 #if defined(ARCH_TEST_ECC_CURVE_SECP256R1) && !defined(ARCH_TEST_ECC)
49 #error "ARCH_TEST_ECC_CURVE_SECP256R1 defined, but not all prerequisites"
50 #endif
51 
52 #if defined(ARCH_TEST_ECC_CURVE_SECP384R1) && !defined(ARCH_TEST_ECC)
53 #error "ARCH_TEST_ECC_CURVE_SECP384R1 defined, but not all prerequisites"
54 #endif
55 
56 #if defined(ARCH_TEST_AES_128) && !defined(ARCH_TEST_AES)
57 #error "ARCH_TEST_AES_128 defined, but not all prerequisites"
58 #endif
59 
60 #if defined(ARCH_TEST_AES_256) && !defined(ARCH_TEST_AES)
61 #error "ARCH_TEST_AES_256 defined, but not all prerequisites"
62 #endif
63 
64 #if defined(ARCH_TEST_AES_512) && !defined(ARCH_TEST_AES)
65 #error "ARCH_TEST_AES_512 defined, but not all prerequisites"
66 #endif
67 
68 #if defined(ARCH_TEST_DES_1KEY) && !defined(ARCH_TEST_DES)
69 #error "ARCH_TEST_DES_1KEY defined, but not all prerequisites"
70 #endif
71 
72 #if defined(ARCH_TEST_DES_2KEY) && !defined(ARCH_TEST_DES)
73 #error "ARCH_TEST_DES_2KEY defined, but not all prerequisites"
74 #endif
75 
76 #if defined(ARCH_TEST_DES_3KEY) && !defined(ARCH_TEST_DES)
77 #error "ARCH_TEST_DES_3KEY defined, but not all prerequisites"
78 #endif
79 
80 #if defined(ARCH_TEST_CIPER_MODE_CTR) && !defined(ARCH_TEST_CIPER)
81 #error "ARCH_TEST_CIPER_MODE_CTR defined, but not all prerequisites"
82 #endif
83 
84 #if defined(ARCH_TEST_CIPER_MODE_CFB) && !defined(ARCH_TEST_CIPER)
85 #error "ARCH_TEST_CIPER_MODE_CFB defined, but not all prerequisites"
86 #endif
87 
88 #if defined(ARCH_TEST_CIPER_MODE_CBC) && !defined(ARCH_TEST_CIPER)
89 #error "ARCH_TEST_CIPER_MODE_CBC defined, but not all prerequisites"
90 #endif
91 
92 #if defined(ARCH_TEST_CTR_AES) &&\
93  (!defined(ARCH_TEST_CIPER) || !defined(ARCH_TEST_AES) || !defined(ARCH_TEST_CIPER_MODE_CTR))
94 #error "ARCH_TEST_CTR_AES defined, but not all prerequisites"
95 #endif
96 
97 #if (defined(ARCH_TEST_CBC_AES)|| defined(ARCH_TEST_CBC_AES_NO_PADDING)) &&\
98  (!defined(ARCH_TEST_CIPER) || !defined(ARCH_TEST_AES) || !defined(ARCH_TEST_CIPER_MODE_CBC))
99 #error "ARCH_TEST_CBC_AES defined, but not all prerequisites"
100 #endif
101 
102 #if (defined(ARCH_TEST_CBC_NO_PADDING)) &&\
103  (!defined(ARCH_TEST_CIPER) ||!defined(ARCH_TEST_CIPER_MODE_CBC))
104 #error "ARCH_TEST_CBC_NO_PADDING defined, but not all prerequisites"
105 #endif
106 
107 #if defined(ARCH_TEST_CFB_AES) &&\
108  (!defined(ARCH_TEST_CIPER) || !defined(ARCH_TEST_AES) || !defined(ARCH_TEST_CIPER_MODE_CFB))
109 #error "ARCH_TEST_CFB_AES defined, but not all prerequisites"
110 #endif
111 
112 #if defined(ARCH_TEST_RSA_PKCS1V15_SIGN) &&\
113  (!defined(ARCH_TEST_RSA) || !defined(ARCH_TEST_PKCS1V15))
114 #error "ARCH_TEST_RSA_PKCS1V15_SIGN defined, but not all prerequisites"
115 #endif
116 
117 #if defined(ARCH_TEST_RSA_PKCS1V15_SIGN_RAW) &&\
118  (!defined(ARCH_TEST_RSA) || !defined(ARCH_TEST_PKCS1V15))
119 #error "ARCH_TEST_RSA_PKCS1V15_SIGN_RAW defined, but not all prerequisites"
120 #endif
121 
122 #if defined(ARCH_TEST_RSA_PKCS1V15_CRYPT) &&\
123  (!defined(ARCH_TEST_RSA) || !defined(ARCH_TEST_PKCS1V15))
124 #error "ARCH_TEST_RSA_PKCS1V15_CRYPT defined, but not all prerequisites"
125 #endif
126 
127 #if defined(ARCH_TEST_CBC_PKCS7) && !defined(ARCH_TEST_CIPER_MODE_CBC)
128 #error "ARCH_TEST_CBC_PKCS7 defined, but not all prerequisites"
129 #endif
130 
131 #if defined(ARCH_TEST_HMAC) && !defined(ARCH_TEST_HASH)
132 #error "ARCH_TEST_HMAC defined, but not all prerequisites"
133 #endif
134 
135 #if defined(ARCH_TEST_MD2) && !defined(ARCH_TEST_HASH)
136 #error "ARCH_TEST_MD2 defined, but not all prerequisites"
137 #endif
138 
139 #if defined(ARCH_TEST_MD4) && !defined(ARCH_TEST_HASH)
140 #error "ARCH_TEST_MD4 defined, but not all prerequisites"
141 #endif
142 
143 #if defined(ARCH_TEST_MD5) && !defined(ARCH_TEST_HASH)
144 #error "ARCH_TEST_MD5 defined, but not all prerequisites"
145 #endif
146 
147 #if defined(ARCH_TEST_RIPEMD160) && !defined(ARCH_TEST_HASH)
148 #error "ARCH_TEST_RIPEMD160 defined, but not all prerequisites"
149 #endif
150 
151 #if defined(ARCH_TEST_SHA1) && !defined(ARCH_TEST_HASH)
152 #error "ARCH_TEST_SHA1 defined, but not all prerequisites"
153 #endif
154 
155 #if defined(ARCH_TEST_SHA224) && !defined(ARCH_TEST_HASH)
156 #error "ARCH_TEST_SHA224 defined, but not all prerequisites"
157 #endif
158 
159 #if defined(ARCH_TEST_SHA256) && !defined(ARCH_TEST_HASH)
160 #error "ARCH_TEST_SHA256 defined, but not all prerequisites"
161 #endif
162 
163 #if defined(ARCH_TEST_SHA512) && !defined(ARCH_TEST_HASH)
164 #error "ARCH_TEST_SHA512 defined, but not all prerequisites"
165 #endif
166 
167 #if defined(ARCH_TEST_SHA512_224) && !defined(ARCH_TEST_HASH)
168 #error "ARCH_TEST_SHA512_224 defined, but not all prerequisites"
169 #endif
170 
171 #if defined(ARCH_TEST_SHA512_256) && !defined(ARCH_TEST_HASH)
172 #error "ARCH_TEST_SHA512_256 defined, but not all prerequisites"
173 #endif
174 
175 #if defined(ARCH_TEST_SHA3_224) && !defined(ARCH_TEST_HASH)
176 #error "ARCH_TEST_SHA3_224 defined, but not all prerequisites"
177 #endif
178 
179 #if defined(ARCH_TEST_SHA3_256) && !defined(ARCH_TEST_HASH)
180 #error "ARCH_TEST_SHA3_256 defined, but not all prerequisites"
181 #endif
182 
183 #if defined(ARCH_TEST_SHA3_384) && !defined(ARCH_TEST_HASH)
184 #error "ARCH_TEST_SHA3_256 defined, but not all prerequisites"
185 #endif
186 
187 #if defined(ARCH_TEST_SHA3_512) && !defined(ARCH_TEST_HASH)
188 #error "ARCH_TEST_SHA3_256 defined, but not all prerequisites"
189 #endif
190 
191 #if defined(ARCH_TEST_HKDF) && !defined(ARCH_TEST_HASH)
192 #error "ARCH_TEST_HKDF defined, but not all prerequisites"
193 #endif
194 
195 #if defined(ARCH_TEST_CMAC) && !defined(ARCH_TEST_AES) && !defined(ARCH_TEST_AES)
196 #error "ARCH_TEST_CMAC defined, but not all prerequisites"
197 #endif
198 
199 #if defined(ARCH_TEST_GMAC) && !defined(ARCH_TEST_AES) && !defined(ARCH_TEST_AES)
200 #error "ARCH_TEST_GMAC defined, but not all prerequisites"
201 #endif
202 
203 #if defined(ARCH_TEST_HMAC) && !defined(ARCH_TEST_AES) && !defined(ARCH_TEST_AES)
204 #error "ARCH_TEST_HMAC defined, but not all prerequisites"
205 #endif
206 
207 #if defined(ARCH_TEST_CCM) && !defined(ARCH_TEST_AES)
208 #error "ARCH_TEST_CCM defined, but not all prerequisites"
209 #endif
210 
211 #if defined(ARCH_TEST_GCM) && !defined(ARCH_TEST_AES)
212 #error "ARCH_TEST_GCM defined, but not all prerequisites"
213 #endif
214 
215 #if defined(ARCH_TEST_ECDH) && !defined(ARCH_TEST_ECC)
216 #error "ARCH_TEST_ECDH defined, but not all prerequisites"
217 #endif
218 
219 #if defined(ARCH_TEST_ECDSA) && !defined(ARCH_TEST_ECC)
220 #error "ARCH_TEST_ECDSA defined, but not all prerequisites"
221 #endif
222 
223 #endif /* _PAL_CRYPTO_CONFIG_CHECK_H_ */
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.