psa: driver: Reduce the scope of test driver entry points

Define test driver entry points that provide an alternative
to Mbed TLS driver entry points only when the PSA configuration
is used. Their purpose is only to test the PSA configuration
thus there is no good reason to use them out of this scope.

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/tests/src/drivers/hash.c b/tests/src/drivers/hash.c
index f95aa6b..e618660 100644
--- a/tests/src/drivers/hash.c
+++ b/tests/src/drivers/hash.c
@@ -45,10 +45,25 @@
     }
     else
     {
+#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
         mbedtls_test_driver_hash_hooks.driver_status =
             mbedtls_transparent_test_driver_hash_compute(
                 alg, input, input_length,
                 hash, hash_size, hash_length );
+#elif defined(MBEDTLS_PSA_BUILTIN_HASH)
+        mbedtls_test_driver_hash_hooks.driver_status =
+            mbedtls_psa_hash_compute(
+                alg, input, input_length,
+                hash, hash_size, hash_length );
+#else
+        (void) alg;
+        (void) input;
+        (void) input_length;
+        (void) hash;
+        (void) hash_size;
+        (void) hash_length;
+        mbedtls_test_driver_hash_hooks.driver_status = PSA_ERROR_NOT_SUPPORTED;
+#endif
     }
 
     return( mbedtls_test_driver_hash_hooks.driver_status );
@@ -67,8 +82,17 @@
     }
     else
     {
+#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
         mbedtls_test_driver_hash_hooks.driver_status =
             mbedtls_transparent_test_driver_hash_setup( operation, alg );
+#elif defined(MBEDTLS_PSA_BUILTIN_HASH)
+        mbedtls_test_driver_hash_hooks.driver_status =
+            mbedtls_psa_hash_setup( operation, alg );
+#else
+        (void) operation;
+        (void) alg;
+        mbedtls_test_driver_hash_hooks.driver_status = PSA_ERROR_NOT_SUPPORTED;
+#endif
     }
 
     return( mbedtls_test_driver_hash_hooks.driver_status );
@@ -87,9 +111,18 @@
     }
     else
     {
+#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
         mbedtls_test_driver_hash_hooks.driver_status =
             mbedtls_transparent_test_driver_hash_clone( source_operation,
                                                         target_operation );
+#elif defined(MBEDTLS_PSA_BUILTIN_HASH)
+        mbedtls_test_driver_hash_hooks.driver_status =
+            mbedtls_psa_hash_clone( source_operation, target_operation );
+#else
+        (void) source_operation;
+        (void) target_operation;
+        mbedtls_test_driver_hash_hooks.driver_status = PSA_ERROR_NOT_SUPPORTED;
+#endif
     }
 
     return( mbedtls_test_driver_hash_hooks.driver_status );
@@ -109,9 +142,19 @@
     }
     else
     {
+#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
         mbedtls_test_driver_hash_hooks.driver_status =
             mbedtls_transparent_test_driver_hash_update(
                 operation, input, input_length );
+#elif defined(MBEDTLS_PSA_BUILTIN_HASH)
+        mbedtls_test_driver_hash_hooks.driver_status =
+            mbedtls_psa_hash_update( operation, input, input_length );
+#else
+        (void) operation;
+        (void) input;
+        (void) input_length;
+        mbedtls_test_driver_hash_hooks.driver_status = PSA_ERROR_NOT_SUPPORTED;
+#endif
     }
 
     return( mbedtls_test_driver_hash_hooks.driver_status );
@@ -132,9 +175,20 @@
     }
     else
     {
+#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
         mbedtls_test_driver_hash_hooks.driver_status =
             mbedtls_transparent_test_driver_hash_finish(
                 operation, hash, hash_size, hash_length );
+#elif defined(MBEDTLS_PSA_BUILTIN_HASH)
+        mbedtls_test_driver_hash_hooks.driver_status =
+            mbedtls_psa_hash_finish( operation, hash, hash_size, hash_length );
+#else
+        (void) operation;
+        (void) hash;
+        (void) hash_size;
+        (void) hash_length;
+        mbedtls_test_driver_hash_hooks.driver_status = PSA_ERROR_NOT_SUPPORTED;
+#endif
     }
 
     return( mbedtls_test_driver_hash_hooks.driver_status );
@@ -152,8 +206,16 @@
     }
     else
     {
+#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
         mbedtls_test_driver_hash_hooks.driver_status =
             mbedtls_transparent_test_driver_hash_abort( operation );
+#elif defined(MBEDTLS_PSA_BUILTIN_HASH)
+        mbedtls_test_driver_hash_hooks.driver_status =
+            mbedtls_psa_hash_abort( operation );
+#else
+        (void) operation;
+        mbedtls_test_driver_hash_hooks.driver_status = PSA_ERROR_NOT_SUPPORTED;
+#endif
     }
 
     return( mbedtls_test_driver_hash_hooks.driver_status );