blob: 7a36a4f3a5f5735603598b690b0253a5ca8e8952 [file] [log] [blame]
Gilles Peskinea899a722019-06-24 14:06:43 +02001/*
2 * PSA crypto support for secure element drivers
3 */
Bence Szépkúti86974652020-06-15 11:59:37 +02004/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02005 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +00006 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Gilles Peskinea899a722019-06-24 14:06:43 +02007 */
8
Gilles Peskinedb09ef62020-06-03 01:43:33 +02009#include "common.h"
Gilles Peskinea899a722019-06-24 14:06:43 +020010
Gilles Peskinea8ade162019-06-26 11:24:49 +020011#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
Gilles Peskinea899a722019-06-24 14:06:43 +020012
Gilles Peskine5243a202019-07-12 23:38:19 +020013#include <stdint.h>
Gilles Peskined0890212019-06-24 14:34:43 +020014#include <string.h>
15
Gilles Peskine5243a202019-07-12 23:38:19 +020016#include "psa/crypto_se_driver.h"
17
Gilles Peskinea899a722019-06-24 14:06:43 +020018#include "psa_crypto_se.h"
19
Gilles Peskine8b96cad2019-07-23 17:38:08 +020020#if defined(MBEDTLS_PSA_ITS_FILE_C)
21#include "psa_crypto_its.h"
22#else /* Native ITS implementation */
23#include "psa/error.h"
24#include "psa/internal_trusted_storage.h"
25#endif
26
Gilles Peskine5243a202019-07-12 23:38:19 +020027#include "mbedtls/platform.h"
Gilles Peskine5243a202019-07-12 23:38:19 +020028
29
30
Gilles Peskinef989dbe2019-06-26 18:18:12 +020031/****************************************************************/
32/* Driver lookup */
33/****************************************************************/
34
Gilles Peskine5243a202019-07-12 23:38:19 +020035/* This structure is identical to psa_drv_se_context_t declared in
36 * `crypto_se_driver.h`, except that some parts are writable here
37 * (non-const, or pointer to non-const). */
Gilles Peskine449bd832023-01-11 14:50:10 +010038typedef struct {
Gilles Peskine5243a202019-07-12 23:38:19 +020039 void *persistent_data;
40 size_t persistent_data_size;
41 uintptr_t transient_data;
42} psa_drv_se_internal_context_t;
43
Gilles Peskine449bd832023-01-11 14:50:10 +010044struct psa_se_drv_table_entry_s {
Gilles Peskine2b04f462020-05-10 00:44:04 +020045 psa_key_location_t location;
Gilles Peskinea899a722019-06-24 14:06:43 +020046 const psa_drv_se_t *methods;
Gilles Peskine449bd832023-01-11 14:50:10 +010047 union {
Gilles Peskine5243a202019-07-12 23:38:19 +020048 psa_drv_se_internal_context_t internal;
49 psa_drv_se_context_t context;
Gilles Peskine1a75d0c2020-04-14 19:33:25 +020050 } u;
Gilles Peskine01fd8752020-04-14 19:31:52 +020051};
Gilles Peskinea899a722019-06-24 14:06:43 +020052
Gilles Peskinef989dbe2019-06-26 18:18:12 +020053static psa_se_drv_table_entry_t driver_table[PSA_MAX_SE_DRIVERS];
54
Gilles Peskine5243a202019-07-12 23:38:19 +020055psa_se_drv_table_entry_t *psa_get_se_driver_entry(
Gilles Peskine449bd832023-01-11 14:50:10 +010056 psa_key_lifetime_t lifetime)
Gilles Peskinef989dbe2019-06-26 18:18:12 +020057{
58 size_t i;
Gilles Peskine449bd832023-01-11 14:50:10 +010059 psa_key_location_t location = PSA_KEY_LIFETIME_GET_LOCATION(lifetime);
Gilles Peskine2b04f462020-05-10 00:44:04 +020060 /* In the driver table, location=0 means an entry that isn't used.
61 * No driver has a location of 0 because it's a reserved value
62 * (which designates transparent keys). Make sure we never return
63 * a driver entry for location 0. */
Gilles Peskine449bd832023-01-11 14:50:10 +010064 if (location == 0) {
65 return NULL;
Gilles Peskinef989dbe2019-06-26 18:18:12 +020066 }
Gilles Peskine449bd832023-01-11 14:50:10 +010067 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
68 if (driver_table[i].location == location) {
69 return &driver_table[i];
70 }
71 }
72 return NULL;
Gilles Peskinef989dbe2019-06-26 18:18:12 +020073}
74
75const psa_drv_se_t *psa_get_se_driver_methods(
Gilles Peskine449bd832023-01-11 14:50:10 +010076 const psa_se_drv_table_entry_t *driver)
Gilles Peskinef989dbe2019-06-26 18:18:12 +020077{
Gilles Peskine449bd832023-01-11 14:50:10 +010078 return driver->methods;
Gilles Peskinef989dbe2019-06-26 18:18:12 +020079}
80
Gilles Peskine5243a202019-07-12 23:38:19 +020081psa_drv_se_context_t *psa_get_se_driver_context(
Gilles Peskine449bd832023-01-11 14:50:10 +010082 psa_se_drv_table_entry_t *driver)
Gilles Peskinef989dbe2019-06-26 18:18:12 +020083{
Gilles Peskine449bd832023-01-11 14:50:10 +010084 return &driver->u.context;
Gilles Peskinef989dbe2019-06-26 18:18:12 +020085}
86
Gilles Peskine449bd832023-01-11 14:50:10 +010087int psa_get_se_driver(psa_key_lifetime_t lifetime,
88 const psa_drv_se_t **p_methods,
89 psa_drv_se_context_t **p_drv_context)
Gilles Peskine5243a202019-07-12 23:38:19 +020090{
Gilles Peskine449bd832023-01-11 14:50:10 +010091 psa_se_drv_table_entry_t *driver = psa_get_se_driver_entry(lifetime);
92 if (p_methods != NULL) {
93 *p_methods = (driver ? driver->methods : NULL);
94 }
95 if (p_drv_context != NULL) {
96 *p_drv_context = (driver ? &driver->u.context : NULL);
97 }
98 return driver != NULL;
Gilles Peskine5243a202019-07-12 23:38:19 +020099}
100
101
102
103/****************************************************************/
104/* Persistent data management */
105/****************************************************************/
106
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200107static psa_status_t psa_get_se_driver_its_file_uid(
108 const psa_se_drv_table_entry_t *driver,
Gilles Peskine449bd832023-01-11 14:50:10 +0100109 psa_storage_uid_t *uid)
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200110{
Gilles Peskine449bd832023-01-11 14:50:10 +0100111 if (driver->location > PSA_MAX_SE_LOCATION) {
112 return PSA_ERROR_NOT_SUPPORTED;
113 }
Gilles Peskine573bbc12019-07-23 19:59:23 +0200114
Gilles Peskine573bbc12019-07-23 19:59:23 +0200115 /* ITS file sizes are limited to 32 bits. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100116 if (driver->u.internal.persistent_data_size > UINT32_MAX) {
117 return PSA_ERROR_NOT_SUPPORTED;
118 }
Gilles Peskine573bbc12019-07-23 19:59:23 +0200119
Gilles Peskine75c126b2019-07-24 15:56:01 +0200120 /* See the documentation of PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE. */
Gilles Peskine2b04f462020-05-10 00:44:04 +0200121 *uid = PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE + driver->location;
Gilles Peskine449bd832023-01-11 14:50:10 +0100122 return PSA_SUCCESS;
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200123}
124
Gilles Peskine5243a202019-07-12 23:38:19 +0200125psa_status_t psa_load_se_persistent_data(
Gilles Peskine449bd832023-01-11 14:50:10 +0100126 const psa_se_drv_table_entry_t *driver)
Gilles Peskine5243a202019-07-12 23:38:19 +0200127{
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200128 psa_status_t status;
129 psa_storage_uid_t uid;
Gilles Peskine8b663892019-07-31 17:57:57 +0200130 size_t length;
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200131
Gilles Peskine449bd832023-01-11 14:50:10 +0100132 status = psa_get_se_driver_its_file_uid(driver, &uid);
133 if (status != PSA_SUCCESS) {
134 return status;
135 }
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200136
Gilles Peskine8b663892019-07-31 17:57:57 +0200137 /* Read the amount of persistent data that the driver requests.
138 * If the data in storage is larger, it is truncated. If the data
139 * in storage is smaller, silently keep what is already at the end
140 * of the output buffer. */
Gilles Peskine75c126b2019-07-24 15:56:01 +0200141 /* psa_get_se_driver_its_file_uid ensures that the size_t
142 * persistent_data_size is in range, but compilers don't know that,
143 * so cast to reassure them. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100144 return psa_its_get(uid, 0,
145 (uint32_t) driver->u.internal.persistent_data_size,
146 driver->u.internal.persistent_data,
147 &length);
Gilles Peskine5243a202019-07-12 23:38:19 +0200148}
149
150psa_status_t psa_save_se_persistent_data(
Gilles Peskine449bd832023-01-11 14:50:10 +0100151 const psa_se_drv_table_entry_t *driver)
Gilles Peskine5243a202019-07-12 23:38:19 +0200152{
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200153 psa_status_t status;
154 psa_storage_uid_t uid;
155
Gilles Peskine449bd832023-01-11 14:50:10 +0100156 status = psa_get_se_driver_its_file_uid(driver, &uid);
157 if (status != PSA_SUCCESS) {
158 return status;
159 }
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200160
Gilles Peskine75c126b2019-07-24 15:56:01 +0200161 /* psa_get_se_driver_its_file_uid ensures that the size_t
162 * persistent_data_size is in range, but compilers don't know that,
163 * so cast to reassure them. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100164 return psa_its_set(uid,
165 (uint32_t) driver->u.internal.persistent_data_size,
166 driver->u.internal.persistent_data,
167 0);
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200168}
169
Gilles Peskine449bd832023-01-11 14:50:10 +0100170psa_status_t psa_destroy_se_persistent_data(psa_key_location_t location)
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200171{
172 psa_storage_uid_t uid;
Gilles Peskine449bd832023-01-11 14:50:10 +0100173 if (location > PSA_MAX_SE_LOCATION) {
174 return PSA_ERROR_NOT_SUPPORTED;
175 }
Gilles Peskine2b04f462020-05-10 00:44:04 +0200176 uid = PSA_CRYPTO_SE_DRIVER_ITS_UID_BASE + location;
Gilles Peskine449bd832023-01-11 14:50:10 +0100177 return psa_its_remove(uid);
Gilles Peskine5243a202019-07-12 23:38:19 +0200178}
Gilles Peskinef989dbe2019-06-26 18:18:12 +0200179
Gilles Peskinecbaff462019-07-12 23:46:04 +0200180psa_status_t psa_find_se_slot_for_key(
181 const psa_key_attributes_t *attributes,
Gilles Peskinee88c2c12019-08-05 16:44:14 +0200182 psa_key_creation_method_t method,
Gilles Peskinecbaff462019-07-12 23:46:04 +0200183 psa_se_drv_table_entry_t *driver,
Gilles Peskine449bd832023-01-11 14:50:10 +0100184 psa_key_slot_number_t *slot_number)
Gilles Peskinecbaff462019-07-12 23:46:04 +0200185{
186 psa_status_t status;
Gilles Peskine2b04f462020-05-10 00:44:04 +0200187 psa_key_location_t key_location =
Gilles Peskine449bd832023-01-11 14:50:10 +0100188 PSA_KEY_LIFETIME_GET_LOCATION(psa_get_key_lifetime(attributes));
Gilles Peskinecbaff462019-07-12 23:46:04 +0200189
Gilles Peskine2b04f462020-05-10 00:44:04 +0200190 /* If the location is wrong, it's a bug in the library. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100191 if (driver->location != key_location) {
192 return PSA_ERROR_CORRUPTION_DETECTED;
193 }
Gilles Peskinecbaff462019-07-12 23:46:04 +0200194
195 /* If the driver doesn't support key creation in any way, give up now. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100196 if (driver->methods->key_management == NULL) {
197 return PSA_ERROR_NOT_SUPPORTED;
198 }
Gilles Peskinecbaff462019-07-12 23:46:04 +0200199
Gilles Peskine449bd832023-01-11 14:50:10 +0100200 if (psa_get_key_slot_number(attributes, slot_number) == PSA_SUCCESS) {
Gilles Peskine46d94392019-08-05 14:55:50 +0200201 /* The application wants to use a specific slot. Allow it if
202 * the driver supports it. On a system with isolation,
203 * the crypto service must check that the application is
204 * permitted to request this slot. */
205 psa_drv_se_validate_slot_number_t p_validate_slot_number =
206 driver->methods->key_management->p_validate_slot_number;
Gilles Peskine449bd832023-01-11 14:50:10 +0100207 if (p_validate_slot_number == NULL) {
208 return PSA_ERROR_NOT_SUPPORTED;
209 }
210 status = p_validate_slot_number(&driver->u.context,
211 driver->u.internal.persistent_data,
212 attributes, method,
213 *slot_number);
214 } else if (method == PSA_KEY_CREATION_REGISTER) {
Gilles Peskine3efcebb2019-10-01 14:18:35 +0200215 /* The application didn't specify a slot number. This doesn't
216 * make sense when registering a slot. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100217 return PSA_ERROR_INVALID_ARGUMENT;
218 } else {
Gilles Peskine46d94392019-08-05 14:55:50 +0200219 /* The application didn't tell us which slot to use. Let the driver
220 * choose. This is the normal case. */
221 psa_drv_se_allocate_key_t p_allocate =
222 driver->methods->key_management->p_allocate;
Gilles Peskine449bd832023-01-11 14:50:10 +0100223 if (p_allocate == NULL) {
224 return PSA_ERROR_NOT_SUPPORTED;
225 }
226 status = p_allocate(&driver->u.context,
227 driver->u.internal.persistent_data,
228 attributes, method,
229 slot_number);
Gilles Peskine46d94392019-08-05 14:55:50 +0200230 }
Gilles Peskine449bd832023-01-11 14:50:10 +0100231 return status;
Gilles Peskinecbaff462019-07-12 23:46:04 +0200232}
233
Gilles Peskine449bd832023-01-11 14:50:10 +0100234psa_status_t psa_destroy_se_key(psa_se_drv_table_entry_t *driver,
235 psa_key_slot_number_t slot_number)
Gilles Peskine354f7672019-07-12 23:46:38 +0200236{
237 psa_status_t status;
238 psa_status_t storage_status;
Gilles Peskine340b1272019-07-25 14:13:24 +0200239 /* Normally a missing method would mean that the action is not
240 * supported. But psa_destroy_key() is not supposed to return
241 * PSA_ERROR_NOT_SUPPORTED: if you can create a key, you should
242 * be able to destroy it. The only use case for a driver that
243 * does not have a way to destroy keys at all is if the keys are
244 * locked in a read-only state: we can use the keys but not
245 * destroy them. Hence, if the driver doesn't support destroying
246 * keys, it's really a lack of permission. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100247 if (driver->methods->key_management == NULL ||
248 driver->methods->key_management->p_destroy == NULL) {
249 return PSA_ERROR_NOT_PERMITTED;
250 }
Gilles Peskine354f7672019-07-12 23:46:38 +0200251 status = driver->methods->key_management->p_destroy(
Gilles Peskine1a75d0c2020-04-14 19:33:25 +0200252 &driver->u.context,
253 driver->u.internal.persistent_data,
Gilles Peskine449bd832023-01-11 14:50:10 +0100254 slot_number);
255 storage_status = psa_save_se_persistent_data(driver);
256 return status == PSA_SUCCESS ? storage_status : status;
Gilles Peskine354f7672019-07-12 23:46:38 +0200257}
258
Gilles Peskine449bd832023-01-11 14:50:10 +0100259psa_status_t psa_init_all_se_drivers(void)
Gilles Peskined9348f22019-10-01 15:22:29 +0200260{
261 size_t i;
Gilles Peskine449bd832023-01-11 14:50:10 +0100262 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
Gilles Peskined9348f22019-10-01 15:22:29 +0200263 psa_se_drv_table_entry_t *driver = &driver_table[i];
Gilles Peskine449bd832023-01-11 14:50:10 +0100264 if (driver->location == 0) {
Gilles Peskined9348f22019-10-01 15:22:29 +0200265 continue; /* skipping unused entry */
Gilles Peskine449bd832023-01-11 14:50:10 +0100266 }
267 const psa_drv_se_t *methods = psa_get_se_driver_methods(driver);
268 if (methods->p_init != NULL) {
Gilles Peskined9348f22019-10-01 15:22:29 +0200269 psa_status_t status = methods->p_init(
Gilles Peskine1a75d0c2020-04-14 19:33:25 +0200270 &driver->u.context,
271 driver->u.internal.persistent_data,
Gilles Peskine449bd832023-01-11 14:50:10 +0100272 driver->location);
273 if (status != PSA_SUCCESS) {
274 return status;
275 }
276 status = psa_save_se_persistent_data(driver);
277 if (status != PSA_SUCCESS) {
278 return status;
279 }
Gilles Peskined9348f22019-10-01 15:22:29 +0200280 }
281 }
Gilles Peskine449bd832023-01-11 14:50:10 +0100282 return PSA_SUCCESS;
Gilles Peskined9348f22019-10-01 15:22:29 +0200283}
284
Gilles Peskinef989dbe2019-06-26 18:18:12 +0200285
286
287/****************************************************************/
288/* Driver registration */
289/****************************************************************/
Gilles Peskinea899a722019-06-24 14:06:43 +0200290
291psa_status_t psa_register_se_driver(
Gilles Peskine2b04f462020-05-10 00:44:04 +0200292 psa_key_location_t location,
Gilles Peskinea899a722019-06-24 14:06:43 +0200293 const psa_drv_se_t *methods)
294{
295 size_t i;
Gilles Peskine5243a202019-07-12 23:38:19 +0200296 psa_status_t status;
Gilles Peskinea899a722019-06-24 14:06:43 +0200297
Gilles Peskine449bd832023-01-11 14:50:10 +0100298 if (methods->hal_version != PSA_DRV_SE_HAL_VERSION) {
299 return PSA_ERROR_NOT_SUPPORTED;
300 }
Gilles Peskine9717d102019-06-26 11:50:04 +0200301 /* Driver table entries are 0-initialized. 0 is not a valid driver
Gilles Peskine2b04f462020-05-10 00:44:04 +0200302 * location because it means a transparent key. */
Tom Cosgrove6ef9bb32023-03-08 14:19:51 +0000303 MBEDTLS_STATIC_ASSERT(PSA_KEY_LOCATION_LOCAL_STORAGE == 0,
304 "Secure element support requires 0 to mean a local key");
305
Gilles Peskine449bd832023-01-11 14:50:10 +0100306 if (location == PSA_KEY_LOCATION_LOCAL_STORAGE) {
307 return PSA_ERROR_INVALID_ARGUMENT;
308 }
309 if (location > PSA_MAX_SE_LOCATION) {
310 return PSA_ERROR_NOT_SUPPORTED;
311 }
Gilles Peskinea899a722019-06-24 14:06:43 +0200312
Gilles Peskine449bd832023-01-11 14:50:10 +0100313 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
314 if (driver_table[i].location == 0) {
Gilles Peskinea899a722019-06-24 14:06:43 +0200315 break;
Gilles Peskine449bd832023-01-11 14:50:10 +0100316 }
Gilles Peskine2b04f462020-05-10 00:44:04 +0200317 /* Check that location isn't already in use up to the first free
Gilles Peskinea899a722019-06-24 14:06:43 +0200318 * entry. Since entries are created in order and never deleted,
319 * there can't be a used entry after the first free entry. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100320 if (driver_table[i].location == location) {
321 return PSA_ERROR_ALREADY_EXISTS;
322 }
Gilles Peskinea899a722019-06-24 14:06:43 +0200323 }
Gilles Peskine449bd832023-01-11 14:50:10 +0100324 if (i == PSA_MAX_SE_DRIVERS) {
325 return PSA_ERROR_INSUFFICIENT_MEMORY;
326 }
Gilles Peskinea899a722019-06-24 14:06:43 +0200327
Gilles Peskine2b04f462020-05-10 00:44:04 +0200328 driver_table[i].location = location;
Gilles Peskinea899a722019-06-24 14:06:43 +0200329 driver_table[i].methods = methods;
Gilles Peskine1a75d0c2020-04-14 19:33:25 +0200330 driver_table[i].u.internal.persistent_data_size =
Gilles Peskined5536d82019-10-01 16:55:29 +0200331 methods->persistent_data_size;
Gilles Peskine5243a202019-07-12 23:38:19 +0200332
Gilles Peskine449bd832023-01-11 14:50:10 +0100333 if (methods->persistent_data_size != 0) {
Gilles Peskine1a75d0c2020-04-14 19:33:25 +0200334 driver_table[i].u.internal.persistent_data =
Gilles Peskine449bd832023-01-11 14:50:10 +0100335 mbedtls_calloc(1, methods->persistent_data_size);
336 if (driver_table[i].u.internal.persistent_data == NULL) {
Gilles Peskine5243a202019-07-12 23:38:19 +0200337 status = PSA_ERROR_INSUFFICIENT_MEMORY;
338 goto error;
339 }
Gilles Peskine8b96cad2019-07-23 17:38:08 +0200340 /* Load the driver's persistent data. On first use, the persistent
341 * data does not exist in storage, and is initialized to
342 * all-bits-zero by the calloc call just above. */
Gilles Peskine449bd832023-01-11 14:50:10 +0100343 status = psa_load_se_persistent_data(&driver_table[i]);
344 if (status != PSA_SUCCESS && status != PSA_ERROR_DOES_NOT_EXIST) {
Gilles Peskine5243a202019-07-12 23:38:19 +0200345 goto error;
Gilles Peskine449bd832023-01-11 14:50:10 +0100346 }
Gilles Peskine5243a202019-07-12 23:38:19 +0200347 }
Gilles Peskine5243a202019-07-12 23:38:19 +0200348
Gilles Peskine449bd832023-01-11 14:50:10 +0100349 return PSA_SUCCESS;
Gilles Peskine5243a202019-07-12 23:38:19 +0200350
351error:
Gilles Peskine449bd832023-01-11 14:50:10 +0100352 memset(&driver_table[i], 0, sizeof(driver_table[i]));
353 return status;
Gilles Peskinea899a722019-06-24 14:06:43 +0200354}
355
Gilles Peskine449bd832023-01-11 14:50:10 +0100356void psa_unregister_all_se_drivers(void)
Gilles Peskined0890212019-06-24 14:34:43 +0200357{
Gilles Peskine5243a202019-07-12 23:38:19 +0200358 size_t i;
Gilles Peskine449bd832023-01-11 14:50:10 +0100359 for (i = 0; i < PSA_MAX_SE_DRIVERS; i++) {
360 if (driver_table[i].u.internal.persistent_data != NULL) {
361 mbedtls_free(driver_table[i].u.internal.persistent_data);
362 }
Gilles Peskine5243a202019-07-12 23:38:19 +0200363 }
Gilles Peskine449bd832023-01-11 14:50:10 +0100364 memset(driver_table, 0, sizeof(driver_table));
Gilles Peskined0890212019-06-24 14:34:43 +0200365}
366
Gilles Peskinef989dbe2019-06-26 18:18:12 +0200367
368
369/****************************************************************/
370/* The end */
371/****************************************************************/
372
Gilles Peskinea8ade162019-06-26 11:24:49 +0200373#endif /* MBEDTLS_PSA_CRYPTO_SE_C */