Crypto: Refactor the tfm_builtin_key_loader and HAL interaction
This patch refactors the entry points of the tfm_builtin_key_loader
driver to simplify its interaction with crypto keys HAL layer and
the rest of the TF-M Crypto service and PSA Crypto core layer.
* Decouple as much as possible each module from mbed TLS specific
types, and makes sure all library interactions are abstracted in
the crypto_library module of the crypto service
* Simplify the HAL requirements to provide platform builtin keys
as described in tfm_plat_crypto_keys.h
* Update the documentation to reflect the design change
* Fix minor issues and typos, include paths, etc
* Regenerate mbed TLS patches on top of 3.3.0 tag to be applied
Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: Id26ff0b88da87075490d17a4c8af8f209bb34a08
diff --git a/lib/ext/mbedcrypto/0001-BUILD-Update-IAR-support-in-CMakeLists.txt.patch b/lib/ext/mbedcrypto/0001-BUILD-Update-IAR-support-in-CMakeLists.txt.patch
index af1f725..8346bf5 100644
--- a/lib/ext/mbedcrypto/0001-BUILD-Update-IAR-support-in-CMakeLists.txt.patch
+++ b/lib/ext/mbedcrypto/0001-BUILD-Update-IAR-support-in-CMakeLists.txt.patch
@@ -1,4 +1,4 @@
-From 040624446b2abd6ef63d9004fdeefbb83c24d689 Mon Sep 17 00:00:00 2001
+From edd00ceca7f04206467d950bd20da8494e45ce8c Mon Sep 17 00:00:00 2001
From: TTornblom <thomas.tornblom@iar.com>
Date: Thu, 16 Apr 2020 13:53:38 +0200
Subject: [PATCH 1/6] BUILD: Update IAR support in CMakeLists.txt
@@ -12,7 +12,7 @@
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 337e4db9..ea090a69 100644
+index 337e4db95..ea090a692 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -222,7 +222,9 @@ if(CMAKE_COMPILER_IS_CLANG)
diff --git a/lib/ext/mbedcrypto/0002-Enable-crypto-code-sharing-between-independent-binar.patch b/lib/ext/mbedcrypto/0002-Enable-crypto-code-sharing-between-independent-binar.patch
index 9d231d4..2fed3e0 100644
--- a/lib/ext/mbedcrypto/0002-Enable-crypto-code-sharing-between-independent-binar.patch
+++ b/lib/ext/mbedcrypto/0002-Enable-crypto-code-sharing-between-independent-binar.patch
@@ -1,4 +1,4 @@
-From a58629081d650ca9d7c6baab7598a52b45166a17 Mon Sep 17 00:00:00 2001
+From e4585e5285703a2769a810e90660434285e91925 Mon Sep 17 00:00:00 2001
From: Tamas Ban <tamas.ban@arm.com>
Date: Tue, 27 Oct 2020 08:55:37 +0000
Subject: [PATCH 2/6] Enable crypto code sharing between independent binaries
@@ -13,7 +13,7 @@
diff --git a/library/code_share.c b/library/code_share.c
new file mode 100644
-index 00000000..2bf67fb4
+index 000000000..2bf67fb42
--- /dev/null
+++ b/library/code_share.c
@@ -0,0 +1,3 @@
@@ -21,7 +21,7 @@
+ * extensive crypto code sharing was already applied on the mbedtls library.
+ */
diff --git a/library/platform.c b/library/platform.c
-index 6151e6c4..074ecbb7 100644
+index 6151e6c49..074ecbb72 100644
--- a/library/platform.c
+++ b/library/platform.c
@@ -53,8 +53,8 @@ static void platform_free_uninit( void *ptr )
@@ -36,7 +36,7 @@
void * mbedtls_calloc( size_t nmemb, size_t size )
{
diff --git a/library/platform_util.c b/library/platform_util.c
-index 916a7f44..8936a9d7 100644
+index 916a7f444..8936a9d7d 100644
--- a/library/platform_util.c
+++ b/library/platform_util.c
@@ -62,7 +62,7 @@
diff --git a/lib/ext/mbedcrypto/0003-Driver-wrapper-entry-points-for-CC3XX.patch b/lib/ext/mbedcrypto/0003-Driver-wrapper-entry-points-for-CC3XX.patch
index 95cc8e7..db124cb 100644
--- a/lib/ext/mbedcrypto/0003-Driver-wrapper-entry-points-for-CC3XX.patch
+++ b/lib/ext/mbedcrypto/0003-Driver-wrapper-entry-points-for-CC3XX.patch
@@ -1,4 +1,4 @@
-From 6c54899b07c7cc9615e98eba30781500f4b906c6 Mon Sep 17 00:00:00 2001
+From 89b0a57e9c29fde64572c62dbd4c3d75adde30a1 Mon Sep 17 00:00:00 2001
From: Antonio de Angelis <Antonio.deAngelis@arm.com>
Date: Fri, 15 Jul 2022 12:41:34 +0100
Subject: [PATCH 3/6] Driver wrapper entry points for CC3XX
@@ -20,7 +20,7 @@
3 files changed, 452 insertions(+), 52 deletions(-)
diff --git a/include/psa/crypto_driver_contexts_composites.h b/include/psa/crypto_driver_contexts_composites.h
-index 3f1c8af4..2fdf9561 100644
+index 3f1c8af4b..2fdf9561f 100644
--- a/include/psa/crypto_driver_contexts_composites.h
+++ b/include/psa/crypto_driver_contexts_composites.h
@@ -41,6 +41,9 @@
@@ -54,7 +54,7 @@
#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_COMPOSITES_H */
diff --git a/include/psa/crypto_driver_contexts_primitives.h b/include/psa/crypto_driver_contexts_primitives.h
-index 2bb01ed4..2bc0bda7 100644
+index 2bb01ed43..2bc0bda70 100644
--- a/include/psa/crypto_driver_contexts_primitives.h
+++ b/include/psa/crypto_driver_contexts_primitives.h
@@ -40,6 +40,9 @@
@@ -88,7 +88,7 @@
#endif /* PSA_CRYPTO_DRIVER_CONTEXTS_PRIMITIVES_H */
diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c
-index 19819413..e822eef0 100644
+index 198194139..e822eef01 100644
--- a/library/psa_crypto_driver_wrappers.c
+++ b/library/psa_crypto_driver_wrappers.c
@@ -48,6 +48,16 @@
diff --git a/lib/ext/mbedcrypto/0004-Add-TF-M-builtin-key-driver.patch b/lib/ext/mbedcrypto/0004-Add-TF-M-builtin-key-driver.patch
index 8aa37fb..bee322f 100644
--- a/lib/ext/mbedcrypto/0004-Add-TF-M-builtin-key-driver.patch
+++ b/lib/ext/mbedcrypto/0004-Add-TF-M-builtin-key-driver.patch
@@ -1,16 +1,17 @@
-From 2982172aba752f612b4e473626f787155087ddb5 Mon Sep 17 00:00:00 2001
+From 6f49a579de65abbae877ba067ee1a76671ae8e83 Mon Sep 17 00:00:00 2001
From: Raef Coles <raef.coles@arm.com>
Date: Tue, 19 Jul 2022 11:12:30 +0100
Subject: [PATCH 4/6] Add TF-M builtin key driver
Signed-off-by: Raef Coles <raef.coles@arm.com>
+Co-authored-by: Antonio de Angelis <antonio.deangelis@arm.com>
---
library/psa_crypto.c | 11 +++-
- library/psa_crypto_driver_wrappers.c | 91 +++++++++++++++++++++++++++-
- 2 files changed, 100 insertions(+), 2 deletions(-)
+ library/psa_crypto_driver_wrappers.c | 97 +++++++++++++++++++++++++++-
+ 2 files changed, 106 insertions(+), 2 deletions(-)
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
-index cb5791fc..43c8b9e6 100644
+index cb5791fc7..43c8b9e6a 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -82,6 +82,11 @@
@@ -39,7 +40,7 @@
psa_unlock_key_slot( *p_slot );
*p_slot = NULL;
diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c
-index e822eef0..08427604 100644
+index e822eef01..1fa26d562 100644
--- a/library/psa_crypto_driver_wrappers.c
+++ b/library/psa_crypto_driver_wrappers.c
@@ -58,6 +58,18 @@
@@ -71,7 +72,20 @@
/* END-driver id */
-@@ -155,6 +170,9 @@ psa_status_t psa_driver_wrapper_sign_message(
+@@ -92,6 +107,12 @@ psa_status_t psa_driver_wrapper_init( void )
+ {
+ psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
+
++#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
++ status = tfm_builtin_key_loader_init();
++ if (status != PSA_SUCCESS)
++ return ( status );
++#endif /* PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER */
++
+ #if defined(PSA_CRYPTO_DRIVER_CC3XX)
+ status = cc3xx_init();
+ if (status != PSA_SUCCESS)
+@@ -155,6 +176,9 @@ psa_status_t psa_driver_wrapper_sign_message(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -81,7 +95,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -243,6 +261,9 @@ psa_status_t psa_driver_wrapper_verify_message(
+@@ -243,6 +267,9 @@ psa_status_t psa_driver_wrapper_verify_message(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -91,7 +105,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -342,6 +363,9 @@ psa_status_t psa_driver_wrapper_sign_hash(
+@@ -342,6 +369,9 @@ psa_status_t psa_driver_wrapper_sign_hash(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -101,7 +115,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -438,6 +462,9 @@ psa_status_t psa_driver_wrapper_verify_hash(
+@@ -438,6 +468,9 @@ psa_status_t psa_driver_wrapper_verify_hash(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -111,7 +125,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -582,7 +609,11 @@ psa_status_t psa_driver_wrapper_get_key_buffer_size(
+@@ -582,7 +615,11 @@ psa_status_t psa_driver_wrapper_get_key_buffer_size(
return( ( *key_buffer_size != 0 ) ?
PSA_SUCCESS : PSA_ERROR_NOT_SUPPORTED );
#endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -124,7 +138,7 @@
default:
(void)key_type;
(void)key_bits;
-@@ -622,6 +653,9 @@ psa_status_t psa_driver_wrapper_generate_key(
+@@ -622,6 +659,9 @@ psa_status_t psa_driver_wrapper_generate_key(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -134,7 +148,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
/* Transparent drivers are limited to generating asymmetric keys */
if( PSA_KEY_TYPE_IS_ASYMMETRIC( attributes->core.type ) )
-@@ -714,6 +748,9 @@ psa_status_t psa_driver_wrapper_import_key(
+@@ -714,6 +754,9 @@ psa_status_t psa_driver_wrapper_import_key(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -144,7 +158,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -800,6 +837,9 @@ psa_status_t psa_driver_wrapper_export_key(
+@@ -800,6 +843,9 @@ psa_status_t psa_driver_wrapper_export_key(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -154,7 +168,7 @@
return( psa_export_key_internal( attributes,
key_buffer,
key_buffer_size,
-@@ -865,6 +905,9 @@ psa_status_t psa_driver_wrapper_export_public_key(
+@@ -865,6 +911,9 @@ psa_status_t psa_driver_wrapper_export_public_key(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -164,13 +178,13 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -950,6 +993,13 @@ psa_status_t psa_driver_wrapper_get_builtin_key(
+@@ -950,6 +999,13 @@ psa_status_t psa_driver_wrapper_get_builtin_key(
#endif /* PSA_CRYPTO_DRIVER_TEST */
+#if defined(PSA_CRYPTO_DRIVER_TFM_BUILTIN_KEY_LOADER)
+ case TFM_BUILTIN_KEY_LOADER_KEY_LOCATION:
-+ return( tfm_builtin_key_loader_get_key_buffer(
++ return( tfm_builtin_key_loader_get_builtin_key(
+ slot_number,
+ attributes,
+ key_buffer, key_buffer_size, key_buffer_length ) );
@@ -178,7 +192,7 @@
default:
(void) slot_number;
(void) key_buffer;
-@@ -1035,6 +1085,9 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
+@@ -1035,6 +1091,9 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -188,7 +202,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -1139,6 +1192,9 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
+@@ -1139,6 +1198,9 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -198,7 +212,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -1228,6 +1284,9 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
+@@ -1228,6 +1290,9 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -208,7 +222,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -1311,6 +1370,9 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
+@@ -1311,6 +1376,9 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -218,7 +232,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -1794,6 +1856,9 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
+@@ -1794,6 +1862,9 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -228,7 +242,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
-@@ -1857,6 +1922,9 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
+@@ -1857,6 +1928,9 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -238,7 +252,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
-@@ -1917,6 +1985,9 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
+@@ -1917,6 +1991,9 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -248,7 +262,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
-@@ -1974,6 +2045,9 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
+@@ -1974,6 +2051,9 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -258,7 +272,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
-@@ -2371,6 +2445,9 @@ psa_status_t psa_driver_wrapper_mac_compute(
+@@ -2371,6 +2451,9 @@ psa_status_t psa_driver_wrapper_mac_compute(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -268,7 +282,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -2441,6 +2518,9 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
+@@ -2441,6 +2524,9 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -278,7 +292,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -2522,6 +2602,9 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
+@@ -2522,6 +2608,9 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -288,7 +302,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -2822,6 +2905,9 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
+@@ -2822,6 +2911,9 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
@@ -298,7 +312,7 @@
/* Key is stored in the slot in export representation, so
* cycle through all known transparent accelerators */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -2900,6 +2986,9 @@ psa_status_t psa_driver_wrapper_key_agreement(
+@@ -2900,6 +2992,9 @@ psa_status_t psa_driver_wrapper_key_agreement(
switch( location )
{
case PSA_KEY_LOCATION_LOCAL_STORAGE:
diff --git a/lib/ext/mbedcrypto/0005-CC3XX-Manually-enforce-no-software-builtin-fallback-.patch b/lib/ext/mbedcrypto/0005-CC3XX-Manually-enforce-no-software-builtin-fallback-.patch
index ae23516..335a31d 100644
--- a/lib/ext/mbedcrypto/0005-CC3XX-Manually-enforce-no-software-builtin-fallback-.patch
+++ b/lib/ext/mbedcrypto/0005-CC3XX-Manually-enforce-no-software-builtin-fallback-.patch
@@ -1,4 +1,4 @@
-From b1badf85b254f43dad2847d05dedc4d32b1fc57d Mon Sep 17 00:00:00 2001
+From 9e1fcca0e8ba9e58135c91af9c8c640b1d0b32c5 Mon Sep 17 00:00:00 2001
From: Antonio de Angelis <Antonio.deAngelis@arm.com>
Date: Tue, 2 Aug 2022 13:05:05 +0200
Subject: [PATCH 5/6] CC3XX: Manually enforce no-software builtin fallback when
@@ -14,10 +14,10 @@
1 file changed, 77 insertions(+), 69 deletions(-)
diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c
-index 08427604..7c6b618d 100644
+index 1fa26d562..80e20d440 100644
--- a/library/psa_crypto_driver_wrappers.c
+++ b/library/psa_crypto_driver_wrappers.c
-@@ -205,6 +205,7 @@ psa_status_t psa_driver_wrapper_sign_message(
+@@ -211,6 +211,7 @@ psa_status_t psa_driver_wrapper_sign_message(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -25,7 +25,7 @@
/* Fell through, meaning no accelerator supports this operation */
return( psa_sign_message_builtin( attributes,
key_buffer,
-@@ -215,7 +216,7 @@ psa_status_t psa_driver_wrapper_sign_message(
+@@ -221,7 +222,7 @@ psa_status_t psa_driver_wrapper_sign_message(
signature,
signature_size,
signature_length ) );
@@ -34,7 +34,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -294,6 +295,7 @@ psa_status_t psa_driver_wrapper_verify_message(
+@@ -300,6 +301,7 @@ psa_status_t psa_driver_wrapper_verify_message(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -42,7 +42,7 @@
/* Fell through, meaning no accelerator supports this operation */
return( psa_verify_message_builtin( attributes,
key_buffer,
-@@ -303,7 +305,7 @@ psa_status_t psa_driver_wrapper_verify_message(
+@@ -309,7 +311,7 @@ psa_status_t psa_driver_wrapper_verify_message(
input_length,
signature,
signature_length ) );
@@ -51,7 +51,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -396,6 +398,7 @@ psa_status_t psa_driver_wrapper_sign_hash(
+@@ -402,6 +404,7 @@ psa_status_t psa_driver_wrapper_sign_hash(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -59,7 +59,7 @@
/* Fell through, meaning no accelerator supports this operation */
return( psa_sign_hash_builtin( attributes,
key_buffer,
-@@ -406,7 +409,7 @@ psa_status_t psa_driver_wrapper_sign_hash(
+@@ -412,7 +415,7 @@ psa_status_t psa_driver_wrapper_sign_hash(
signature,
signature_size,
signature_length ) );
@@ -68,7 +68,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -494,7 +497,7 @@ psa_status_t psa_driver_wrapper_verify_hash(
+@@ -500,7 +503,7 @@ psa_status_t psa_driver_wrapper_verify_hash(
return( status );
#endif /* PSA_CRYPTO_DRIVER_TEST */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -77,7 +77,7 @@
return( psa_verify_hash_builtin( attributes,
key_buffer,
key_buffer_size,
-@@ -503,7 +506,7 @@ psa_status_t psa_driver_wrapper_verify_hash(
+@@ -509,7 +512,7 @@ psa_status_t psa_driver_wrapper_verify_hash(
hash_length,
signature,
signature_length ) );
@@ -86,7 +86,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -937,6 +940,7 @@ psa_status_t psa_driver_wrapper_export_public_key(
+@@ -943,6 +946,7 @@ psa_status_t psa_driver_wrapper_export_public_key(
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -94,7 +94,7 @@
/* Fell through, meaning no accelerator supports this operation */
return( psa_export_public_key_internal( attributes,
key_buffer,
-@@ -944,7 +948,7 @@ psa_status_t psa_driver_wrapper_export_public_key(
+@@ -950,7 +954,7 @@ psa_status_t psa_driver_wrapper_export_public_key(
data,
data_size,
data_length ) );
@@ -103,7 +103,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -1123,7 +1127,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
+@@ -1129,7 +1133,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -112,7 +112,7 @@
return( mbedtls_psa_cipher_encrypt( attributes,
key_buffer,
key_buffer_size,
-@@ -1137,7 +1141,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
+@@ -1143,7 +1147,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
output_length ) );
#else
return( PSA_ERROR_NOT_SUPPORTED );
@@ -121,7 +121,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -1226,7 +1230,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
+@@ -1232,7 +1236,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -130,7 +130,7 @@
return( mbedtls_psa_cipher_decrypt( attributes,
key_buffer,
key_buffer_size,
-@@ -1238,7 +1242,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
+@@ -1244,7 +1248,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
output_length ) );
#else
return( PSA_ERROR_NOT_SUPPORTED );
@@ -139,7 +139,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -1315,7 +1319,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
+@@ -1321,7 +1325,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -148,7 +148,7 @@
/* Fell through, meaning no accelerator supports this operation */
status = mbedtls_psa_cipher_encrypt_setup( &operation->ctx.mbedtls_ctx,
attributes,
-@@ -1327,7 +1331,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
+@@ -1333,7 +1337,7 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
if( status != PSA_ERROR_NOT_SUPPORTED )
return( status );
@@ -157,7 +157,7 @@
return( PSA_ERROR_NOT_SUPPORTED );
/* Add cases for opaque driver here */
-@@ -1401,7 +1405,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
+@@ -1407,7 +1411,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -166,7 +166,7 @@
/* Fell through, meaning no accelerator supports this operation */
status = mbedtls_psa_cipher_decrypt_setup( &operation->ctx.mbedtls_ctx,
attributes,
-@@ -1412,7 +1416,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
+@@ -1418,7 +1422,7 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
return( status );
@@ -175,7 +175,7 @@
return( PSA_ERROR_NOT_SUPPORTED );
/* Add cases for opaque driver here */
-@@ -1449,12 +1453,12 @@ psa_status_t psa_driver_wrapper_cipher_set_iv(
+@@ -1455,12 +1459,12 @@ psa_status_t psa_driver_wrapper_cipher_set_iv(
{
switch( operation->id )
{
@@ -190,7 +190,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -1493,7 +1497,7 @@ psa_status_t psa_driver_wrapper_cipher_update(
+@@ -1499,7 +1503,7 @@ psa_status_t psa_driver_wrapper_cipher_update(
{
switch( operation->id )
{
@@ -199,7 +199,7 @@
case PSA_CRYPTO_MBED_TLS_DRIVER_ID:
return( mbedtls_psa_cipher_update( &operation->ctx.mbedtls_ctx,
input,
-@@ -1501,7 +1505,7 @@ psa_status_t psa_driver_wrapper_cipher_update(
+@@ -1507,7 +1511,7 @@ psa_status_t psa_driver_wrapper_cipher_update(
output,
output_size,
output_length ) );
@@ -208,7 +208,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -1544,13 +1548,13 @@ psa_status_t psa_driver_wrapper_cipher_finish(
+@@ -1550,13 +1554,13 @@ psa_status_t psa_driver_wrapper_cipher_finish(
{
switch( operation->id )
{
@@ -224,7 +224,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -1587,10 +1591,10 @@ psa_status_t psa_driver_wrapper_cipher_abort(
+@@ -1593,10 +1597,10 @@ psa_status_t psa_driver_wrapper_cipher_abort(
switch( operation->id )
{
@@ -237,7 +237,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -1654,7 +1658,7 @@ psa_status_t psa_driver_wrapper_hash_compute(
+@@ -1660,7 +1664,7 @@ psa_status_t psa_driver_wrapper_hash_compute(
#endif /* defined(PSA_CRYPTO_DRIVER_CC3XX) */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
/* If software fallback is compiled in, try fallback */
@@ -246,7 +246,7 @@
status = mbedtls_psa_hash_compute( alg, input, input_length,
hash, hash_size, hash_length );
if( status != PSA_ERROR_NOT_SUPPORTED )
-@@ -1695,7 +1699,7 @@ psa_status_t psa_driver_wrapper_hash_setup(
+@@ -1701,7 +1705,7 @@ psa_status_t psa_driver_wrapper_hash_setup(
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -255,7 +255,7 @@
/* If software fallback is compiled in, try fallback */
status = mbedtls_psa_hash_setup( &operation->ctx.mbedtls_ctx, alg );
if( status == PSA_SUCCESS )
-@@ -1703,7 +1707,7 @@ psa_status_t psa_driver_wrapper_hash_setup(
+@@ -1709,7 +1713,7 @@ psa_status_t psa_driver_wrapper_hash_setup(
if( status != PSA_ERROR_NOT_SUPPORTED )
return( status );
@@ -264,7 +264,7 @@
/* Nothing left to try if we fall through here */
(void) status;
(void) operation;
-@@ -1734,12 +1738,12 @@ psa_status_t psa_driver_wrapper_hash_clone(
+@@ -1740,12 +1744,12 @@ psa_status_t psa_driver_wrapper_hash_clone(
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -279,7 +279,7 @@
default:
(void) target_operation;
return( PSA_ERROR_BAD_STATE );
-@@ -1767,11 +1771,11 @@ psa_status_t psa_driver_wrapper_hash_update(
+@@ -1773,11 +1777,11 @@ psa_status_t psa_driver_wrapper_hash_update(
input, input_length ) );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -293,7 +293,7 @@
default:
(void) input;
(void) input_length;
-@@ -1801,11 +1805,11 @@ psa_status_t psa_driver_wrapper_hash_finish(
+@@ -1807,11 +1811,11 @@ psa_status_t psa_driver_wrapper_hash_finish(
hash, hash_size, hash_length ) );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -307,7 +307,7 @@
default:
(void) hash;
(void) hash_size;
-@@ -1831,10 +1835,10 @@ psa_status_t psa_driver_wrapper_hash_abort(
+@@ -1837,10 +1841,10 @@ psa_status_t psa_driver_wrapper_hash_abort(
&operation->ctx.cc3xx_driver_ctx ) );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -320,7 +320,7 @@
default:
return( PSA_ERROR_BAD_STATE );
}
-@@ -1887,7 +1891,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
+@@ -1893,7 +1897,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -329,7 +329,7 @@
/* Fell through, meaning no accelerator supports this operation */
return( mbedtls_psa_aead_encrypt(
attributes, key_buffer, key_buffer_size,
-@@ -1896,7 +1900,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
+@@ -1902,7 +1906,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
additional_data, additional_data_length,
plaintext, plaintext_length,
ciphertext, ciphertext_size, ciphertext_length ) );
@@ -338,7 +338,7 @@
/* Add cases for opaque driver here */
default:
-@@ -1953,7 +1957,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
+@@ -1959,7 +1963,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -347,7 +347,7 @@
/* Fell through, meaning no accelerator supports this operation */
return( mbedtls_psa_aead_decrypt(
attributes, key_buffer, key_buffer_size,
-@@ -1962,7 +1966,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
+@@ -1968,7 +1972,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
additional_data, additional_data_length,
ciphertext, ciphertext_length,
plaintext, plaintext_size, plaintext_length ) );
@@ -356,7 +356,7 @@
/* Add cases for opaque driver here */
default:
-@@ -2013,7 +2017,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
+@@ -2019,7 +2023,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -365,7 +365,7 @@
/* Fell through, meaning no accelerator supports this operation */
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
status = mbedtls_psa_aead_encrypt_setup(
-@@ -2022,7 +2026,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
+@@ -2028,7 +2032,7 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
alg );
return( status );
@@ -374,7 +374,7 @@
/* Add cases for opaque driver here */
default:
-@@ -2075,7 +2079,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
+@@ -2081,7 +2085,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -383,7 +383,7 @@
/* Fell through, meaning no accelerator supports this operation */
operation->id = PSA_CRYPTO_MBED_TLS_DRIVER_ID;
status = mbedtls_psa_aead_decrypt_setup(
-@@ -2085,7 +2089,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
+@@ -2091,7 +2095,7 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
alg );
return( status );
@@ -392,7 +392,7 @@
/* Add cases for opaque driver here */
default:
-@@ -2102,13 +2106,13 @@ psa_status_t psa_driver_wrapper_aead_set_nonce(
+@@ -2108,13 +2112,13 @@ psa_status_t psa_driver_wrapper_aead_set_nonce(
{
switch( operation->id )
{
@@ -408,7 +408,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2143,13 +2147,13 @@ psa_status_t psa_driver_wrapper_aead_set_lengths(
+@@ -2149,13 +2153,13 @@ psa_status_t psa_driver_wrapper_aead_set_lengths(
{
switch( operation->id )
{
@@ -424,7 +424,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2184,13 +2188,13 @@ psa_status_t psa_driver_wrapper_aead_update_ad(
+@@ -2190,13 +2194,13 @@ psa_status_t psa_driver_wrapper_aead_update_ad(
{
switch( operation->id )
{
@@ -440,7 +440,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2228,14 +2232,14 @@ psa_status_t psa_driver_wrapper_aead_update(
+@@ -2234,14 +2238,14 @@ psa_status_t psa_driver_wrapper_aead_update(
{
switch( operation->id )
{
@@ -457,7 +457,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2279,7 +2283,7 @@ psa_status_t psa_driver_wrapper_aead_finish(
+@@ -2285,7 +2289,7 @@ psa_status_t psa_driver_wrapper_aead_finish(
{
switch( operation->id )
{
@@ -466,7 +466,7 @@
case PSA_CRYPTO_MBED_TLS_DRIVER_ID:
return( mbedtls_psa_aead_finish( &operation->ctx.mbedtls_ctx,
ciphertext,
-@@ -2287,7 +2291,7 @@ psa_status_t psa_driver_wrapper_aead_finish(
+@@ -2293,7 +2297,7 @@ psa_status_t psa_driver_wrapper_aead_finish(
ciphertext_length, tag,
tag_size, tag_length ) );
@@ -475,7 +475,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2331,7 +2335,7 @@ psa_status_t psa_driver_wrapper_aead_verify(
+@@ -2337,7 +2341,7 @@ psa_status_t psa_driver_wrapper_aead_verify(
{
switch( operation->id )
{
@@ -484,7 +484,7 @@
case PSA_CRYPTO_MBED_TLS_DRIVER_ID:
{
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
-@@ -2359,7 +2363,7 @@ psa_status_t psa_driver_wrapper_aead_verify(
+@@ -2365,7 +2369,7 @@ psa_status_t psa_driver_wrapper_aead_verify(
return( status );
}
@@ -493,7 +493,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2397,11 +2401,11 @@ psa_status_t psa_driver_wrapper_aead_abort(
+@@ -2403,11 +2407,11 @@ psa_status_t psa_driver_wrapper_aead_abort(
{
switch( operation->id )
{
@@ -507,7 +507,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2467,7 +2471,7 @@ psa_status_t psa_driver_wrapper_mac_compute(
+@@ -2473,7 +2477,7 @@ psa_status_t psa_driver_wrapper_mac_compute(
return( status );
#endif /* PSA_CRYPTO_DRIVER_CC3XX */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -516,7 +516,7 @@
/* Fell through, meaning no accelerator supports this operation */
status = mbedtls_psa_mac_compute(
attributes, key_buffer, key_buffer_size, alg,
-@@ -2475,7 +2479,7 @@ psa_status_t psa_driver_wrapper_mac_compute(
+@@ -2481,7 +2485,7 @@ psa_status_t psa_driver_wrapper_mac_compute(
mac, mac_size, mac_length );
if( status != PSA_ERROR_NOT_SUPPORTED )
return( status );
@@ -525,7 +525,7 @@
return( PSA_ERROR_NOT_SUPPORTED );
/* Add cases for opaque driver here */
-@@ -2547,7 +2551,7 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
+@@ -2553,7 +2557,7 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
return status;
#endif /* defined(PSA_CRYPTO_DRIVER_CC3XX) */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -534,7 +534,7 @@
/* Fell through, meaning no accelerator supports this operation */
status = mbedtls_psa_mac_sign_setup( &operation->ctx.mbedtls_ctx,
attributes,
-@@ -2558,7 +2562,7 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
+@@ -2564,7 +2568,7 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
if( status != PSA_ERROR_NOT_SUPPORTED )
return( status );
@@ -543,7 +543,7 @@
return( PSA_ERROR_NOT_SUPPORTED );
/* Add cases for opaque driver here */
-@@ -2631,7 +2635,7 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
+@@ -2637,7 +2641,7 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
return status;
#endif /* defined(PSA_CRYPTO_DRIVER_CC3XX) */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -552,7 +552,7 @@
/* Fell through, meaning no accelerator supports this operation */
status = mbedtls_psa_mac_verify_setup( &operation->ctx.mbedtls_ctx,
attributes,
-@@ -2642,7 +2646,7 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
+@@ -2648,7 +2652,7 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
if( status != PSA_ERROR_NOT_SUPPORTED )
return( status );
@@ -561,7 +561,7 @@
return( PSA_ERROR_NOT_SUPPORTED );
/* Add cases for opaque driver here */
-@@ -2679,11 +2683,11 @@ psa_status_t psa_driver_wrapper_mac_update(
+@@ -2685,11 +2689,11 @@ psa_status_t psa_driver_wrapper_mac_update(
{
switch( operation->id )
{
@@ -575,7 +575,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2717,11 +2721,11 @@ psa_status_t psa_driver_wrapper_mac_sign_finish(
+@@ -2723,11 +2727,11 @@ psa_status_t psa_driver_wrapper_mac_sign_finish(
{
switch( operation->id )
{
@@ -589,7 +589,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2756,11 +2760,11 @@ psa_status_t psa_driver_wrapper_mac_verify_finish(
+@@ -2762,11 +2766,11 @@ psa_status_t psa_driver_wrapper_mac_verify_finish(
{
switch( operation->id )
{
@@ -603,7 +603,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2793,10 +2797,10 @@ psa_status_t psa_driver_wrapper_mac_abort(
+@@ -2799,10 +2803,10 @@ psa_status_t psa_driver_wrapper_mac_abort(
{
switch( operation->id )
{
@@ -616,7 +616,7 @@
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2860,10 +2864,12 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt(
+@@ -2866,10 +2870,12 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt(
return( status );
#endif /* PSA_CRYPTO_DRIVER_TEST */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
@@ -629,7 +629,7 @@
/* Add cases for opaque driver here */
#if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
#if defined(PSA_CRYPTO_DRIVER_TEST)
-@@ -2935,10 +2941,12 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
+@@ -2941,10 +2947,12 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
return( status );
#endif /* PSA_CRYPTO_DRIVER_TEST */
#endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
diff --git a/lib/ext/mbedcrypto/0006-Initialise-driver-wrappers-as-first-step-in-psa_cryp.patch b/lib/ext/mbedcrypto/0006-Initialise-driver-wrappers-as-first-step-in-psa_cryp.patch
index 2fb0973..ea0fd11 100644
--- a/lib/ext/mbedcrypto/0006-Initialise-driver-wrappers-as-first-step-in-psa_cryp.patch
+++ b/lib/ext/mbedcrypto/0006-Initialise-driver-wrappers-as-first-step-in-psa_cryp.patch
@@ -1,4 +1,4 @@
-From 270713ac18597abf1bd4b8eb76cd84b6cdfa2b95 Mon Sep 17 00:00:00 2001
+From b7d0156cccb681b448f015a35581e4a4713e1ca0 Mon Sep 17 00:00:00 2001
From: Antonio de Angelis <Antonio.deAngelis@arm.com>
Date: Tue, 23 Aug 2022 13:06:07 +0100
Subject: [PATCH 6/6] Initialise driver wrappers as first step in
@@ -14,7 +14,7 @@
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
-index 43c8b9e6..a700a3ce 100644
+index 43c8b9e6a..a700a3ce0 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -6327,6 +6327,11 @@ psa_status_t psa_crypto_init( void )