• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * \file mbedtls/config_psa.h
3  * \brief PSA crypto configuration options (set of defines)
4  *
5  *  This set of compile-time options takes settings defined in
6  *  include/mbedtls/mbedtls_config.h and include/psa/crypto_config.h and uses
7  *  those definitions to define symbols used in the library code.
8  *
9  *  Users and integrators should not edit this file, please edit
10  *  include/mbedtls/mbedtls_config.h for MBETLS_XXX settings or
11  *  include/psa/crypto_config.h for PSA_WANT_XXX settings.
12  */
13 /*
14  *  Copyright The Mbed TLS Contributors
15  *  SPDX-License-Identifier: Apache-2.0
16  *
17  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
18  *  not use this file except in compliance with the License.
19  *  You may obtain a copy of the License at
20  *
21  *  http://www.apache.org/licenses/LICENSE-2.0
22  *
23  *  Unless required by applicable law or agreed to in writing, software
24  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
25  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26  *  See the License for the specific language governing permissions and
27  *  limitations under the License.
28  */
29 
30 #ifndef MBEDTLS_CONFIG_PSA_H
31 #define MBEDTLS_CONFIG_PSA_H
32 
33 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
34 #include "psa/crypto_config.h"
35 #endif /* defined(MBEDTLS_PSA_CRYPTO_CONFIG) */
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
41 
42 
43 /****************************************************************/
44 /* De facto synonyms */
45 /****************************************************************/
46 
47 #if defined(PSA_WANT_ALG_ECDSA_ANY) && !defined(PSA_WANT_ALG_ECDSA)
48 #define PSA_WANT_ALG_ECDSA PSA_WANT_ALG_ECDSA_ANY
49 #elif !defined(PSA_WANT_ALG_ECDSA_ANY) && defined(PSA_WANT_ALG_ECDSA)
50 #define PSA_WANT_ALG_ECDSA_ANY PSA_WANT_ALG_ECDSA
51 #endif
52 
53 #if defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
54 #define PSA_WANT_ALG_RSA_PKCS1V15_SIGN PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW
55 #elif !defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW) && defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
56 #define PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW PSA_WANT_ALG_RSA_PKCS1V15_SIGN
57 #endif
58 
59 #if defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && !defined(PSA_WANT_ALG_RSA_PSS)
60 #define PSA_WANT_ALG_RSA_PSS PSA_WANT_ALG_RSA_PSS_ANY_SALT
61 #elif !defined(PSA_WANT_ALG_RSA_PSS_ANY_SALT) && defined(PSA_WANT_ALG_RSA_PSS)
62 #define PSA_WANT_ALG_RSA_PSS_ANY_SALT PSA_WANT_ALG_RSA_PSS
63 #endif
64 
65 
66 
67 /****************************************************************/
68 /* Require built-in implementations based on PSA requirements */
69 /****************************************************************/
70 
71 #if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
72 
73 #if defined(PSA_WANT_ALG_DETERMINISTIC_ECDSA)
74 #if !defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA)
75 #define MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA 1
76 #define MBEDTLS_ECDSA_DETERMINISTIC
77 #define MBEDTLS_ECDSA_C
78 #define MBEDTLS_HMAC_DRBG_C
79 #define MBEDTLS_MD_C
80 #endif /* !MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA */
81 #endif /* PSA_WANT_ALG_DETERMINISTIC_ECDSA */
82 
83 #if defined(PSA_WANT_ALG_ECDH)
84 #if !defined(MBEDTLS_PSA_ACCEL_ALG_ECDH)
85 #define MBEDTLS_PSA_BUILTIN_ALG_ECDH 1
86 #define MBEDTLS_ECDH_C
87 #define MBEDTLS_ECP_C
88 #define MBEDTLS_BIGNUM_C
89 #endif /* !MBEDTLS_PSA_ACCEL_ALG_ECDH */
90 #endif /* PSA_WANT_ALG_ECDH */
91 
92 #if defined(PSA_WANT_ALG_ECDSA)
93 #if !defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA)
94 #define MBEDTLS_PSA_BUILTIN_ALG_ECDSA 1
95 #define MBEDTLS_ECDSA_C
96 #define MBEDTLS_ECP_C
97 #define MBEDTLS_BIGNUM_C
98 #define MBEDTLS_ASN1_PARSE_C
99 #define MBEDTLS_ASN1_WRITE_C
100 #endif /* !MBEDTLS_PSA_ACCEL_ALG_ECDSA */
101 #endif /* PSA_WANT_ALG_ECDSA */
102 
103 #if defined(PSA_WANT_ALG_HKDF)
104 #if !defined(MBEDTLS_PSA_ACCEL_ALG_HKDF)
105 #define MBEDTLS_PSA_BUILTIN_ALG_HMAC 1
106 #define MBEDTLS_PSA_BUILTIN_ALG_HKDF 1
107 #endif /* !MBEDTLS_PSA_ACCEL_ALG_HKDF */
108 #endif /* PSA_WANT_ALG_HKDF */
109 
110 #if defined(PSA_WANT_ALG_HMAC)
111 #if !defined(MBEDTLS_PSA_ACCEL_ALG_HMAC)
112 #define MBEDTLS_PSA_BUILTIN_ALG_HMAC 1
113 #endif /* !MBEDTLS_PSA_ACCEL_ALG_HMAC */
114 #endif /* PSA_WANT_ALG_HMAC */
115 
116 #if defined(PSA_WANT_ALG_MD5) && !defined(MBEDTLS_PSA_ACCEL_ALG_MD5)
117 #define MBEDTLS_PSA_BUILTIN_ALG_MD5 1
118 #define MBEDTLS_MD5_C
119 #endif
120 
121 #if defined(PSA_WANT_ALG_RIPEMD160) && !defined(MBEDTLS_PSA_ACCEL_ALG_RIPEMD160)
122 #define MBEDTLS_PSA_BUILTIN_ALG_RIPEMD160 1
123 #define MBEDTLS_RIPEMD160_C
124 #endif
125 
126 #if defined(PSA_WANT_ALG_RSA_OAEP)
127 #if !defined(MBEDTLS_PSA_ACCEL_ALG_RSA_OAEP)
128 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_OAEP 1
129 #define MBEDTLS_RSA_C
130 #define MBEDTLS_BIGNUM_C
131 #define MBEDTLS_OID_C
132 #define MBEDTLS_PKCS1_V21
133 #define MBEDTLS_MD_C
134 #endif /* !MBEDTLS_PSA_ACCEL_ALG_RSA_OAEP */
135 #endif /* PSA_WANT_ALG_RSA_OAEP */
136 
137 #if defined(PSA_WANT_ALG_RSA_PKCS1V15_CRYPT)
138 #if !defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_CRYPT)
139 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_CRYPT 1
140 #define MBEDTLS_RSA_C
141 #define MBEDTLS_BIGNUM_C
142 #define MBEDTLS_OID_C
143 #define MBEDTLS_PKCS1_V15
144 #endif /* !MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_CRYPT */
145 #endif /* PSA_WANT_ALG_RSA_PKCS1V15_CRYPT */
146 
147 #if defined(PSA_WANT_ALG_RSA_PKCS1V15_SIGN)
148 #if !defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN)
149 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_SIGN 1
150 #define MBEDTLS_RSA_C
151 #define MBEDTLS_BIGNUM_C
152 #define MBEDTLS_OID_C
153 #define MBEDTLS_PKCS1_V15
154 #define MBEDTLS_MD_C
155 #endif /* !MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN */
156 #endif /* PSA_WANT_ALG_RSA_PKCS1V15_SIGN */
157 
158 #if defined(PSA_WANT_ALG_RSA_PSS)
159 #if !defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS)
160 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_PSS 1
161 #define MBEDTLS_RSA_C
162 #define MBEDTLS_BIGNUM_C
163 #define MBEDTLS_OID_C
164 #define MBEDTLS_PKCS1_V21
165 #define MBEDTLS_MD_C
166 #endif /* !MBEDTLS_PSA_ACCEL_ALG_RSA_PSS */
167 #endif /* PSA_WANT_ALG_RSA_PSS */
168 
169 #if defined(PSA_WANT_ALG_SHA_1) && !defined(MBEDTLS_PSA_ACCEL_ALG_SHA_1)
170 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_1 1
171 #define MBEDTLS_SHA1_C
172 #endif
173 
174 #if defined(PSA_WANT_ALG_SHA_224) && !defined(MBEDTLS_PSA_ACCEL_ALG_SHA_224)
175 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_224 1
176 #define MBEDTLS_SHA224_C
177 #endif
178 
179 #if defined(PSA_WANT_ALG_SHA_256) && !defined(MBEDTLS_PSA_ACCEL_ALG_SHA_256)
180 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_256 1
181 #define MBEDTLS_SHA256_C
182 #endif
183 
184 #if defined(PSA_WANT_ALG_SHA_384) && !defined(MBEDTLS_PSA_ACCEL_ALG_SHA_384)
185 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_384 1
186 #define MBEDTLS_SHA384_C
187 #endif
188 
189 #if defined(PSA_WANT_ALG_SHA_512) && !defined(MBEDTLS_PSA_ACCEL_ALG_SHA_512)
190 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_512 1
191 #define MBEDTLS_SHA512_C
192 #endif
193 
194 #if defined(PSA_WANT_ALG_TLS12_PRF)
195 #if !defined(MBEDTLS_PSA_ACCEL_ALG_TLS12_PRF)
196 #define MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF 1
197 #endif /* !MBEDTLS_PSA_ACCEL_ALG_TLS12_PRF */
198 #endif /* PSA_WANT_ALG_TLS12_PRF */
199 
200 #if defined(PSA_WANT_ALG_TLS12_PSK_TO_MS)
201 #if !defined(MBEDTLS_PSA_ACCEL_ALG_TLS12_PSK_TO_MS)
202 #define MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS 1
203 #endif /* !MBEDTLS_PSA_ACCEL_ALG_TLS12_PSK_TO_MS */
204 #endif /* PSA_WANT_ALG_TLS12_PSK_TO_MS */
205 
206 #if defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR)
207 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR)
208 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR 1
209 #define MBEDTLS_ECP_C
210 #define MBEDTLS_BIGNUM_C
211 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR */
212 #endif /* PSA_WANT_KEY_TYPE_ECC_KEY_PAIR */
213 
214 #if defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY)
215 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY)
216 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_PUBLIC_KEY 1
217 #define MBEDTLS_ECP_C
218 #define MBEDTLS_BIGNUM_C
219 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY */
220 #endif /* PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY */
221 
222 #if defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR)
223 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR)
224 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR 1
225 #define MBEDTLS_RSA_C
226 #define MBEDTLS_BIGNUM_C
227 #define MBEDTLS_OID_C
228 #define MBEDTLS_GENPRIME
229 #define MBEDTLS_PK_PARSE_C
230 #define MBEDTLS_PK_WRITE_C
231 #define MBEDTLS_PK_C
232 #define MBEDTLS_ASN1_PARSE_C
233 #define MBEDTLS_ASN1_WRITE_C
234 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR */
235 #endif /* PSA_WANT_KEY_TYPE_RSA_KEY_PAIR */
236 
237 #if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY)
238 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY)
239 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_PUBLIC_KEY 1
240 #define MBEDTLS_RSA_C
241 #define MBEDTLS_BIGNUM_C
242 #define MBEDTLS_OID_C
243 #define MBEDTLS_PK_PARSE_C
244 #define MBEDTLS_PK_WRITE_C
245 #define MBEDTLS_PK_C
246 #define MBEDTLS_ASN1_PARSE_C
247 #define MBEDTLS_ASN1_WRITE_C
248 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY */
249 #endif /* PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY */
250 
251 /* If any of the block modes are requested that don't have an
252  * associated HW assist, define PSA_HAVE_SOFT_BLOCK_MODE for checking
253  * in the block cipher key types. */
254 #if (defined(PSA_WANT_ALG_CTR) && !defined(MBEDTLS_PSA_ACCEL_ALG_CTR)) || \
255     (defined(PSA_WANT_ALG_CFB) && !defined(MBEDTLS_PSA_ACCEL_ALG_CFB)) || \
256     (defined(PSA_WANT_ALG_OFB) && !defined(MBEDTLS_PSA_ACCEL_ALG_OFB)) || \
257     (defined(PSA_WANT_ALG_XTS) && !defined(MBEDTLS_PSA_ACCEL_ALG_XTS)) || \
258     defined(PSA_WANT_ALG_ECB_NO_PADDING) || \
259     (defined(PSA_WANT_ALG_CBC_NO_PADDING) && \
260      !defined(MBEDTLS_PSA_ACCEL_ALG_CBC_NO_PADDING)) || \
261     (defined(PSA_WANT_ALG_CBC_PKCS7) && \
262      !defined(MBEDTLS_PSA_ACCEL_ALG_CBC_PKCS7)) || \
263     (defined(PSA_WANT_ALG_CMAC) && !defined(MBEDTLS_PSA_ACCEL_ALG_CMAC))
264 #define PSA_HAVE_SOFT_BLOCK_MODE 1
265 #endif
266 
267 #if (defined(PSA_WANT_ALG_GCM) && !defined(MBEDTLS_PSA_ACCEL_ALG_GCM)) || \
268     (defined(PSA_WANT_ALG_CCM) && !defined(MBEDTLS_PSA_ACCEL_ALG_CCM))
269 #define PSA_HAVE_SOFT_BLOCK_AEAD 1
270 #endif
271 
272 #if defined(PSA_WANT_KEY_TYPE_AES)
273 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_AES)
274 #define PSA_HAVE_SOFT_KEY_TYPE_AES 1
275 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_AES */
276 #if defined(PSA_HAVE_SOFT_KEY_TYPE_AES) || \
277     defined(PSA_HAVE_SOFT_BLOCK_MODE) || \
278     defined(PSA_HAVE_SOFT_BLOCK_AEAD)
279 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_AES 1
280 #define MBEDTLS_AES_C
281 #endif /* PSA_HAVE_SOFT_KEY_TYPE_AES || PSA_HAVE_SOFT_BLOCK_MODE */
282 #endif /* PSA_WANT_KEY_TYPE_AES */
283 
284 #if defined(PSA_WANT_KEY_TYPE_ARIA)
285 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ARIA)
286 #define PSA_HAVE_SOFT_KEY_TYPE_ARIA 1
287 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_ARIA */
288 #if defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA) || \
289     defined(PSA_HAVE_SOFT_BLOCK_MODE) || \
290     defined(PSA_HAVE_SOFT_BLOCK_AEAD)
291 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ARIA 1
292 #define MBEDTLS_ARIA_C
293 #endif /* PSA_HAVE_SOFT_KEY_TYPE_ARIA || PSA_HAVE_SOFT_BLOCK_MODE */
294 #endif /* PSA_WANT_KEY_TYPE_ARIA */
295 
296 #if defined(PSA_WANT_KEY_TYPE_CAMELLIA)
297 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_CAMELLIA)
298 #define PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA 1
299 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_CAMELLIA */
300 #if defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA) || \
301     defined(PSA_HAVE_SOFT_BLOCK_MODE) || \
302     defined(PSA_HAVE_SOFT_BLOCK_AEAD)
303 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_CAMELLIA 1
304 #define MBEDTLS_CAMELLIA_C
305 #endif /* PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA || PSA_HAVE_SOFT_BLOCK_MODE */
306 #endif /* PSA_WANT_KEY_TYPE_CAMELLIA */
307 
308 #if defined(PSA_WANT_KEY_TYPE_DES)
309 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_DES)
310 #define PSA_HAVE_SOFT_KEY_TYPE_DES 1
311 #endif /* !MBEDTLS_PSA_ACCEL_KEY_TYPE_DES */
312 #if defined(PSA_HAVE_SOFT_KEY_TYPE_DES) || \
313     defined(PSA_HAVE_SOFT_BLOCK_MODE)
314 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES 1
315 #define MBEDTLS_DES_C
316 #endif /*PSA_HAVE_SOFT_KEY_TYPE_DES || PSA_HAVE_SOFT_BLOCK_MODE */
317 #endif /* PSA_WANT_KEY_TYPE_DES */
318 
319 #if defined(PSA_WANT_KEY_TYPE_CHACHA20)
320 #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_CHACHA20)
321 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_CHACHA20 1
322 #define MBEDTLS_CHACHA20_C
323 #endif /*!MBEDTLS_PSA_ACCEL_KEY_TYPE_CHACHA20 */
324 #endif /* PSA_WANT_KEY_TYPE_CHACHA20 */
325 
326 /* If any of the software block ciphers are selected, define
327  * PSA_HAVE_SOFT_BLOCK_CIPHER, which can be used in any of these
328  * situations. */
329 #if defined(PSA_HAVE_SOFT_KEY_TYPE_AES) || \
330     defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA) || \
331     defined(PSA_HAVE_SOFT_KEY_TYPE_DES) || \
332     defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)
333 #define PSA_HAVE_SOFT_BLOCK_CIPHER 1
334 #endif
335 
336 #if defined(PSA_WANT_ALG_STREAM_CIPHER)
337 #define MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER 1
338 #endif /* PSA_WANT_ALG_STREAM_CIPHER */
339 
340 #if defined(PSA_WANT_ALG_CBC_MAC)
341 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CBC_MAC)
342 #error "CBC-MAC is not yet supported via the PSA API in Mbed TLS."
343 #define MBEDTLS_PSA_BUILTIN_ALG_CBC_MAC 1
344 #endif /* !MBEDTLS_PSA_ACCEL_ALG_CBC_MAC */
345 #endif /* PSA_WANT_ALG_CBC_MAC */
346 
347 #if defined(PSA_WANT_ALG_CMAC)
348 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CMAC) || \
349     defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
350 #define MBEDTLS_PSA_BUILTIN_ALG_CMAC 1
351 #define MBEDTLS_CMAC_C
352 #endif /* !MBEDTLS_PSA_ACCEL_ALG_CMAC */
353 #endif /* PSA_WANT_ALG_CMAC */
354 
355 #if defined(PSA_WANT_ALG_CTR)
356 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CTR) || \
357     defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
358 #define MBEDTLS_PSA_BUILTIN_ALG_CTR 1
359 #define MBEDTLS_CIPHER_MODE_CTR
360 #endif
361 #endif /* PSA_WANT_ALG_CTR */
362 
363 #if defined(PSA_WANT_ALG_CFB)
364 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CFB) || \
365     defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
366 #define MBEDTLS_PSA_BUILTIN_ALG_CFB 1
367 #define MBEDTLS_CIPHER_MODE_CFB
368 #endif
369 #endif /* PSA_WANT_ALG_CFB */
370 
371 #if defined(PSA_WANT_ALG_OFB)
372 #if !defined(MBEDTLS_PSA_ACCEL_ALG_OFB) || \
373     defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
374 #define MBEDTLS_PSA_BUILTIN_ALG_OFB 1
375 #define MBEDTLS_CIPHER_MODE_OFB
376 #endif
377 #endif /* PSA_WANT_ALG_OFB */
378 
379 #if defined(PSA_WANT_ALG_XTS)
380 #if !defined(MBEDTLS_PSA_ACCEL_ALG_XTS) || \
381     defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
382 #define MBEDTLS_PSA_BUILTIN_ALG_XTS 1
383 #define MBEDTLS_CIPHER_MODE_XTS
384 #endif
385 #endif /* PSA_WANT_ALG_XTS */
386 
387 #if defined(PSA_WANT_ALG_ECB_NO_PADDING)
388 #define MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING 1
389 #endif
390 
391 #if defined(PSA_WANT_ALG_CBC_NO_PADDING)
392 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CBC_NO_PADDING) || \
393     defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
394 #define MBEDTLS_CIPHER_MODE_CBC
395 #define MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING 1
396 #endif
397 #endif /* PSA_WANT_ALG_CBC_NO_PADDING */
398 
399 #if defined(PSA_WANT_ALG_CBC_PKCS7)
400 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CBC_PKCS7) || \
401     defined(PSA_HAVE_SOFT_BLOCK_CIPHER)
402 #define MBEDTLS_CIPHER_MODE_CBC
403 #define MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7 1
404 #define MBEDTLS_CIPHER_PADDING_PKCS7
405 #endif
406 #endif /* PSA_WANT_ALG_CBC_PKCS7 */
407 
408 #if defined(PSA_WANT_ALG_CCM)
409 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CCM) || \
410     defined(PSA_HAVE_SOFT_KEY_TYPE_AES) || \
411     defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA) || \
412     defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)
413 #define MBEDTLS_PSA_BUILTIN_ALG_CCM 1
414 #define MBEDTLS_CCM_C
415 #endif
416 #endif /* PSA_WANT_ALG_CCM */
417 
418 #if defined(PSA_WANT_ALG_GCM)
419 #if !defined(MBEDTLS_PSA_ACCEL_ALG_GCM) || \
420     defined(PSA_HAVE_SOFT_KEY_TYPE_AES) || \
421     defined(PSA_HAVE_SOFT_KEY_TYPE_ARIA) || \
422     defined(PSA_HAVE_SOFT_KEY_TYPE_CAMELLIA)
423 #define MBEDTLS_PSA_BUILTIN_ALG_GCM 1
424 #define MBEDTLS_GCM_C
425 #endif
426 #endif /* PSA_WANT_ALG_GCM */
427 
428 #if defined(PSA_WANT_ALG_CHACHA20_POLY1305)
429 #if !defined(MBEDTLS_PSA_ACCEL_ALG_CHACHA20_POLY1305)
430 #if defined(PSA_WANT_KEY_TYPE_CHACHA20)
431 #define MBEDTLS_CHACHAPOLY_C
432 #define MBEDTLS_PSA_BUILTIN_ALG_CHACHA20_POLY1305 1
433 #endif /* PSA_WANT_KEY_TYPE_CHACHA20 */
434 #endif /* !MBEDTLS_PSA_ACCEL_ALG_CHACHA20_POLY1305 */
435 #endif /* PSA_WANT_ALG_CHACHA20_POLY1305 */
436 
437 #if defined(PSA_WANT_ECC_BRAINPOOL_P_R1_256)
438 #if !defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_256)
439 #define MBEDTLS_ECP_DP_BP256R1_ENABLED
440 #define MBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_256 1
441 #endif /* !MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_256 */
442 #endif /* PSA_WANT_ECC_BRAINPOOL_P_R1_256 */
443 
444 #if defined(PSA_WANT_ECC_BRAINPOOL_P_R1_384)
445 #if !defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_384)
446 #define MBEDTLS_ECP_DP_BP384R1_ENABLED
447 #define MBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_384 1
448 #endif /* !MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_384 */
449 #endif /* PSA_WANT_ECC_BRAINPOOL_P_R1_384 */
450 
451 #if defined(PSA_WANT_ECC_BRAINPOOL_P_R1_512)
452 #if !defined(MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_512)
453 #define MBEDTLS_ECP_DP_BP512R1_ENABLED
454 #define MBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_512 1
455 #endif /* !MBEDTLS_PSA_ACCEL_ECC_BRAINPOOL_P_R1_512 */
456 #endif /* PSA_WANT_ECC_BRAINPOOL_P_R1_512 */
457 
458 #if defined(PSA_WANT_ECC_MONTGOMERY_255)
459 #if !defined(MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_255)
460 #define MBEDTLS_ECP_DP_CURVE25519_ENABLED
461 #define MBEDTLS_PSA_BUILTIN_ECC_MONTGOMERY_255 1
462 #endif /* !MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_255 */
463 #endif /* PSA_WANT_ECC_MONTGOMERY_255 */
464 
465 #if defined(PSA_WANT_ECC_MONTGOMERY_448)
466 #if !defined(MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_448)
467 #define MBEDTLS_ECP_DP_CURVE448_ENABLED
468 #define MBEDTLS_PSA_BUILTIN_ECC_MONTGOMERY_448 1
469 #endif /* !MBEDTLS_PSA_ACCEL_ECC_MONTGOMERY_448 */
470 #endif /* PSA_WANT_ECC_MONTGOMERY_448 */
471 
472 #if defined(PSA_WANT_ECC_SECP_R1_192)
473 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_192)
474 #define MBEDTLS_ECP_DP_SECP192R1_ENABLED
475 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_192 1
476 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_R1_192 */
477 #endif /* PSA_WANT_ECC_SECP_R1_192 */
478 
479 #if defined(PSA_WANT_ECC_SECP_R1_224)
480 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_224)
481 #define MBEDTLS_ECP_DP_SECP224R1_ENABLED
482 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_224 1
483 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_R1_224 */
484 #endif /* PSA_WANT_ECC_SECP_R1_224 */
485 
486 #if defined(PSA_WANT_ECC_SECP_R1_256)
487 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_256)
488 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
489 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_256 1
490 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_R1_256 */
491 #endif /* PSA_WANT_ECC_SECP_R1_256 */
492 
493 #if defined(PSA_WANT_ECC_SECP_R1_384)
494 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_384)
495 #define MBEDTLS_ECP_DP_SECP384R1_ENABLED
496 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_384 1
497 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_R1_384 */
498 #endif /* PSA_WANT_ECC_SECP_R1_384 */
499 
500 #if defined(PSA_WANT_ECC_SECP_R1_521)
501 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_R1_521)
502 #define MBEDTLS_ECP_DP_SECP521R1_ENABLED
503 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_521 1
504 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_R1_521 */
505 #endif /* PSA_WANT_ECC_SECP_R1_521 */
506 
507 #if defined(PSA_WANT_ECC_SECP_K1_192)
508 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_192)
509 #define MBEDTLS_ECP_DP_SECP192K1_ENABLED
510 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_K1_192 1
511 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_K1_192 */
512 #endif /* PSA_WANT_ECC_SECP_K1_192 */
513 
514 #if defined(PSA_WANT_ECC_SECP_K1_224)
515 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_224)
516 /*
517  * SECP224K1 is buggy via the PSA API in Mbed TLS
518  * (https://github.com/ARMmbed/mbedtls/issues/3541).
519  */
520 #error "SECP224K1 is buggy via the PSA API in Mbed TLS."
521 #define MBEDTLS_ECP_DP_SECP224K1_ENABLED
522 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_K1_224 1
523 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_K1_224 */
524 #endif /* PSA_WANT_ECC_SECP_K1_224 */
525 
526 #if defined(PSA_WANT_ECC_SECP_K1_256)
527 #if !defined(MBEDTLS_PSA_ACCEL_ECC_SECP_K1_256)
528 #define MBEDTLS_ECP_DP_SECP256K1_ENABLED
529 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_K1_256 1
530 #endif /* !MBEDTLS_PSA_ACCEL_ECC_SECP_K1_256 */
531 #endif /* PSA_WANT_ECC_SECP_K1_256 */
532 
533 
534 
535 /****************************************************************/
536 /* Infer PSA requirements from Mbed TLS capabilities */
537 /****************************************************************/
538 
539 #else /* MBEDTLS_PSA_CRYPTO_CONFIG */
540 
541 /*
542  * Ensure PSA_WANT_* defines are setup properly if MBEDTLS_PSA_CRYPTO_CONFIG
543  * is not defined
544  */
545 
546 #if defined(MBEDTLS_CCM_C)
547 #define MBEDTLS_PSA_BUILTIN_ALG_CCM 1
548 #define PSA_WANT_ALG_CCM 1
549 #endif /* MBEDTLS_CCM_C */
550 
551 #if defined(MBEDTLS_CMAC_C)
552 #define MBEDTLS_PSA_BUILTIN_ALG_CMAC 1
553 #define PSA_WANT_ALG_CMAC 1
554 #endif /* MBEDTLS_CMAC_C */
555 
556 #if defined(MBEDTLS_ECDH_C)
557 #define MBEDTLS_PSA_BUILTIN_ALG_ECDH 1
558 #define PSA_WANT_ALG_ECDH 1
559 #endif /* MBEDTLS_ECDH_C */
560 
561 #if defined(MBEDTLS_ECDSA_C)
562 #define MBEDTLS_PSA_BUILTIN_ALG_ECDSA 1
563 #define PSA_WANT_ALG_ECDSA 1
564 #define PSA_WANT_ALG_ECDSA_ANY 1
565 
566 // Only add in DETERMINISTIC support if ECDSA is also enabled
567 #if defined(MBEDTLS_ECDSA_DETERMINISTIC)
568 #define MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA 1
569 #define PSA_WANT_ALG_DETERMINISTIC_ECDSA 1
570 #endif /* MBEDTLS_ECDSA_DETERMINISTIC */
571 
572 #endif /* MBEDTLS_ECDSA_C */
573 
574 #if defined(MBEDTLS_ECP_C)
575 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR 1
576 #define PSA_WANT_KEY_TYPE_ECC_KEY_PAIR 1
577 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_PUBLIC_KEY 1
578 #define PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY 1
579 #endif /* MBEDTLS_ECP_C */
580 
581 #if defined(MBEDTLS_GCM_C)
582 #define MBEDTLS_PSA_BUILTIN_ALG_GCM 1
583 #define PSA_WANT_ALG_GCM 1
584 #endif /* MBEDTLS_GCM_C */
585 
586 #if defined(MBEDTLS_HKDF_C)
587 #define MBEDTLS_PSA_BUILTIN_ALG_HMAC 1
588 #define PSA_WANT_ALG_HMAC 1
589 #define MBEDTLS_PSA_BUILTIN_ALG_HKDF 1
590 #define PSA_WANT_ALG_HKDF 1
591 #endif /* MBEDTLS_HKDF_C */
592 
593 #if defined(MBEDTLS_MD_C)
594 #define MBEDTLS_PSA_BUILTIN_ALG_HMAC 1
595 #define PSA_WANT_ALG_HMAC 1
596 #define PSA_WANT_KEY_TYPE_HMAC
597 #define MBEDTLS_PSA_BUILTIN_ALG_TLS12_PRF 1
598 #define PSA_WANT_ALG_TLS12_PRF 1
599 #define MBEDTLS_PSA_BUILTIN_ALG_TLS12_PSK_TO_MS 1
600 #define PSA_WANT_ALG_TLS12_PSK_TO_MS 1
601 #endif /* MBEDTLS_MD_C */
602 
603 #if defined(MBEDTLS_MD5_C)
604 #define MBEDTLS_PSA_BUILTIN_ALG_MD5 1
605 #define PSA_WANT_ALG_MD5 1
606 #endif
607 
608 #if defined(MBEDTLS_RIPEMD160_C)
609 #define MBEDTLS_PSA_BUILTIN_ALG_RIPEMD160 1
610 #define PSA_WANT_ALG_RIPEMD160 1
611 #endif
612 
613 #if defined(MBEDTLS_RSA_C)
614 #if defined(MBEDTLS_PKCS1_V15)
615 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_CRYPT 1
616 #define PSA_WANT_ALG_RSA_PKCS1V15_CRYPT 1
617 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_SIGN 1
618 #define PSA_WANT_ALG_RSA_PKCS1V15_SIGN 1
619 #define PSA_WANT_ALG_RSA_PKCS1V15_SIGN_RAW 1
620 #endif /* MBEDTLS_PKCS1_V15 */
621 #if defined(MBEDTLS_PKCS1_V21)
622 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_OAEP 1
623 #define PSA_WANT_ALG_RSA_OAEP 1
624 #define MBEDTLS_PSA_BUILTIN_ALG_RSA_PSS 1
625 #define PSA_WANT_ALG_RSA_PSS 1
626 #endif /* MBEDTLS_PKCS1_V21 */
627 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR 1
628 #define PSA_WANT_KEY_TYPE_RSA_KEY_PAIR 1
629 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_PUBLIC_KEY 1
630 #define PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY 1
631 #endif /* MBEDTLS_RSA_C */
632 
633 #if defined(MBEDTLS_SHA1_C)
634 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_1 1
635 #define PSA_WANT_ALG_SHA_1 1
636 #endif
637 
638 #if defined(MBEDTLS_SHA224_C)
639 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_224 1
640 #define PSA_WANT_ALG_SHA_224 1
641 #endif
642 
643 #if defined(MBEDTLS_SHA256_C)
644 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_256 1
645 #define PSA_WANT_ALG_SHA_256 1
646 #endif
647 
648 #if defined(MBEDTLS_SHA384_C)
649 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_384 1
650 #define PSA_WANT_ALG_SHA_384 1
651 #endif
652 
653 #if defined(MBEDTLS_SHA512_C)
654 #define MBEDTLS_PSA_BUILTIN_ALG_SHA_512 1
655 #define PSA_WANT_ALG_SHA_512 1
656 #endif
657 
658 #if defined(MBEDTLS_AES_C)
659 #define PSA_WANT_KEY_TYPE_AES 1
660 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_AES 1
661 #endif
662 
663 #if defined(MBEDTLS_ARIA_C)
664 #define PSA_WANT_KEY_TYPE_ARIA 1
665 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_ARIA 1
666 #endif
667 
668 #if defined(MBEDTLS_CAMELLIA_C)
669 #define PSA_WANT_KEY_TYPE_CAMELLIA 1
670 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_CAMELLIA 1
671 #endif
672 
673 #if defined(MBEDTLS_DES_C)
674 #define PSA_WANT_KEY_TYPE_DES 1
675 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_DES 1
676 #endif
677 
678 #if defined(MBEDTLS_CHACHA20_C)
679 #define PSA_WANT_KEY_TYPE_CHACHA20 1
680 #define PSA_WANT_ALG_STREAM_CIPHER 1
681 #define MBEDTLS_PSA_BUILTIN_KEY_TYPE_CHACHA20 1
682 #define MBEDTLS_PSA_BUILTIN_ALG_STREAM_CIPHER 1
683 #if defined(MBEDTLS_CHACHAPOLY_C)
684 #define PSA_WANT_ALG_CHACHA20_POLY1305 1
685 #define MBEDTLS_PSA_BUILTIN_ALG_CHACHA20_POLY1305 1
686 #endif
687 #endif
688 
689 #if defined(MBEDTLS_CIPHER_MODE_CBC)
690 #define MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING 1
691 #define PSA_WANT_ALG_CBC_NO_PADDING 1
692 #if defined(MBEDTLS_CIPHER_PADDING_PKCS7)
693 #define MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7 1
694 #define PSA_WANT_ALG_CBC_PKCS7 1
695 #endif
696 #endif
697 
698 #if defined(MBEDTLS_AES_C) || defined(MBEDTLS_DES_C) || \
699     defined(MBEDTLS_ARIA_C) || defined(MBEDTLS_CAMELLIA_C)
700 #define MBEDTLS_PSA_BUILTIN_ALG_ECB_NO_PADDING 1
701 #define PSA_WANT_ALG_ECB_NO_PADDING 1
702 #endif
703 
704 #if defined(MBEDTLS_CIPHER_MODE_CFB)
705 #define MBEDTLS_PSA_BUILTIN_ALG_CFB 1
706 #define PSA_WANT_ALG_CFB 1
707 #endif
708 
709 #if defined(MBEDTLS_CIPHER_MODE_CTR)
710 #define MBEDTLS_PSA_BUILTIN_ALG_CTR 1
711 #define PSA_WANT_ALG_CTR 1
712 #endif
713 
714 #if defined(MBEDTLS_CIPHER_MODE_OFB)
715 #define MBEDTLS_PSA_BUILTIN_ALG_OFB 1
716 #define PSA_WANT_ALG_OFB 1
717 #endif
718 
719 #if defined(MBEDTLS_CIPHER_MODE_XTS)
720 #define MBEDTLS_PSA_BUILTIN_ALG_XTS 1
721 #define PSA_WANT_ALG_XTS 1
722 #endif
723 
724 #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED)
725 #define MBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_256 1
726 #define PSA_WANT_ECC_BRAINPOOL_P_R1_256
727 #endif
728 
729 #if defined(MBEDTLS_ECP_DP_BP384R1_ENABLED)
730 #define MBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_384 1
731 #define PSA_WANT_ECC_BRAINPOOL_P_R1_384
732 #endif
733 
734 #if defined(MBEDTLS_ECP_DP_BP512R1_ENABLED)
735 #define MBEDTLS_PSA_BUILTIN_ECC_BRAINPOOL_P_R1_512 1
736 #define PSA_WANT_ECC_BRAINPOOL_P_R1_512
737 #endif
738 
739 #if defined(MBEDTLS_ECP_DP_CURVE25519_ENABLED)
740 #define MBEDTLS_PSA_BUILTIN_ECC_MONTGOMERY_255 1
741 #define PSA_WANT_ECC_MONTGOMERY_255
742 #endif
743 
744 #if defined(MBEDTLS_ECP_DP_CURVE448_ENABLED)
745 #define MBEDTLS_PSA_BUILTIN_ECC_MONTGOMERY_448 1
746 #define PSA_WANT_ECC_MONTGOMERY_448
747 #endif
748 
749 #if defined(MBEDTLS_ECP_DP_SECP192R1_ENABLED)
750 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_192 1
751 #define PSA_WANT_ECC_SECP_R1_192
752 #endif
753 
754 #if defined(MBEDTLS_ECP_DP_SECP224R1_ENABLED)
755 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_224 1
756 #define PSA_WANT_ECC_SECP_R1_224
757 #endif
758 
759 #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED)
760 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_256 1
761 #define PSA_WANT_ECC_SECP_R1_256
762 #endif
763 
764 #if defined(MBEDTLS_ECP_DP_SECP384R1_ENABLED)
765 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_384 1
766 #define PSA_WANT_ECC_SECP_R1_384
767 #endif
768 
769 #if defined(MBEDTLS_ECP_DP_SECP521R1_ENABLED)
770 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_R1_521 1
771 #define PSA_WANT_ECC_SECP_R1_521
772 #endif
773 
774 #if defined(MBEDTLS_ECP_DP_SECP192K1_ENABLED)
775 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_K1_192 1
776 #define PSA_WANT_ECC_SECP_K1_192
777 #endif
778 
779 /* SECP224K1 is buggy via the PSA API (https://github.com/ARMmbed/mbedtls/issues/3541) */
780 #if 0 && defined(MBEDTLS_ECP_DP_SECP224K1_ENABLED)
781 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_K1_224 1
782 #define PSA_WANT_ECC_SECP_K1_224
783 #endif
784 
785 #if defined(MBEDTLS_ECP_DP_SECP256K1_ENABLED)
786 #define MBEDTLS_PSA_BUILTIN_ECC_SECP_K1_256 1
787 #define PSA_WANT_ECC_SECP_K1_256
788 #endif
789 
790 #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */
791 
792 /* These features are always enabled. */
793 #define PSA_WANT_KEY_TYPE_DERIVE 1
794 #define PSA_WANT_KEY_TYPE_RAW_DATA 1
795 
796 #ifdef __cplusplus
797 }
798 #endif
799 
800 #endif /* MBEDTLS_CONFIG_PSA_H */
801