TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
crypto_key.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #include <stddef.h>
9 #include <stdint.h>
10 
11 #include "tfm_mbedcrypto_include.h"
12 
13 #include "tfm_crypto_api.h"
14 #include "tfm_crypto_defs.h"
15 #include "tfm_crypto_private.h"
16 #include <stdbool.h>
17 
18 #ifndef TFM_CRYPTO_MAX_KEY_HANDLES
19 #define TFM_CRYPTO_MAX_KEY_HANDLES (16)
20 #endif
22  int32_t owner;
24  uint8_t in_use;
25 };
26 
27 #ifndef TFM_CRYPTO_KEY_MODULE_DISABLED
28 static struct tfm_crypto_handle_owner_s
29  handle_owner[TFM_CRYPTO_MAX_KEY_HANDLES] = {0};
30 #endif
31 
38  const struct psa_client_key_attributes_s *client_key_attr,
39  int32_t client_id,
40  psa_key_attributes_t *key_attributes)
41 {
42  if (client_key_attr == NULL || key_attributes == NULL) {
44  }
45 
46  *key_attributes = psa_key_attributes_init();
47 
48  /* Copy core key attributes from the client core key attributes */
49  key_attributes->core.type = client_key_attr->type;
50  key_attributes->core.lifetime = client_key_attr->lifetime;
51  key_attributes->core.policy.usage = client_key_attr->usage;
52  key_attributes->core.policy.alg = client_key_attr->alg;
53  key_attributes->core.bits = client_key_attr->bits;
54 
55  /* Use the client key id as the key_id and its partition id as the owner */
56  key_attributes->core.id.key_id = client_key_attr->id;
57  key_attributes->core.id.owner = client_id;
58 
59  return PSA_SUCCESS;
60 }
61 
63  const psa_key_attributes_t *key_attributes,
64  struct psa_client_key_attributes_s *client_key_attr)
65 {
66  if (client_key_attr == NULL || key_attributes == NULL) {
68  }
69 
71  *client_key_attr = v;
72 
73  /* Copy core key attributes from the client core key attributes */
74  client_key_attr->type = key_attributes->core.type;
75  client_key_attr->lifetime = key_attributes->core.lifetime;
76  client_key_attr->usage = key_attributes->core.policy.usage;
77  client_key_attr->alg = key_attributes->core.policy.alg;
78  client_key_attr->bits = key_attributes->core.bits;
79 
80  /* Return the key_id as the client key id, do not return the owner */
81  client_key_attr->id = key_attributes->core.id.key_id;
82 
83  return PSA_SUCCESS;
84 }
85 
87  uint32_t *index)
88 {
89 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
91 #else
92  int32_t partition_id = 0;
93  uint32_t i = 0;
94  psa_status_t status;
95 
96  status = tfm_crypto_get_caller_id(&partition_id);
97  if (status != PSA_SUCCESS) {
98  return status;
99  }
100 
101  for (i = 0; i < TFM_CRYPTO_MAX_KEY_HANDLES; i++) {
102  if (handle_owner[i].in_use && handle_owner[i].handle == handle) {
103  if (handle_owner[i].owner == partition_id) {
104  if (index != NULL) {
105  *index = i;
106  }
107  return PSA_SUCCESS;
108  } else {
110  }
111  }
112  }
113 
115 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
116 }
117 
119 {
120 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
122 #else
123  uint32_t i;
124 
125  for (i = 0; i < TFM_CRYPTO_MAX_KEY_HANDLES; i++) {
126  if (handle_owner[i].in_use == TFM_CRYPTO_NOT_IN_USE) {
127  *index = i;
128  return PSA_SUCCESS;
129  }
130  }
131 
133 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
134 }
135 
137  psa_key_handle_t key_handle)
138 {
139 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
141 #else
142  psa_status_t status;
143  int32_t partition_id;
144 
145  status = tfm_crypto_get_caller_id(&partition_id);
146  if (status != PSA_SUCCESS) {
147  return status;
148  }
149 
150  handle_owner[index].owner = partition_id;
151  handle_owner[index].handle = key_handle;
152  handle_owner[index].in_use = TFM_CRYPTO_IN_USE;
153 
154  return PSA_SUCCESS;
155 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
156 }
157 
159  size_t in_len,
160  psa_outvec out_vec[],
161  size_t out_len)
162 {
163 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
165 #else
166  /* FixMe: To be implemented */
168 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
169 }
170 
172  size_t in_len,
173  psa_outvec out_vec[],
174  size_t out_len)
175 {
176 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
178 #else
179  /* FixMe: To be implemented */
181 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
182 }
183 
185  size_t in_len,
186  psa_outvec out_vec[],
187  size_t out_len)
188 {
189 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
191 #else
192 
193  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 2, 3, out_len, 1, 1);
194 
195  if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
196  (in_vec[1].len != sizeof(struct psa_client_key_attributes_s)) ||
197  (out_vec[0].len != sizeof(psa_key_handle_t))) {
199  }
200  const struct psa_client_key_attributes_s *client_key_attr = in_vec[1].base;
201  const uint8_t *data = in_vec[2].base;
202  size_t data_length = in_vec[2].len;
203  psa_key_handle_t *key_handle = out_vec[0].base;
204  psa_status_t status;
206  uint32_t i = 0;
207  int32_t partition_id = 0;
208  bool empty_found = false;
209 
210  for (i = 0; i < TFM_CRYPTO_MAX_KEY_HANDLES; i++) {
211  if (handle_owner[i].in_use == TFM_CRYPTO_NOT_IN_USE) {
212  empty_found = true;
213  break;
214  }
215  }
216 
217  if (!empty_found) {
219  }
220 
221  status = tfm_crypto_get_caller_id(&partition_id);
222  if (status != PSA_SUCCESS) {
223  return status;
224  }
225 
226  status = tfm_crypto_key_attributes_from_client(client_key_attr,
227  partition_id,
228  &key_attributes);
229  if (status != PSA_SUCCESS) {
230  return status;
231  }
232 
233  status = psa_import_key(&key_attributes, data, data_length, key_handle);
234 
235  if (status == PSA_SUCCESS) {
236  handle_owner[i].owner = partition_id;
237  handle_owner[i].handle = *key_handle;
238  handle_owner[i].in_use = TFM_CRYPTO_IN_USE;
239  }
240 
241  return status;
242 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
243 }
244 
246  size_t in_len,
247  psa_outvec out_vec[],
248  size_t out_len)
249 {
250 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
252 #else
253 
254  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 2, 2, out_len, 1, 1);
255 
256  if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
257  (in_vec[1].len != sizeof(psa_app_key_id_t)) ||
258  (out_vec[0].len != sizeof(psa_key_handle_t))) {
260  }
261 
262  psa_app_key_id_t client_key_id = *((psa_app_key_id_t *)in_vec[1].base);
263  psa_key_handle_t *key_handle = out_vec[0].base;
264  psa_status_t status;
266  int32_t partition_id;
267  uint32_t i;
268 
269  for (i = 0; i < TFM_CRYPTO_MAX_KEY_HANDLES; i++) {
270  if (handle_owner[i].in_use == TFM_CRYPTO_NOT_IN_USE) {
271  break;
272  }
273  }
274 
275  if (i == TFM_CRYPTO_MAX_KEY_HANDLES) {
277  }
278 
279  status = tfm_crypto_get_caller_id(&partition_id);
280  if (status != PSA_SUCCESS) {
281  return status;
282  }
283 
284  /* Use the client key id as the key_id and its partition id as the owner */
285  id = (psa_key_id_t){ .key_id = client_key_id, .owner = partition_id };
286 
287  status = psa_open_key(id, key_handle);
288 
289  if (status == PSA_SUCCESS) {
290  handle_owner[i].owner = partition_id;
291  handle_owner[i].handle = *key_handle;
292  handle_owner[i].in_use = TFM_CRYPTO_IN_USE;
293  }
294 
295  return status;
296 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
297 }
298 
300  size_t in_len,
301  psa_outvec out_vec[],
302  size_t out_len)
303 {
304 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
306 #else
307  (void)out_vec;
308 
309  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 0, 0);
310 
311  if (in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) {
313  }
314  const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
315 
316  psa_key_handle_t key = iov->key_handle;
317  uint32_t index;
318  psa_status_t status = tfm_crypto_check_handle_owner(key, &index);
319 
320  if (status != PSA_SUCCESS) {
321  return status;
322  }
323 
324  status = psa_close_key(key);
325 
326  if (status == PSA_SUCCESS) {
327  handle_owner[index].owner = 0;
328  handle_owner[index].handle = 0;
329  handle_owner[index].in_use = TFM_CRYPTO_NOT_IN_USE;
330  }
331 
332  return status;
333 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
334 }
335 
337  size_t in_len,
338  psa_outvec out_vec[],
339  size_t out_len)
340 {
341 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
343 #else
344  (void)out_vec;
345 
346  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 0, 0);
347 
348  if (in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) {
350  }
351  const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
352 
353  psa_key_handle_t key = iov->key_handle;
354  uint32_t index;
355  psa_status_t status = tfm_crypto_check_handle_owner(key, &index);
356 
357  if (status != PSA_SUCCESS) {
358  return status;
359  }
360 
361  status = psa_destroy_key(key);
362 
363  if (status == PSA_SUCCESS) {
364  handle_owner[index].owner = 0;
365  handle_owner[index].handle = 0;
366  handle_owner[index].in_use = TFM_CRYPTO_NOT_IN_USE;
367  }
368 
369  return status;
370 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
371 }
372 
374  size_t in_len,
375  psa_outvec out_vec[],
376  size_t out_len)
377 {
378 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
380 #else
381 
382  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 1, 1);
383 
384  if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
385  (out_vec[0].len != sizeof(struct psa_client_key_attributes_s))) {
387  }
388  const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
389 
390  psa_key_handle_t key = iov->key_handle;
391  struct psa_client_key_attributes_s *client_key_attr = out_vec[0].base;
392  psa_status_t status;
394 
395  status = tfm_crypto_check_handle_owner(key, NULL);
396  if (status != PSA_SUCCESS) {
397  return status;
398  }
399 
400  status = psa_get_key_attributes(key, &key_attributes);
401 
402  if (status == PSA_SUCCESS) {
403  status = tfm_crypto_key_attributes_to_client(&key_attributes,
404  client_key_attr);
405  }
406 
407  return status;
408 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
409 }
410 
412  size_t in_len,
413  psa_outvec out_vec[],
414  size_t out_len)
415 {
416 #if (TFM_CRYPTO_KEY_MODULE_DISABLED != 0)
418 #else
419 
420  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 1, 1);
421 
422  if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
423  (out_vec[0].len != sizeof(struct psa_client_key_attributes_s))) {
425  }
426 
427  struct psa_client_key_attributes_s *client_key_attr = out_vec[0].base;
428  psa_status_t status;
430  int32_t partition_id;
431 
432  status = tfm_crypto_get_caller_id(&partition_id);
433  if (status != PSA_SUCCESS) {
434  return status;
435  }
436 
437  status = tfm_crypto_key_attributes_from_client(client_key_attr,
438  partition_id,
439  &key_attributes);
440  if (status != PSA_SUCCESS) {
441  return status;
442  }
443 
444  psa_reset_key_attributes(&key_attributes);
445 
446  return tfm_crypto_key_attributes_to_client(&key_attributes,
447  client_key_attr);
448 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
449 }
450 
452  size_t in_len,
453  psa_outvec out_vec[],
454  size_t out_len)
455 {
456 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
458 #else
459 
460  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 0, 1);
461 
462  if (in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) {
464  }
465  const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
466 
467  psa_key_handle_t key = iov->key_handle;
468  uint8_t *data = out_vec[0].base;
469  size_t data_size = out_vec[0].len;
470 
471  return psa_export_key(key, data, data_size, &(out_vec[0].len));
472 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
473 }
474 
476  size_t in_len,
477  psa_outvec out_vec[],
478  size_t out_len)
479 {
480 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
482 #else
483 
484  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 1, 1, out_len, 0, 1);
485 
486  if (in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) {
488  }
489  const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
490 
491  psa_key_handle_t key = iov->key_handle;
492  uint8_t *data = out_vec[0].base;
493  size_t data_size = out_vec[0].len;
494 
495  return psa_export_public_key(key, data, data_size, &(out_vec[0].len));
496 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
497 }
498 
500  size_t in_len,
501  psa_outvec out_vec[],
502  size_t out_len)
503 {
504 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
506 #else
507 
508  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 2, 2, out_len, 1, 1);
509 
510  if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
511  (out_vec[0].len != sizeof(psa_key_handle_t)) ||
512  (in_vec[1].len != sizeof(struct psa_client_key_attributes_s))) {
514  }
515  const struct tfm_crypto_pack_iovec *iov = in_vec[0].base;
516 
517  psa_key_handle_t source_handle = iov->key_handle;
518  psa_key_handle_t *target_handle = out_vec[0].base;
519  const struct psa_client_key_attributes_s *client_key_attr = in_vec[1].base;
520  psa_status_t status;
522  uint32_t i = 0;
523  int32_t partition_id = 0;
524  bool empty_found = false;
525 
526  for (i = 0; i < TFM_CRYPTO_MAX_KEY_HANDLES; i++) {
527  if (handle_owner[i].in_use == TFM_CRYPTO_NOT_IN_USE) {
528  empty_found = true;
529  break;
530  }
531  }
532 
533  if (!empty_found) {
535  }
536 
537  status = tfm_crypto_get_caller_id(&partition_id);
538  if (status != PSA_SUCCESS) {
539  return status;
540  }
541 
542  status = tfm_crypto_key_attributes_from_client(client_key_attr,
543  partition_id,
544  &key_attributes);
545  if (status != PSA_SUCCESS) {
546  return status;
547  }
548 
549  status = psa_copy_key(source_handle, &key_attributes, target_handle);
550 
551  if (status == PSA_SUCCESS) {
552  handle_owner[i].owner = partition_id;
553  handle_owner[i].handle = *target_handle;
554  handle_owner[i].in_use = TFM_CRYPTO_IN_USE;
555  }
556 
557  return status;
558 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
559 }
560 
562  size_t in_len,
563  psa_outvec out_vec[],
564  size_t out_len)
565 {
566 #ifdef TFM_CRYPTO_KEY_MODULE_DISABLED
568 #else
569 
570  CRYPTO_IN_OUT_LEN_VALIDATE(in_len, 2, 2, out_len, 1, 1);
571 
572  if ((in_vec[0].len != sizeof(struct tfm_crypto_pack_iovec)) ||
573  (in_vec[1].len != sizeof(struct psa_client_key_attributes_s)) ||
574  (out_vec[0].len != sizeof(psa_key_handle_t))) {
576  }
577  psa_key_handle_t *key_handle = out_vec[0].base;
578  const struct psa_client_key_attributes_s *client_key_attr = in_vec[1].base;
579  psa_status_t status;
581  uint32_t i = 0;
582  int32_t partition_id = 0;
583  bool empty_found = false;
584 
585  for (i = 0; i < TFM_CRYPTO_MAX_KEY_HANDLES; i++) {
586  if (handle_owner[i].in_use == TFM_CRYPTO_NOT_IN_USE) {
587  empty_found = true;
588  break;
589  }
590  }
591 
592  if (!empty_found) {
594  }
595 
596  status = tfm_crypto_get_caller_id(&partition_id);
597  if (status != PSA_SUCCESS) {
598  return status;
599  }
600 
601  status = tfm_crypto_key_attributes_from_client(client_key_attr,
602  partition_id,
603  &key_attributes);
604  if (status != PSA_SUCCESS) {
605  return status;
606  }
607 
608  status = psa_generate_key(&key_attributes, key_handle);
609 
610  if (status == PSA_SUCCESS) {
611  handle_owner[i].owner = partition_id;
612  handle_owner[i].handle = *key_handle;
613  handle_owner[i].in_use = TFM_CRYPTO_IN_USE;
614  }
615 
616  return status;
617 #endif /* TFM_CRYPTO_KEY_MODULE_DISABLED */
618 }
psa_key_handle_t key_handle
psa_status_t tfm_crypto_check_handle_owner(psa_key_handle_t handle, uint32_t *index)
Checks that the requested handle belongs to the requesting partition.
Definition: crypto_key.c:86
psa_status_t tfm_crypto_import_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:184
Structure used to pack non-pointer types in a call.
void * base
Definition: client.h:75
psa_status_t tfm_crypto_export_public_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:475
#define PSA_SUCCESS
Definition: crypto_values.h:35
psa_status_t tfm_crypto_open_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:245
size_t len
Definition: client.h:68
#define PSA_CLIENT_KEY_ATTRIBUTES_INIT
psa_status_t tfm_crypto_key_attributes_to_client(const psa_key_attributes_t *key_attributes, struct psa_client_key_attributes_s *client_key_attr)
Converts key attributes to client key attributes.
Definition: crypto_key.c:62
psa_status_t tfm_crypto_key_attributes_from_client(const struct psa_client_key_attributes_s *client_key_attr, int32_t client_id, psa_key_attributes_t *key_attributes)
Gets key attributes from client key attributes.
Definition: crypto_key.c:37
uint32_t psa_key_id_t
Definition: crypto_types.h:223
psa_status_t tfm_crypto_close_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:299
#define psa_reset_key_attributes
Definition: crypto_spe.h:63
psa_status_t tfm_crypto_get_key_attributes(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:373
#define PSA_KEY_ATTRIBUTES_INIT
Definition: crypto.h:113
#define TFM_CRYPTO_MAX_KEY_HANDLES
Definition: crypto_key.c:19
#define PSA_ERROR_INSUFFICIENT_MEMORY
psa_status_t tfm_crypto_export_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:451
#define psa_copy_key
Definition: crypto_spe.h:69
#define psa_get_key_attributes
Definition: crypto_spe.h:61
psa_status_t tfm_crypto_get_caller_id(int32_t *id)
Returns the ID of the caller.
Definition: crypto_init.c:314
#define psa_import_key
Definition: crypto_spe.h:57
psa_status_t tfm_crypto_destroy_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:336
#define psa_open_key
Definition: crypto_spe.h:53
#define PSA_ERROR_NOT_PERMITTED
Definition: crypto_values.h:65
#define psa_export_public_key
Definition: crypto_spe.h:67
#define CRYPTO_IN_OUT_LEN_VALIDATE(in_len, in_min, in_max, out_len, out_min, out_max)
psa_status_t tfm_crypto_set_key_storage(uint32_t index, psa_key_handle_t key_handle)
Sets the index of the local storage in use with a key requested by the calling partition, and stores the corresponding key_handle.
Definition: crypto_key.c:136
#define PSA_ERROR_PROGRAMMER_ERROR
Definition: error.h:32
_unsigned_integral_type_ psa_key_handle_t
Key handle.
Definition: crypto.h:35
#define PSA_ERROR_NOT_SUPPORTED
Definition: crypto_values.h:52
psa_key_handle_t handle
Definition: crypto_key.c:23
size_t len
Definition: client.h:76
psa_status_t tfm_crypto_check_key_storage(uint32_t *index)
Checks that there is enough local storage in RAM to keep another key, and returns the index of the st...
Definition: crypto_key.c:118
#define PSA_ERROR_INVALID_HANDLE
psa_status_t tfm_crypto_get_key_domain_parameters(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:171
#define psa_destroy_key
Definition: crypto_spe.h:59
#define psa_generate_key
Definition: crypto_spe.h:127
psa_status_t tfm_crypto_copy_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:499
psa_status_t tfm_crypto_set_key_domain_parameters(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:158
const void * base
Definition: client.h:67
#define psa_close_key
Definition: crypto_spe.h:55
int32_t psa_status_t
Function return status.
Definition: crypto_types.h:43
psa_status_t tfm_crypto_generate_key(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:561
#define psa_export_key
Definition: crypto_spe.h:65
psa_status_t tfm_crypto_reset_key_attributes(psa_invec in_vec[], size_t in_len, psa_outvec out_vec[], size_t out_len)
Definition: crypto_key.c:411