Skip to content

Commit e347cc2

Browse files
committed
psa: Accelerator support for Silabs devices with HSE
Enable acceleration for Silicon Labs Series 2 devices with hardware Secure Engine (HSE). Implementation is ported from Simplicity SDK 2024.12.0 and applied to the Zephyr fork of mbed TLS. Signed-off-by: Aksel Skauge Mellbye <aksel.mellbye@silabs.com>
1 parent fec1727 commit e347cc2

4 files changed

+813
-0
lines changed

include/psa/crypto_driver_contexts_composites.h

+21
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@
3434
#include "cc3xx_crypto_primitives_private.h"
3535
#endif
3636

37+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE)
38+
#include "sli_psa_driver_features.h"
39+
#include "sli_se_transparent_types.h"
40+
41+
#if defined(SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS)
42+
#include "sli_se_opaque_types.h"
43+
#endif
44+
#endif
45+
3746
#if defined(MBEDTLS_TEST_LIBTESTDRIVER1)
3847
#include <libtestdriver1/include/psa/crypto.h>
3948
#endif
@@ -125,6 +134,12 @@ typedef union {
125134
#if defined(PSA_CRYPTO_DRIVER_CC3XX)
126135
cc3xx_mac_operation_t cc3xx_driver_ctx;
127136
#endif
137+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE)
138+
sli_se_transparent_mac_operation_t sli_se_transparent_ctx;
139+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE) && defined(SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS)
140+
sli_se_opaque_mac_operation_t sli_se_opaque_ctx;
141+
#endif /* PSA_CRYPTO_DRIVER_SILABS_HSE && SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS */
142+
#endif /* PSA_CRYPTO_DRIVER_SILABS_HSE */
128143
} psa_driver_mac_context_t;
129144

130145
typedef union {
@@ -136,6 +151,12 @@ typedef union {
136151
#if defined(PSA_CRYPTO_DRIVER_CC3XX)
137152
cc3xx_aead_operation_t cc3xx_driver_ctx;
138153
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
154+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE)
155+
sli_se_transparent_aead_operation_t sli_se_transparent_ctx;
156+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE) && defined(SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS)
157+
sli_se_opaque_aead_operation_t sli_se_opaque_ctx;
158+
#endif /* PSA_CRYPTO_DRIVER_SILABS_HSE && SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS */
159+
#endif /* PSA_CRYPTO_DRIVER_SILABS_HSE */
139160
} psa_driver_aead_context_t;
140161

141162
typedef union {

include/psa/crypto_driver_contexts_primitives.h

+18
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@
3333
#include "cc3xx_crypto_primitives_private.h"
3434
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
3535

36+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE)
37+
#include "sli_psa_driver_features.h"
38+
#include "sli_se_transparent_types.h"
39+
40+
#if defined(SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS)
41+
#include "sli_se_opaque_types.h"
42+
#endif
43+
#endif
44+
3645
#if defined(MBEDTLS_TEST_LIBTESTDRIVER1)
3746
#include <libtestdriver1/include/psa/crypto.h>
3847
#endif
@@ -97,6 +106,9 @@ typedef union {
97106
#if defined(PSA_CRYPTO_DRIVER_CC3XX)
98107
cc3xx_hash_operation_t cc3xx_driver_ctx;
99108
#endif
109+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE)
110+
sli_se_transparent_hash_operation_t sli_se_transparent_ctx;
111+
#endif /* PSA_CRYPTO_DRIVER_SILABS_HSE */
100112
} psa_driver_hash_context_t;
101113

102114
typedef union {
@@ -109,6 +121,12 @@ typedef union {
109121
#if defined(PSA_CRYPTO_DRIVER_CC3XX)
110122
cc3xx_cipher_operation_t cc3xx_driver_ctx;
111123
#endif
124+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE)
125+
sli_se_transparent_cipher_operation_t sli_se_transparent_ctx;
126+
#if defined(PSA_CRYPTO_DRIVER_SILABS_HSE) && defined(SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS)
127+
sli_se_opaque_cipher_operation_t sli_se_opaque_ctx;
128+
#endif /* PSA_CRYPTO_DRIVER_SILABS_HSE && SLI_PSA_DRIVER_FEATURE_OPAQUE_KEYS */
129+
#endif /* PSA_CRYPTO_DRIVER_SILABS_HSE */
112130
} psa_driver_cipher_context_t;
113131

114132
#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H */

0 commit comments

Comments
 (0)