CC3XX: Add dedicated init and free functions

The PSA Unified Driver interface framework allows for two driver
entry points dedicated to driver init and de-init procedures. The
existing solution relies on calling the TF-M HAL (i.e. crypto_hw_*)
but in case the driver interface used is the PSA one, we should avoid
calling them and let the PSA subsystem perform the hardware initialisation.

Signed-off-by: Antonio de Angelis <antonio.deangelis@arm.com>
Change-Id: Ie8155d5e039f75bba4c3f20dcac7eaabfd84016d
diff --git a/lib/ext/mbedcrypto/0004-Driver-wrapper-entry-points-for-CC3XX.patch b/lib/ext/mbedcrypto/0004-Driver-wrapper-entry-points-for-CC3XX.patch
index 0a858c7..5257671 100644
--- a/lib/ext/mbedcrypto/0004-Driver-wrapper-entry-points-for-CC3XX.patch
+++ b/lib/ext/mbedcrypto/0004-Driver-wrapper-entry-points-for-CC3XX.patch
@@ -1,4 +1,4 @@
-From 2f96bf29956d2b65c1416ba5bfc02233a17ee3dc Mon Sep 17 00:00:00 2001
+From 786620d885004e49e9c306558f088fb2023c4736 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 4/9] Driver wrapper entry points for CC3XX
@@ -17,9 +17,9 @@
  .../psa/crypto_driver_contexts_composites.h   |   9 +
  .../psa/crypto_driver_contexts_primitives.h   |   9 +
  library/psa_crypto.c                          |  21 +-
- library/psa_crypto_driver_wrappers.c          | 546 ++++++++++++++++--
+ library/psa_crypto_driver_wrappers.c          | 556 ++++++++++++++++--
  library/psa_crypto_driver_wrappers.h          |  14 +
- 5 files changed, 536 insertions(+), 63 deletions(-)
+ 5 files changed, 546 insertions(+), 63 deletions(-)
 
 diff --git a/include/psa/crypto_driver_contexts_composites.h b/include/psa/crypto_driver_contexts_composites.h
 index 3f1c8af4b..2fdf9561f 100644
@@ -123,7 +123,7 @@
      if( status != PSA_SUCCESS )
      {
 diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c
-index a5ae6a29e..af8456f6e 100644
+index a5ae6a29e..a93e155ba 100644
 --- a/library/psa_crypto_driver_wrappers.c
 +++ b/library/psa_crypto_driver_wrappers.c
 @@ -45,6 +45,16 @@
@@ -154,7 +154,31 @@
  /* Support the 'old' SE interface when asked to */
  #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
  /* PSA_CRYPTO_DRIVER_PRESENT is defined when either a new-style or old-style
-@@ -143,8 +157,30 @@ psa_status_t psa_driver_wrapper_sign_message(
+@@ -72,6 +86,12 @@ psa_status_t psa_driver_wrapper_init( void )
+ {
+     psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
+ 
++#if defined(PSA_CRYPTO_DRIVER_CC3XX)
++    status = cc3xx_init();
++    if (status != PSA_SUCCESS)
++        return ( status );
++#endif
++
+ #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
+     status = psa_init_all_se_drivers( );
+     if( status != PSA_SUCCESS )
+@@ -94,6 +114,10 @@ psa_status_t psa_driver_wrapper_init( void )
+ 
+ void psa_driver_wrapper_free( void )
+ {
++#if defined(PSA_CRYPTO_DRIVER_CC3XX)
++    (void)cc3xx_free();
++#endif
++
+ #if defined(MBEDTLS_PSA_CRYPTO_SE_C)
+     /* Unregister all secure element drivers, so that we restart from
+      * a pristine state. */
+@@ -143,8 +167,30 @@ psa_status_t psa_driver_wrapper_sign_message(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -186,7 +210,7 @@
  
          /* Add cases for opaque driver here */
  #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -168,18 +204,9 @@ psa_status_t psa_driver_wrapper_sign_message(
+@@ -168,18 +214,9 @@ psa_status_t psa_driver_wrapper_sign_message(
          default:
              /* Key is declared with a lifetime not known to us */
              (void)status;
@@ -207,7 +231,7 @@
  }
  
  psa_status_t psa_driver_wrapper_verify_message(
-@@ -216,8 +243,28 @@ psa_status_t psa_driver_wrapper_verify_message(
+@@ -216,8 +253,28 @@ psa_status_t psa_driver_wrapper_verify_message(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -237,7 +261,7 @@
  
          /* Add cases for opaque driver here */
  #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
-@@ -240,17 +287,9 @@ psa_status_t psa_driver_wrapper_verify_message(
+@@ -240,17 +297,9 @@ psa_status_t psa_driver_wrapper_verify_message(
          default:
              /* Key is declared with a lifetime not known to us */
              (void)status;
@@ -257,7 +281,7 @@
  }
  
  psa_status_t psa_driver_wrapper_sign_hash(
-@@ -303,6 +342,18 @@ psa_status_t psa_driver_wrapper_sign_hash(
+@@ -303,6 +352,18 @@ psa_status_t psa_driver_wrapper_sign_hash(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -276,7 +300,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
              /* Fell through, meaning no accelerator supports this operation */
              return( psa_sign_hash_builtin( attributes,
-@@ -373,6 +424,17 @@ psa_status_t psa_driver_wrapper_verify_hash(
+@@ -373,6 +434,17 @@ psa_status_t psa_driver_wrapper_verify_hash(
              /* Key is stored in the slot in export representation, so
               * cycle through all known transparent accelerators */
  #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
@@ -294,7 +318,7 @@
  #if defined(PSA_CRYPTO_DRIVER_TEST)
              status = mbedtls_test_transparent_signature_verify_hash(
                           attributes,
-@@ -548,6 +610,12 @@ psa_status_t psa_driver_wrapper_generate_key(
+@@ -548,6 +620,12 @@ psa_status_t psa_driver_wrapper_generate_key(
              if( PSA_KEY_TYPE_IS_ASYMMETRIC( attributes->core.type ) )
              {
              /* Cycle through all known transparent accelerators */
@@ -307,7 +331,7 @@
  #if defined(PSA_CRYPTO_DRIVER_TEST)
                  status = mbedtls_test_transparent_generate_key(
                      attributes, key_buffer, key_buffer_size,
-@@ -771,6 +839,16 @@ psa_status_t psa_driver_wrapper_export_public_key(
+@@ -771,6 +849,16 @@ psa_status_t psa_driver_wrapper_export_public_key(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -324,7 +348,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
              /* Fell through, meaning no accelerator supports this operation */
              return( psa_export_public_key_internal( attributes,
-@@ -908,6 +986,20 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
+@@ -908,6 +996,20 @@ psa_status_t psa_driver_wrapper_cipher_encrypt(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -345,7 +369,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  
  #if defined(MBEDTLS_PSA_BUILTIN_CIPHER)
-@@ -996,6 +1088,18 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
+@@ -996,6 +1098,18 @@ psa_status_t psa_driver_wrapper_cipher_decrypt(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -364,7 +388,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  
  #if defined(MBEDTLS_PSA_BUILTIN_CIPHER)
-@@ -1073,6 +1177,16 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
+@@ -1073,6 +1187,16 @@ psa_status_t psa_driver_wrapper_cipher_encrypt_setup(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -381,7 +405,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  #if defined(MBEDTLS_PSA_BUILTIN_CIPHER)
              /* Fell through, meaning no accelerator supports this operation */
-@@ -1146,6 +1260,16 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
+@@ -1146,6 +1270,16 @@ psa_status_t psa_driver_wrapper_cipher_decrypt_setup(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -398,7 +422,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  #if defined(MBEDTLS_PSA_BUILTIN_CIPHER)
              /* Fell through, meaning no accelerator supports this operation */
-@@ -1214,6 +1338,12 @@ psa_status_t psa_driver_wrapper_cipher_set_iv(
+@@ -1214,6 +1348,12 @@ psa_status_t psa_driver_wrapper_cipher_set_iv(
                          &operation->ctx.opaque_test_driver_ctx,
                          iv, iv_length ) );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -411,7 +435,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1257,6 +1387,13 @@ psa_status_t psa_driver_wrapper_cipher_update(
+@@ -1257,6 +1397,13 @@ psa_status_t psa_driver_wrapper_cipher_update(
                          input, input_length,
                          output, output_size, output_length ) );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -425,7 +449,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1297,6 +1434,12 @@ psa_status_t psa_driver_wrapper_cipher_finish(
+@@ -1297,6 +1444,12 @@ psa_status_t psa_driver_wrapper_cipher_finish(
                          &operation->ctx.opaque_test_driver_ctx,
                          output, output_size, output_length ) );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -438,7 +462,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1337,6 +1480,15 @@ psa_status_t psa_driver_wrapper_cipher_abort(
+@@ -1337,6 +1490,15 @@ psa_status_t psa_driver_wrapper_cipher_abort(
                  sizeof( operation->ctx.opaque_test_driver_ctx ) );
              return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -454,7 +478,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1358,13 +1510,19 @@ psa_status_t psa_driver_wrapper_hash_compute(
+@@ -1358,13 +1520,19 @@ psa_status_t psa_driver_wrapper_hash_compute(
      psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
  
      /* Try accelerators first */
@@ -476,7 +500,7 @@
      /* If software fallback is compiled in, try fallback */
  #if defined(MBEDTLS_PSA_BUILTIN_HASH)
      status = mbedtls_psa_hash_compute( alg, input, input_length,
-@@ -1390,6 +1548,7 @@ psa_status_t psa_driver_wrapper_hash_setup(
+@@ -1390,6 +1558,7 @@ psa_status_t psa_driver_wrapper_hash_setup(
      psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
  
      /* Try setup on accelerators first */
@@ -484,7 +508,7 @@
  #if defined(PSA_CRYPTO_DRIVER_TEST)
      status = mbedtls_test_transparent_hash_setup(
                  &operation->ctx.test_driver_ctx, alg );
-@@ -1398,17 +1557,23 @@ psa_status_t psa_driver_wrapper_hash_setup(
+@@ -1398,17 +1567,23 @@ psa_status_t psa_driver_wrapper_hash_setup(
  
      if( status != PSA_ERROR_NOT_SUPPORTED )
          return( status );
@@ -511,7 +535,7 @@
      /* Nothing left to try if we fall through here */
      (void) status;
      (void) operation;
-@@ -1422,19 +1587,29 @@ psa_status_t psa_driver_wrapper_hash_clone(
+@@ -1422,19 +1597,29 @@ psa_status_t psa_driver_wrapper_hash_clone(
  {
      switch( source_operation->id )
      {
@@ -548,7 +572,7 @@
          default:
              (void) target_operation;
              return( PSA_ERROR_BAD_STATE );
-@@ -1448,17 +1623,25 @@ psa_status_t psa_driver_wrapper_hash_update(
+@@ -1448,17 +1633,25 @@ psa_status_t psa_driver_wrapper_hash_update(
  {
      switch( operation->id )
      {
@@ -580,7 +604,7 @@
          default:
              (void) input;
              (void) input_length;
-@@ -1474,17 +1657,25 @@ psa_status_t psa_driver_wrapper_hash_finish(
+@@ -1474,17 +1667,25 @@ psa_status_t psa_driver_wrapper_hash_finish(
  {
      switch( operation->id )
      {
@@ -612,7 +636,7 @@
          default:
              (void) hash;
              (void) hash_size;
-@@ -1498,15 +1689,22 @@ psa_status_t psa_driver_wrapper_hash_abort(
+@@ -1498,15 +1699,22 @@ psa_status_t psa_driver_wrapper_hash_abort(
  {
      switch( operation->id )
      {
@@ -640,7 +664,7 @@
          default:
              return( PSA_ERROR_BAD_STATE );
      }
-@@ -1544,6 +1742,17 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
+@@ -1544,6 +1752,17 @@ psa_status_t psa_driver_wrapper_aead_encrypt(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -658,7 +682,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  
              /* Fell through, meaning no accelerator supports this operation */
-@@ -1596,6 +1805,17 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
+@@ -1596,6 +1815,17 @@ psa_status_t psa_driver_wrapper_aead_decrypt(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -676,7 +700,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  
              /* Fell through, meaning no accelerator supports this operation */
-@@ -1622,14 +1842,30 @@ psa_status_t psa_driver_get_tag_len( psa_aead_operation_t *operation,
+@@ -1622,14 +1852,30 @@ psa_status_t psa_driver_get_tag_len( psa_aead_operation_t *operation,
      if( operation == NULL || tag_len == NULL )
          return( PSA_ERROR_INVALID_ARGUMENT );
  
@@ -713,7 +737,7 @@
  }
  
  psa_status_t psa_driver_wrapper_aead_encrypt_setup(
-@@ -1660,6 +1896,15 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
+@@ -1660,6 +1906,15 @@ psa_status_t psa_driver_wrapper_aead_encrypt_setup(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -729,7 +753,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  
              /* Fell through, meaning no accelerator supports this operation */
-@@ -1709,6 +1954,16 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
+@@ -1709,6 +1964,16 @@ psa_status_t psa_driver_wrapper_aead_decrypt_setup(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -746,7 +770,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  
              /* Fell through, meaning no accelerator supports this operation */
-@@ -1755,6 +2010,13 @@ psa_status_t psa_driver_wrapper_aead_set_nonce(
+@@ -1755,6 +2020,13 @@ psa_status_t psa_driver_wrapper_aead_set_nonce(
          /* Add cases for opaque driver here */
  
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -760,7 +784,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1789,6 +2051,13 @@ psa_status_t psa_driver_wrapper_aead_set_lengths(
+@@ -1789,6 +2061,13 @@ psa_status_t psa_driver_wrapper_aead_set_lengths(
          /* Add cases for opaque driver here */
  
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -774,7 +798,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1823,6 +2092,13 @@ psa_status_t psa_driver_wrapper_aead_update_ad(
+@@ -1823,6 +2102,13 @@ psa_status_t psa_driver_wrapper_aead_update_ad(
          /* Add cases for opaque driver here */
  
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -788,7 +812,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1862,6 +2138,14 @@ psa_status_t psa_driver_wrapper_aead_update(
+@@ -1862,6 +2148,14 @@ psa_status_t psa_driver_wrapper_aead_update(
          /* Add cases for opaque driver here */
  
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -803,7 +827,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1906,6 +2190,14 @@ psa_status_t psa_driver_wrapper_aead_finish(
+@@ -1906,6 +2200,14 @@ psa_status_t psa_driver_wrapper_aead_finish(
          /* Add cases for opaque driver here */
  
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -818,7 +842,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -1970,6 +2262,14 @@ psa_status_t psa_driver_wrapper_aead_verify(
+@@ -1970,6 +2272,14 @@ psa_status_t psa_driver_wrapper_aead_verify(
          /* Add cases for opaque driver here */
  
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -833,7 +857,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -2002,6 +2302,12 @@ psa_status_t psa_driver_wrapper_aead_abort(
+@@ -2002,6 +2312,12 @@ psa_status_t psa_driver_wrapper_aead_abort(
          /* Add cases for opaque driver here */
  
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -846,7 +870,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
      }
  
-@@ -2041,6 +2347,12 @@ psa_status_t psa_driver_wrapper_mac_compute(
+@@ -2041,6 +2357,12 @@ psa_status_t psa_driver_wrapper_mac_compute(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -859,7 +883,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  #if defined(MBEDTLS_PSA_BUILTIN_MAC)
              /* Fell through, meaning no accelerator supports this operation */
-@@ -2109,6 +2421,15 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
+@@ -2109,6 +2431,15 @@ psa_status_t psa_driver_wrapper_mac_sign_setup(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -875,7 +899,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  #if defined(MBEDTLS_PSA_BUILTIN_MAC)
              /* Fell through, meaning no accelerator supports this operation */
-@@ -2181,6 +2502,15 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
+@@ -2181,6 +2512,15 @@ psa_status_t psa_driver_wrapper_mac_verify_setup(
              if( status != PSA_ERROR_NOT_SUPPORTED )
                  return( status );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -891,7 +915,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
  #if defined(MBEDTLS_PSA_BUILTIN_MAC)
              /* Fell through, meaning no accelerator supports this operation */
-@@ -2248,6 +2578,10 @@ psa_status_t psa_driver_wrapper_mac_update(
+@@ -2248,6 +2588,10 @@ psa_status_t psa_driver_wrapper_mac_update(
                          &operation->ctx.opaque_test_driver_ctx,
                          input, input_length ) );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -902,7 +926,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
          default:
              (void) input;
-@@ -2282,6 +2616,11 @@ psa_status_t psa_driver_wrapper_mac_sign_finish(
+@@ -2282,6 +2626,11 @@ psa_status_t psa_driver_wrapper_mac_sign_finish(
                          &operation->ctx.opaque_test_driver_ctx,
                          mac, mac_size, mac_length ) );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -914,7 +938,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
          default:
              (void) mac;
-@@ -2316,6 +2655,12 @@ psa_status_t psa_driver_wrapper_mac_verify_finish(
+@@ -2316,6 +2665,12 @@ psa_status_t psa_driver_wrapper_mac_verify_finish(
                          &operation->ctx.opaque_test_driver_ctx,
                          mac, mac_length ) );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -927,7 +951,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
          default:
              (void) mac;
-@@ -2343,6 +2688,10 @@ psa_status_t psa_driver_wrapper_mac_abort(
+@@ -2343,6 +2698,10 @@ psa_status_t psa_driver_wrapper_mac_abort(
              return( mbedtls_test_opaque_mac_abort(
                          &operation->ctx.opaque_test_driver_ctx ) );
  #endif /* PSA_CRYPTO_DRIVER_TEST */
@@ -938,7 +962,7 @@
  #endif /* PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT */
          default:
              return( PSA_ERROR_INVALID_ARGUMENT );
-@@ -2350,7 +2699,58 @@ psa_status_t psa_driver_wrapper_mac_abort(
+@@ -2350,7 +2709,58 @@ psa_status_t psa_driver_wrapper_mac_abort(
  }
  
  /*
@@ -998,7 +1022,7 @@
   */
  psa_status_t psa_driver_wrapper_asymmetric_encrypt(
      const psa_key_attributes_t *attributes, const uint8_t *key_buffer,
-@@ -2368,6 +2768,20 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt(
+@@ -2368,6 +2778,20 @@ psa_status_t psa_driver_wrapper_asymmetric_encrypt(
              /* Key is stored in the slot in export representation, so
               * cycle through all known transparent accelerators */
  #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)
@@ -1019,7 +1043,7 @@
  #if defined(PSA_CRYPTO_DRIVER_TEST)
              status = mbedtls_test_transparent_asymmetric_encrypt( attributes,
                          key_buffer, key_buffer_size, alg, input, input_length,
-@@ -2426,6 +2840,20 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
+@@ -2426,6 +2850,20 @@ psa_status_t psa_driver_wrapper_asymmetric_decrypt(
              /* Key is stored in the slot in export representation, so
               * cycle through all known transparent accelerators */
  #if defined(PSA_CRYPTO_ACCELERATOR_DRIVER_PRESENT)