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 b1880f7..2557417 100644
--- a/tests/src/drivers/hash.c
+++ b/tests/src/drivers/hash.c
@@ -41,10 +41,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 );
@@ -63,8 +78,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 );
@@ -83,9 +107,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 );
@@ -105,9 +138,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 );
@@ -128,9 +171,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 );
@@ -148,8 +202,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 );