Skip to content

Commit 92cf681

Browse files
author
itayzafrir
committed
Prepare support for 64 bit key ids under SPM
Preparation for type separation between SPE and NSPE.
1 parent 472c20b commit 92cf681

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

library/psa_crypto_storage.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,20 @@
2929

3030
#include <stdlib.h>
3131
#include <string.h>
32+
/*
33+
* When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is being built for SPM
34+
* (Secure Partition Manager) integration which separates the code into two
35+
* parts: NSPE (Non-Secure Processing Environment) and SPE (Secure Processing
36+
* Environment). When building for the SPE, an additional header file should be
37+
* included.
38+
*/
39+
#if defined(MBEDTLS_PSA_CRYPTO_SPM)
40+
/*
41+
* PSA_CRYPTO_SECURE means that this file is compiled for the SPE.
42+
* Some headers will be affected by this flag.
43+
*/
44+
#define PSA_CRYPTO_SECURE 1
45+
#endif
3246

3347
#include "psa/crypto.h"
3448
#include "psa_crypto_storage.h"

library/psa_crypto_storage_its.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626
#endif
2727

2828
#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C)
29+
/*
30+
* When MBEDTLS_PSA_CRYPTO_SPM is defined, the code is being built for SPM
31+
* (Secure Partition Manager) integration which separates the code into two
32+
* parts: NSPE (Non-Secure Processing Environment) and SPE (Secure Processing
33+
* Environment). When building for the SPE, an additional header file should be
34+
* included.
35+
*/
36+
#if defined(MBEDTLS_PSA_CRYPTO_SPM)
37+
/*
38+
* PSA_CRYPTO_SECURE means that this file is compiled for the SPE.
39+
* Some headers will be affected by this flag.
40+
*/
41+
#define PSA_CRYPTO_SECURE 1
42+
#endif
2943

3044
#include "psa/crypto.h"
3145
#include "psa_crypto_storage_backend.h"

0 commit comments

Comments
 (0)