blob: 9bd25f5f0a72fda7d82d9075852da98637c2042c [file] [log] [blame]
Summer Qind635cd02023-03-31 18:07:38 +08001From c21add49b5bb920220ab5ef67a394e1ca3d86d6d Mon Sep 17 00:00:00 2001
Raef Colesb97e0982022-02-28 11:29:56 +00002From: Raef Coles <raef.coles@arm.com>
3Date: Tue, 19 Jul 2022 11:12:30 +0100
Summer Qind635cd02023-03-31 18:07:38 +08004Subject: [PATCH 4/8] Add TF-M builtin key driver
Raef Colesb97e0982022-02-28 11:29:56 +00005
6Signed-off-by: Raef Coles <raef.coles@arm.com>
Antonio de Angelis01a93bc2023-01-20 11:17:14 +00007Co-authored-by: Antonio de Angelis <antonio.deangelis@arm.com>
Raef Colesb97e0982022-02-28 11:29:56 +00008---
9 library/psa_crypto.c | 11 +++-
Antonio de Angelis01a93bc2023-01-20 11:17:14 +000010 library/psa_crypto_driver_wrappers.c | 97 +++++++++++++++++++++++++++-
11 2 files changed, 106 insertions(+), 2 deletions(-)
Raef Colesb97e0982022-02-28 11:29:56 +000012
13diff --git a/library/psa_crypto.c b/library/psa_crypto.c
Summer Qind635cd02023-03-31 18:07:38 +080014index bc19ed07..df7776f3 100644
Raef Colesb97e0982022-02-28 11:29:56 +000015--- a/library/psa_crypto.c
16+++ b/library/psa_crypto.c
Summer Qin614002c2023-01-19 15:22:39 +080017@@ -82,6 +82,11 @@
Raef Colesb97e0982022-02-28 11:29:56 +000018 #include "mbedtls/sha512.h"
Summer Qind635cd02023-03-31 18:07:38 +080019 #include "hash_info.h"
Raef Colesb97e0982022-02-28 11:29:56 +000020
21+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
22+#include "tfm_crypto_defs.h"
23+#include "tfm_builtin_key_loader.h"
24+#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */
25+
Summer Qind635cd02023-03-31 18:07:38 +080026 #define ARRAY_LENGTH(array) (sizeof(array) / sizeof(*(array)))
Raef Colesb97e0982022-02-28 11:29:56 +000027
28 #if defined(MBEDTLS_PSA_BUILTIN_ALG_HKDF) || \
Summer Qind635cd02023-03-31 18:07:38 +080029@@ -1011,7 +1016,11 @@ static psa_status_t psa_get_and_lock_transparent_key_slot_with_policy(
30 return status;
31 }
Raef Colesb97e0982022-02-28 11:29:56 +000032
Summer Qind635cd02023-03-31 18:07:38 +080033- if (psa_key_lifetime_is_external((*p_slot)->attr.lifetime)) {
34+ if (psa_key_lifetime_is_external((*p_slot)->attr.lifetime)
Raef Colesb97e0982022-02-28 11:29:56 +000035+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
36+ && PSA_KEY_LIFETIME_GET_LOCATION((*p_slot)->attr.lifetime) != TFM_BUILTIN_KEY_LOADER_KEY_LOCATION
37+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
Summer Qind635cd02023-03-31 18:07:38 +080038+ ) {
39 psa_unlock_key_slot(*p_slot);
Raef Colesb97e0982022-02-28 11:29:56 +000040 *p_slot = NULL;
Summer Qind635cd02023-03-31 18:07:38 +080041 return PSA_ERROR_NOT_SUPPORTED;
Raef Colesb97e0982022-02-28 11:29:56 +000042diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c
Summer Qind635cd02023-03-31 18:07:38 +080043index ce26b346..38251f11 100644
Raef Colesb97e0982022-02-28 11:29:56 +000044--- a/library/psa_crypto_driver_wrappers.c
45+++ b/library/psa_crypto_driver_wrappers.c
Summer Qind635cd02023-03-31 18:07:38 +080046@@ -59,6 +59,18 @@
Raef Colesb97e0982022-02-28 11:29:56 +000047 #include "cc3xx.h"
48 #endif /* PSA_CRYPTO_DRIVER_CC3XX */
49
50+/* Include TF-M builtin key driver */
51+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
52+#ifndef PSA_CRYPTO_DRIVER_PRESENT
53+#define PSA_CRYPTO_DRIVER_PRESENT
54+#endif
55+#ifndef PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT
56+#define PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT
57+#endif
58+#include "tfm_crypto_defs.h"
59+#include "tfm_builtin_key_loader.h"
60+#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */
61+
Raef Colesb97e0982022-02-28 11:29:56 +000062 #endif /* MBEDTLS_PSA_CRYPTO_DRIVERS */
Summer Qin614002c2023-01-19 15:22:39 +080063 /* END-driver headers */
Raef Colesb97e0982022-02-28 11:29:56 +000064
Summer Qind635cd02023-03-31 18:07:38 +080065@@ -72,6 +84,9 @@
Summer Qin614002c2023-01-19 15:22:39 +080066 #if defined(PSA_CRYPTO_DRIVER_CC3XX)
Raef Colesb97e0982022-02-28 11:29:56 +000067 #define PSA_CRYPTO_CC3XX_DRIVER_ID (4)
68 #endif /* PSA_CRYPTO_DRIVER_CC3XX */
Raef Colesb97e0982022-02-28 11:29:56 +000069+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
70+#define PSA_CRYPTO_TFM_BUILTIN_KEY_LOADER_DRIVER_ID (5)
71+#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */
Summer Qin614002c2023-01-19 15:22:39 +080072
73 /* END-driver id */
74
Summer Qind635cd02023-03-31 18:07:38 +080075@@ -93,6 +108,12 @@ psa_status_t psa_driver_wrapper_init( void )
Antonio de Angelis01a93bc2023-01-20 11:17:14 +000076 {
77 psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
78
79+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
80+ status = tfm_builtin_key_loader_init();
81+ if (status != PSA_SUCCESS)
82+ return ( status );
83+#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */
84+
85 #if defined(PSA_CRYPTO_DRIVER_CC3XX)
86 status = cc3xx_init();
87 if (status != PSA_SUCCESS)
Summer Qind635cd02023-03-31 18:07:38 +080088@@ -156,6 +177,9 @@ psa_status_t psa_driver_wrapper_sign_message(
Raef Colesb97e0982022-02-28 11:29:56 +000089 switch( location )
90 {
91 case PSA_KEY_LOCATION_LOCAL_STORAGE:
92+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
93+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
94+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
95 /* Key is stored in the slot in export representation, so
96 * cycle through all known transparent accelerators */
97 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +080098@@ -244,6 +268,9 @@ psa_status_t psa_driver_wrapper_verify_message(
Raef Colesb97e0982022-02-28 11:29:56 +000099 switch( location )
100 {
101 case PSA_KEY_LOCATION_LOCAL_STORAGE:
102+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
103+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
104+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
105 /* Key is stored in the slot in export representation, so
106 * cycle through all known transparent accelerators */
107 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800108@@ -343,6 +370,9 @@ psa_status_t psa_driver_wrapper_sign_hash(
Raef Colesb97e0982022-02-28 11:29:56 +0000109 switch( location )
110 {
111 case PSA_KEY_LOCATION_LOCAL_STORAGE:
112+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
113+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
114+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
115 /* Key is stored in the slot in export representation, so
116 * cycle through all known transparent accelerators */
117 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800118@@ -439,6 +469,9 @@ psa_status_t psa_driver_wrapper_verify_hash(
Raef Colesb97e0982022-02-28 11:29:56 +0000119 switch( location )
120 {
121 case PSA_KEY_LOCATION_LOCAL_STORAGE:
122+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
123+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
124+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
125 /* Key is stored in the slot in export representation, so
126 * cycle through all known transparent accelerators */
127 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800128@@ -828,7 +861,11 @@ psa_status_t psa_driver_wrapper_get_key_buffer_size(
Raef Colesb97e0982022-02-28 11:29:56 +0000129 return( ( *key_buffer_size != 0 ) ?
130 PSA_SUCCESS : PSA_ERROR_NOT_SUPPORTED );
131 #endif /* PSA_CRYPTO_DRIVER_TEST */
132-
133+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
134+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
135+ return tfm_builtin_key_loader_get_key_buffer_size(psa_get_key_id(attributes),
136+ key_buffer_size);
137+#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */
138 default:
139 (void)key_type;
140 (void)key_bits;
Summer Qind635cd02023-03-31 18:07:38 +0800141@@ -868,6 +905,9 @@ psa_status_t psa_driver_wrapper_generate_key(
Raef Colesb97e0982022-02-28 11:29:56 +0000142 switch( location )
143 {
144 case PSA_KEY_LOCATION_LOCAL_STORAGE:
145+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
146+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
147+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
148 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
149 /* Transparent drivers are limited to generating asymmetric keys */
150 if( PSA_KEY_TYPE_IS_ASYMMETRIC( attributes->core.type ) )
Summer Qind635cd02023-03-31 18:07:38 +0800151@@ -960,6 +1000,9 @@ psa_status_t psa_driver_wrapper_import_key(
Raef Colesb97e0982022-02-28 11:29:56 +0000152 switch( location )
153 {
154 case PSA_KEY_LOCATION_LOCAL_STORAGE:
155+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
156+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
157+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
158 /* Key is stored in the slot in export representation, so
159 * cycle through all known transparent accelerators */
160 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800161@@ -1046,6 +1089,9 @@ psa_status_t psa_driver_wrapper_export_key(
Raef Colesb97e0982022-02-28 11:29:56 +0000162 switch( location )
163 {
164 case PSA_KEY_LOCATION_LOCAL_STORAGE:
165+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
166+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
167+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
168 return( psa_export_key_internal( attributes,
169 key_buffer,
170 key_buffer_size,
Summer Qind635cd02023-03-31 18:07:38 +0800171@@ -1111,6 +1157,9 @@ psa_status_t psa_driver_wrapper_export_public_key(
Raef Colesb97e0982022-02-28 11:29:56 +0000172 switch( location )
173 {
174 case PSA_KEY_LOCATION_LOCAL_STORAGE:
175+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
176+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
177+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
178 /* Key is stored in the slot in export representation, so
179 * cycle through all known transparent accelerators */
180 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800181@@ -1196,6 +1245,13 @@ psa_status_t psa_driver_wrapper_get_builtin_key(
Summer Qin614002c2023-01-19 15:22:39 +0800182
183
Raef Colesb97e0982022-02-28 11:29:56 +0000184 #endif /* PSA_CRYPTO_DRIVER_TEST */
185+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
186+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
Antonio de Angelis01a93bc2023-01-20 11:17:14 +0000187+ return( tfm_builtin_key_loader_get_builtin_key(
Raef Colesb97e0982022-02-28 11:29:56 +0000188+ slot_number,
189+ attributes,
190+ key_buffer, key_buffer_size, key_buffer_length ) );
191+#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */
192 default:
193 (void) slot_number;
194 (void) key_buffer;
Summer Qind635cd02023-03-31 18:07:38 +0800195@@ -1281,6 +1337,9 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
Raef Colesb97e0982022-02-28 11:29:56 +0000196 switch( location )
197 {
198 case PSA_KEY_LOCATION_LOCAL_STORAGE:
199+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
200+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
201+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
202 /* Key is stored in the slot in export representation, so
203 * cycle through all known transparent accelerators */
204 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800205@@ -1385,6 +1444,9 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
Raef Colesb97e0982022-02-28 11:29:56 +0000206 switch( location )
207 {
208 case PSA_KEY_LOCATION_LOCAL_STORAGE:
209+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
210+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
211+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
212 /* Key is stored in the slot in export representation, so
213 * cycle through all known transparent accelerators */
214 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800215@@ -1474,6 +1536,9 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
Raef Colesb97e0982022-02-28 11:29:56 +0000216 switch( location )
217 {
218 case PSA_KEY_LOCATION_LOCAL_STORAGE:
219+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
220+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
221+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
222 /* Key is stored in the slot in export representation, so
223 * cycle through all known transparent accelerators */
224 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800225@@ -1557,6 +1622,9 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
Raef Colesb97e0982022-02-28 11:29:56 +0000226 switch( location )
227 {
228 case PSA_KEY_LOCATION_LOCAL_STORAGE:
229+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
230+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
231+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
232 /* Key is stored in the slot in export representation, so
233 * cycle through all known transparent accelerators */
234 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800235@@ -2041,6 +2109,9 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
Raef Colesb97e0982022-02-28 11:29:56 +0000236 switch( location )
237 {
238 case PSA_KEY_LOCATION_LOCAL_STORAGE:
239+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
240+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
241+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
242 /* Key is stored in the slot in export representation, so
243 * cycle through all known transparent accelerators */
244
Summer Qind635cd02023-03-31 18:07:38 +0800245@@ -2104,6 +2175,9 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
Raef Colesb97e0982022-02-28 11:29:56 +0000246 switch( location )
247 {
248 case PSA_KEY_LOCATION_LOCAL_STORAGE:
249+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
250+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
251+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
252 /* Key is stored in the slot in export representation, so
253 * cycle through all known transparent accelerators */
254
Summer Qind635cd02023-03-31 18:07:38 +0800255@@ -2164,6 +2238,9 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
Raef Colesb97e0982022-02-28 11:29:56 +0000256 switch( location )
257 {
258 case PSA_KEY_LOCATION_LOCAL_STORAGE:
259+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
260+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
261+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
262 /* Key is stored in the slot in export representation, so
263 * cycle through all known transparent accelerators */
264
Summer Qind635cd02023-03-31 18:07:38 +0800265@@ -2221,6 +2298,9 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
Raef Colesb97e0982022-02-28 11:29:56 +0000266 switch( location )
267 {
268 case PSA_KEY_LOCATION_LOCAL_STORAGE:
269+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
270+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
271+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
272 /* Key is stored in the slot in export representation, so
273 * cycle through all known transparent accelerators */
274
Summer Qind635cd02023-03-31 18:07:38 +0800275@@ -2618,6 +2698,9 @@ psa_status_t psa_driver_wrapper_mac_compute(
Raef Colesb97e0982022-02-28 11:29:56 +0000276 switch( location )
277 {
278 case PSA_KEY_LOCATION_LOCAL_STORAGE:
279+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
280+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
281+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
282 /* Key is stored in the slot in export representation, so
283 * cycle through all known transparent accelerators */
284 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800285@@ -2688,6 +2771,9 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
Raef Colesb97e0982022-02-28 11:29:56 +0000286 switch( location )
287 {
288 case PSA_KEY_LOCATION_LOCAL_STORAGE:
289+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
290+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
291+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
292 /* Key is stored in the slot in export representation, so
293 * cycle through all known transparent accelerators */
294 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800295@@ -2769,6 +2855,9 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
Raef Colesb97e0982022-02-28 11:29:56 +0000296 switch( location )
297 {
298 case PSA_KEY_LOCATION_LOCAL_STORAGE:
299+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
300+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
301+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
302 /* Key is stored in the slot in export representation, so
303 * cycle through all known transparent accelerators */
304 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800305@@ -2997,6 +3086,9 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt(
Raef Colesb97e0982022-02-28 11:29:56 +0000306 switch( location )
307 {
308 case PSA_KEY_LOCATION_LOCAL_STORAGE:
309+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
310+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
311+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
312 /* Key is stored in the slot in export representation, so
313 * cycle through all known transparent accelerators */
314 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
Summer Qind635cd02023-03-31 18:07:38 +0800315@@ -3069,6 +3161,9 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
Raef Colesb97e0982022-02-28 11:29:56 +0000316 switch( location )
317 {
318 case PSA_KEY_LOCATION_LOCAL_STORAGE:
319+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
320+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
321+#endif /* defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER) */
322 /* Key is stored in the slot in export representation, so
323 * cycle through all known transparent accelerators */
324 #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
325--
Antonio de Angelis2718b582022-08-23 14:58:40 +01003262.25.1
Raef Colesb97e0982022-02-28 11:29:56 +0000327