Move to separately compiled PSA test driver library
This commit removes the test_psa_crypto_config_basic
all.sh component that can no longer work without
adapting it to the separately compiled test driver
library. This component is replaced by several
components in the following commits to test various
type of acceleration independently.
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/tests/src/drivers/test_driver_signature.c b/tests/src/drivers/test_driver_signature.c
index a656287..3de43a8 100644
--- a/tests/src/drivers/test_driver_signature.c
+++ b/tests/src/drivers/test_driver_signature.c
@@ -42,6 +42,12 @@
#include "test/random.h"
+#if defined(MBEDTLS_TEST_LIBTESTDRIVER1)
+#include "libtestdriver1/library/psa_crypto_ecp.h"
+#include "libtestdriver1/library/psa_crypto_hash.h"
+#include "libtestdriver1/library/psa_crypto_rsa.h"
+#endif
+
#include <string.h>
mbedtls_test_driver_signature_hooks_t
@@ -65,11 +71,11 @@
if( PSA_ALG_IS_RSA_PKCS1V15_SIGN( alg ) ||
PSA_ALG_IS_RSA_PSS( alg) )
{
-#if ( defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) ) && \
- defined(MBEDTLS_PSA_CRYPTO_CONFIG)
+#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
+ ( defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_SIGN) || \
+ defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_RSA_PSS) )
return( libtestdriver1_mbedtls_psa_rsa_sign_hash(
- attributes,
+ (const libtestdriver1_psa_key_attributes_t *) attributes,
key_buffer, key_buffer_size,
alg, hash, hash_length,
signature, signature_size, signature_length ) );
@@ -91,11 +97,11 @@
{
if( PSA_ALG_IS_ECDSA( alg ) )
{
-#if ( defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) ) && \
- defined(MBEDTLS_PSA_CRYPTO_CONFIG)
+#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
+ ( defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
+ defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) )
return( libtestdriver1_mbedtls_psa_ecdsa_sign_hash(
- attributes,
+ (const libtestdriver1_psa_key_attributes_t *) attributes,
key_buffer, key_buffer_size,
alg, hash, hash_length,
signature, signature_size, signature_length ) );
@@ -141,11 +147,11 @@
if( PSA_ALG_IS_RSA_PKCS1V15_SIGN( alg ) ||
PSA_ALG_IS_RSA_PSS( alg) )
{
-#if ( defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) ) && \
- defined(MBEDTLS_PSA_CRYPTO_CONFIG)
+#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
+ ( defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_SIGN) || \
+ defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_RSA_PSS) )
return( libtestdriver1_mbedtls_psa_rsa_verify_hash(
- attributes,
+ (const libtestdriver1_psa_key_attributes_t *) attributes,
key_buffer, key_buffer_size,
alg, hash, hash_length,
signature, signature_length ) );
@@ -167,11 +173,11 @@
{
if( PSA_ALG_IS_ECDSA( alg ) )
{
-#if ( defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \
- defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) ) && \
- defined(MBEDTLS_PSA_CRYPTO_CONFIG)
+#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
+ ( defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_ECDSA) || \
+ defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_ALG_DETERMINISTIC_ECDSA) )
return( libtestdriver1_mbedtls_psa_ecdsa_verify_hash(
- attributes,
+ (const libtestdriver1_psa_key_attributes_t *) attributes,
key_buffer, key_buffer_size,
alg, hash, hash_length,
signature, signature_length ) );
@@ -233,7 +239,8 @@
return( PSA_SUCCESS );
}
-#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
+#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
+ defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_HASH)
status = libtestdriver1_mbedtls_psa_hash_compute(
PSA_ALG_SIGN_GET_HASH( alg ), input, input_length,
hash, sizeof( hash ), &hash_length );
@@ -297,7 +304,8 @@
if( mbedtls_test_driver_signature_verify_hooks.forced_status != PSA_SUCCESS )
return( mbedtls_test_driver_signature_verify_hooks.forced_status );
-#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
+#if defined(MBEDTLS_TEST_LIBTESTDRIVER1) && \
+ defined(LIBTESTDRIVER1_MBEDTLS_PSA_BUILTIN_HASH)
status = libtestdriver1_mbedtls_psa_hash_compute(
PSA_ALG_SIGN_GET_HASH( alg ), input, input_length,
hash, sizeof( hash ), &hash_length );