From 7b7854ed4bccb051b25e397f5db8e4f110eae055 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Sat, 13 Mar 2021 18:19:08 +0100 Subject: [PATCH] tests: Rename test driver entry points Rename test driver entry points to libtestdriver1_. This aligns with the renaming of all Mbed TLS APIs for the test driver library (that will be put in place in the following commits) to avoid name conflicts when linking it with the Mbed TLS library. Signed-off-by: Ronald Cron --- library/psa_crypto_cipher.c | 17 +++++---- library/psa_crypto_ecp.c | 10 ++--- library/psa_crypto_hash.c | 12 +++--- library/psa_crypto_mac.c | 14 +++---- library/psa_crypto_rsa.c | 10 ++--- tests/include/test/drivers/cipher.h | 16 ++++---- tests/include/test/drivers/hash.h | 12 +++--- tests/include/test/drivers/key_management.h | 12 +++--- tests/include/test/drivers/mac.h | 14 +++---- tests/include/test/drivers/signature.h | 8 ++-- tests/src/drivers/hash.c | 14 +++---- tests/src/drivers/test_driver_cipher.c | 16 ++++---- .../src/drivers/test_driver_key_management.c | 12 +++--- tests/src/drivers/test_driver_mac.c | 14 +++---- tests/src/drivers/test_driver_signature.c | 37 ++++++++++--------- 15 files changed, 110 insertions(+), 108 deletions(-) diff --git a/library/psa_crypto_cipher.c b/library/psa_crypto_cipher.c index 12e52fa42..71dee2bd1 100644 --- a/library/psa_crypto_cipher.c +++ b/library/psa_crypto_cipher.c @@ -665,7 +665,7 @@ psa_status_t mbedtls_psa_cipher_decrypt( const psa_key_attributes_t *attributes, */ #if defined(PSA_CRYPTO_DRIVER_TEST) && defined(MBEDTLS_PSA_CRYPTO_CONFIG) -psa_status_t mbedtls_transparent_test_driver_cipher_encrypt_setup( +psa_status_t libtestdriver1_mbedtls_psa_cipher_encrypt_setup( mbedtls_psa_cipher_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -675,7 +675,7 @@ psa_status_t mbedtls_transparent_test_driver_cipher_encrypt_setup( operation, attributes, key_buffer, key_buffer_size, alg ) ); } -psa_status_t mbedtls_transparent_test_driver_cipher_decrypt_setup( +psa_status_t libtestdriver1_mbedtls_psa_cipher_decrypt_setup( mbedtls_psa_cipher_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -685,14 +685,14 @@ psa_status_t mbedtls_transparent_test_driver_cipher_decrypt_setup( operation, attributes, key_buffer, key_buffer_size, alg ) ); } -psa_status_t mbedtls_transparent_test_driver_cipher_set_iv( +psa_status_t libtestdriver1_mbedtls_psa_cipher_set_iv( mbedtls_psa_cipher_operation_t *operation, const uint8_t *iv, size_t iv_length ) { return( cipher_set_iv( operation, iv, iv_length ) ); } -psa_status_t mbedtls_transparent_test_driver_cipher_update( +psa_status_t libtestdriver1_mbedtls_psa_cipher_update( mbedtls_psa_cipher_operation_t *operation, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length ) @@ -701,20 +701,20 @@ psa_status_t mbedtls_transparent_test_driver_cipher_update( output, output_size, output_length ) ); } -psa_status_t mbedtls_transparent_test_driver_cipher_finish( +psa_status_t libtestdriver1_mbedtls_psa_cipher_finish( mbedtls_psa_cipher_operation_t *operation, uint8_t *output, size_t output_size, size_t *output_length ) { return( cipher_finish( operation, output, output_size, output_length ) ); } -psa_status_t mbedtls_transparent_test_driver_cipher_abort( +psa_status_t libtestdriver1_mbedtls_psa_cipher_abort( mbedtls_psa_cipher_operation_t *operation ) { return( cipher_abort( operation ) ); } -psa_status_t mbedtls_transparent_test_driver_cipher_encrypt( +psa_status_t libtestdriver1_mbedtls_psa_cipher_encrypt( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -730,7 +730,7 @@ psa_status_t mbedtls_transparent_test_driver_cipher_encrypt( output, output_size, output_length ) ); } -psa_status_t mbedtls_transparent_test_driver_cipher_decrypt( +psa_status_t libtestdriver1_mbedtls_psa_cipher_decrypt( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -745,6 +745,7 @@ psa_status_t mbedtls_transparent_test_driver_cipher_decrypt( alg, input, input_length, output, output_size, output_length ) ); } + #endif /* PSA_CRYPTO_DRIVER_TEST && MBEDTLS_PSA_CRYPTO_CONFIG */ #endif /* MBEDTLS_PSA_CRYPTO_C */ diff --git a/library/psa_crypto_ecp.c b/library/psa_crypto_ecp.c index 83cc72df3..3fdcdb267 100644 --- a/library/psa_crypto_ecp.c +++ b/library/psa_crypto_ecp.c @@ -576,7 +576,7 @@ psa_status_t mbedtls_psa_ecdsa_verify_hash( #if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) || \ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY) -psa_status_t mbedtls_transparent_test_driver_ecp_import_key( +psa_status_t libtestdriver1_mbedtls_psa_ecp_import_key( const psa_key_attributes_t *attributes, const uint8_t *data, size_t data_length, uint8_t *key_buffer, size_t key_buffer_size, @@ -587,7 +587,7 @@ psa_status_t mbedtls_transparent_test_driver_ecp_import_key( key_buffer_length, bits ) ); } -psa_status_t mbedtls_transparent_test_driver_ecp_export_public_key( +psa_status_t libtestdriver1_mbedtls_psa_ecp_export_public_key( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, uint8_t *data, size_t data_size, size_t *data_length ) @@ -601,7 +601,7 @@ psa_status_t mbedtls_transparent_test_driver_ecp_export_public_key( #if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) && \ defined(MBEDTLS_GENPRIME) -psa_status_t mbedtls_transparent_test_driver_ecp_generate_key( +psa_status_t libtestdriver1_mbedtls_psa_ecp_generate_key( const psa_key_attributes_t *attributes, uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length ) { @@ -614,7 +614,7 @@ psa_status_t mbedtls_transparent_test_driver_ecp_generate_key( #if defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \ defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) -psa_status_t mbedtls_transparent_test_driver_ecdsa_sign_hash( +psa_status_t libtestdriver1_mbedtls_psa_ecdsa_sign_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, @@ -640,7 +640,7 @@ psa_status_t mbedtls_transparent_test_driver_ecdsa_sign_hash( #endif } -psa_status_t mbedtls_transparent_test_driver_ecdsa_verify_hash( +psa_status_t libtestdriver1_mbedtls_psa_ecdsa_verify_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, diff --git a/library/psa_crypto_hash.c b/library/psa_crypto_hash.c index b9f2757ea..84ba84125 100644 --- a/library/psa_crypto_hash.c +++ b/library/psa_crypto_hash.c @@ -648,7 +648,7 @@ static int is_hash_accelerated( psa_algorithm_t alg ) } } -psa_status_t mbedtls_transparent_test_driver_hash_compute( +psa_status_t libtestdriver1_mbedtls_psa_hash_compute( psa_algorithm_t alg, const uint8_t *input, size_t input_length, @@ -663,7 +663,7 @@ psa_status_t mbedtls_transparent_test_driver_hash_compute( return( PSA_ERROR_NOT_SUPPORTED ); } -psa_status_t mbedtls_transparent_test_driver_hash_setup( +psa_status_t libtestdriver1_mbedtls_psa_hash_setup( mbedtls_psa_hash_operation_t *operation, psa_algorithm_t alg ) { @@ -673,7 +673,7 @@ psa_status_t mbedtls_transparent_test_driver_hash_setup( return( PSA_ERROR_NOT_SUPPORTED ); } -psa_status_t mbedtls_transparent_test_driver_hash_clone( +psa_status_t libtestdriver1_mbedtls_psa_hash_clone( const mbedtls_psa_hash_operation_t *source_operation, mbedtls_psa_hash_operation_t *target_operation ) { @@ -683,7 +683,7 @@ psa_status_t mbedtls_transparent_test_driver_hash_clone( return( PSA_ERROR_BAD_STATE ); } -psa_status_t mbedtls_transparent_test_driver_hash_update( +psa_status_t libtestdriver1_mbedtls_psa_hash_update( mbedtls_psa_hash_operation_t *operation, const uint8_t *input, size_t input_length ) @@ -694,7 +694,7 @@ psa_status_t mbedtls_transparent_test_driver_hash_update( return( PSA_ERROR_BAD_STATE ); } -psa_status_t mbedtls_transparent_test_driver_hash_finish( +psa_status_t libtestdriver1_mbedtls_psa_hash_finish( mbedtls_psa_hash_operation_t *operation, uint8_t *hash, size_t hash_size, @@ -706,7 +706,7 @@ psa_status_t mbedtls_transparent_test_driver_hash_finish( return( PSA_ERROR_BAD_STATE ); } -psa_status_t mbedtls_transparent_test_driver_hash_abort( +psa_status_t libtestdriver1_mbedtls_psa_hash_abort( mbedtls_psa_hash_operation_t *operation ) { return( hash_abort( operation ) ); diff --git a/library/psa_crypto_mac.c b/library/psa_crypto_mac.c index 421d12e03..fe15e9f6b 100644 --- a/library/psa_crypto_mac.c +++ b/library/psa_crypto_mac.c @@ -585,7 +585,7 @@ static int is_mac_accelerated( psa_algorithm_t alg ) } } -psa_status_t mbedtls_transparent_test_driver_mac_compute( +psa_status_t libtestdriver1_mbedtls_psa_mac_compute( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -604,7 +604,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_compute( return( PSA_ERROR_NOT_SUPPORTED ); } -psa_status_t mbedtls_transparent_test_driver_mac_sign_setup( +psa_status_t libtestdriver1_mbedtls_psa_mac_sign_setup( mbedtls_psa_mac_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, @@ -618,7 +618,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_sign_setup( return( PSA_ERROR_NOT_SUPPORTED ); } -psa_status_t mbedtls_transparent_test_driver_mac_verify_setup( +psa_status_t libtestdriver1_mbedtls_psa_mac_verify_setup( mbedtls_psa_mac_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, @@ -632,7 +632,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_verify_setup( return( PSA_ERROR_NOT_SUPPORTED ); } -psa_status_t mbedtls_transparent_test_driver_mac_update( +psa_status_t libtestdriver1_mbedtls_psa_mac_update( mbedtls_psa_mac_operation_t *operation, const uint8_t *input, size_t input_length ) @@ -643,7 +643,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_update( return( PSA_ERROR_BAD_STATE ); } -psa_status_t mbedtls_transparent_test_driver_mac_sign_finish( +psa_status_t libtestdriver1_mbedtls_psa_mac_sign_finish( mbedtls_psa_mac_operation_t *operation, uint8_t *mac, size_t mac_size, @@ -655,7 +655,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_sign_finish( return( PSA_ERROR_BAD_STATE ); } -psa_status_t mbedtls_transparent_test_driver_mac_verify_finish( +psa_status_t libtestdriver1_mbedtls_psa_mac_verify_finish( mbedtls_psa_mac_operation_t *operation, const uint8_t *mac, size_t mac_length ) @@ -666,7 +666,7 @@ psa_status_t mbedtls_transparent_test_driver_mac_verify_finish( return( PSA_ERROR_BAD_STATE ); } -psa_status_t mbedtls_transparent_test_driver_mac_abort( +psa_status_t libtestdriver1_mbedtls_psa_mac_abort( mbedtls_psa_mac_operation_t *operation ) { return( mac_abort( operation ) ); diff --git a/library/psa_crypto_rsa.c b/library/psa_crypto_rsa.c index 705cb413e..4ee0adf9e 100644 --- a/library/psa_crypto_rsa.c +++ b/library/psa_crypto_rsa.c @@ -633,7 +633,7 @@ psa_status_t mbedtls_psa_rsa_verify_hash( #if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) || \ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY) -psa_status_t mbedtls_transparent_test_driver_rsa_import_key( +psa_status_t libtestdriver1_mbedtls_psa_rsa_import_key( const psa_key_attributes_t *attributes, const uint8_t *data, size_t data_length, uint8_t *key_buffer, size_t key_buffer_size, @@ -644,7 +644,7 @@ psa_status_t mbedtls_transparent_test_driver_rsa_import_key( key_buffer_length, bits ) ); } -psa_status_t mbedtls_transparent_test_driver_rsa_export_public_key( +psa_status_t libtestdriver1_mbedtls_psa_rsa_export_public_key( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, uint8_t *data, size_t data_size, size_t *data_length ) @@ -657,7 +657,7 @@ psa_status_t mbedtls_transparent_test_driver_rsa_export_public_key( defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY) */ #if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) -psa_status_t mbedtls_transparent_test_driver_rsa_generate_key( +psa_status_t libtestdriver1_mbedtls_psa_rsa_generate_key( const psa_key_attributes_t *attributes, uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length ) { @@ -668,7 +668,7 @@ psa_status_t mbedtls_transparent_test_driver_rsa_generate_key( #if defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \ defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) -psa_status_t mbedtls_transparent_test_driver_rsa_sign_hash( +psa_status_t libtestdriver1_mbedtls_psa_rsa_sign_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, @@ -695,7 +695,7 @@ psa_status_t mbedtls_transparent_test_driver_rsa_sign_hash( #endif } -psa_status_t mbedtls_transparent_test_driver_rsa_verify_hash( +psa_status_t libtestdriver1_mbedtls_psa_rsa_verify_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, diff --git a/tests/include/test/drivers/cipher.h b/tests/include/test/drivers/cipher.h index 053b0c34c..cf24bbdcb 100644 --- a/tests/include/test/drivers/cipher.h +++ b/tests/include/test/drivers/cipher.h @@ -141,35 +141,35 @@ psa_status_t mbedtls_test_opaque_cipher_finish( uint8_t *output, size_t output_size, size_t *output_length); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -psa_status_t mbedtls_transparent_test_driver_cipher_encrypt_setup( +psa_status_t libtestdriver1_mbedtls_psa_cipher_encrypt_setup( mbedtls_psa_cipher_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg ); -psa_status_t mbedtls_transparent_test_driver_cipher_decrypt_setup( +psa_status_t libtestdriver1_mbedtls_psa_cipher_decrypt_setup( mbedtls_psa_cipher_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg ); -psa_status_t mbedtls_transparent_test_driver_cipher_set_iv( +psa_status_t libtestdriver1_mbedtls_psa_cipher_set_iv( mbedtls_psa_cipher_operation_t *operation, const uint8_t *iv, size_t iv_length ); -psa_status_t mbedtls_transparent_test_driver_cipher_update( +psa_status_t libtestdriver1_mbedtls_psa_cipher_update( mbedtls_psa_cipher_operation_t *operation, const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size, size_t *output_length ); -psa_status_t mbedtls_transparent_test_driver_cipher_finish( +psa_status_t libtestdriver1_mbedtls_psa_cipher_finish( mbedtls_psa_cipher_operation_t *operation, uint8_t *output, size_t output_size, size_t *output_length ); -psa_status_t mbedtls_transparent_test_driver_cipher_abort( +psa_status_t libtestdriver1_mbedtls_psa_cipher_abort( mbedtls_psa_cipher_operation_t *operation ); -psa_status_t mbedtls_transparent_test_driver_cipher_encrypt( +psa_status_t libtestdriver1_mbedtls_psa_cipher_encrypt( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -180,7 +180,7 @@ psa_status_t mbedtls_transparent_test_driver_cipher_encrypt( size_t output_size, size_t *output_length ); -psa_status_t mbedtls_transparent_test_driver_cipher_decrypt( +psa_status_t libtestdriver1_mbedtls_psa_cipher_decrypt( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, diff --git a/tests/include/test/drivers/hash.h b/tests/include/test/drivers/hash.h index e0de79a28..2226841f1 100644 --- a/tests/include/test/drivers/hash.h +++ b/tests/include/test/drivers/hash.h @@ -78,7 +78,7 @@ psa_status_t mbedtls_test_transparent_hash_abort( #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -psa_status_t mbedtls_transparent_test_driver_hash_compute( +psa_status_t libtestdriver1_mbedtls_psa_hash_compute( psa_algorithm_t alg, const uint8_t *input, size_t input_length, @@ -86,26 +86,26 @@ psa_status_t mbedtls_transparent_test_driver_hash_compute( size_t hash_size, size_t *hash_length); -psa_status_t mbedtls_transparent_test_driver_hash_setup( +psa_status_t libtestdriver1_mbedtls_psa_hash_setup( mbedtls_psa_hash_operation_t *operation, psa_algorithm_t alg ); -psa_status_t mbedtls_transparent_test_driver_hash_clone( +psa_status_t libtestdriver1_mbedtls_psa_hash_clone( const mbedtls_psa_hash_operation_t *source_operation, mbedtls_psa_hash_operation_t *target_operation ); -psa_status_t mbedtls_transparent_test_driver_hash_update( +psa_status_t libtestdriver1_mbedtls_psa_hash_update( mbedtls_psa_hash_operation_t *operation, const uint8_t *input, size_t input_length ); -psa_status_t mbedtls_transparent_test_driver_hash_finish( +psa_status_t libtestdriver1_mbedtls_psa_hash_finish( mbedtls_psa_hash_operation_t *operation, uint8_t *hash, size_t hash_size, size_t *hash_length ); -psa_status_t mbedtls_transparent_test_driver_hash_abort( +psa_status_t libtestdriver1_mbedtls_psa_hash_abort( mbedtls_psa_hash_operation_t *operation ); #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */ diff --git a/tests/include/test/drivers/key_management.h b/tests/include/test/drivers/key_management.h index 79572ad5d..cff86f542 100644 --- a/tests/include/test/drivers/key_management.h +++ b/tests/include/test/drivers/key_management.h @@ -100,33 +100,33 @@ psa_status_t mbedtls_test_opaque_get_builtin_key( #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -psa_status_t mbedtls_transparent_test_driver_ecp_import_key( +psa_status_t libtestdriver1_mbedtls_psa_ecp_import_key( const psa_key_attributes_t *attributes, const uint8_t *data, size_t data_length, uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length, size_t *bits ); -psa_status_t mbedtls_transparent_test_driver_ecp_export_public_key( +psa_status_t libtestdriver1_mbedtls_psa_ecp_export_public_key( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, uint8_t *data, size_t data_size, size_t *data_length ); -psa_status_t mbedtls_transparent_test_driver_ecp_generate_key( +psa_status_t libtestdriver1_mbedtls_psa_ecp_generate_key( const psa_key_attributes_t *attributes, uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length ); -psa_status_t mbedtls_transparent_test_driver_rsa_import_key( +psa_status_t libtestdriver1_mbedtls_psa_rsa_import_key( const psa_key_attributes_t *attributes, const uint8_t *data, size_t data_length, uint8_t *key_buffer, size_t key_buffer_size, size_t *key_buffer_length, size_t *bits ); -psa_status_t mbedtls_transparent_test_driver_rsa_export_public_key( +psa_status_t libtestdriver1_mbedtls_psa_rsa_export_public_key( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, uint8_t *data, size_t data_size, size_t *data_length ); -psa_status_t mbedtls_transparent_test_driver_rsa_generate_key( +psa_status_t libtestdriver1_mbedtls_psa_rsa_generate_key( const psa_key_attributes_t *attributes, uint8_t *key, size_t key_size, size_t *key_length ); diff --git a/tests/include/test/drivers/mac.h b/tests/include/test/drivers/mac.h index f8e7a1191..b49a16b90 100644 --- a/tests/include/test/drivers/mac.h +++ b/tests/include/test/drivers/mac.h @@ -139,7 +139,7 @@ psa_status_t mbedtls_test_opaque_mac_abort( #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -psa_status_t mbedtls_transparent_test_driver_mac_compute( +psa_status_t libtestdriver1_mbedtls_psa_mac_compute( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, @@ -150,37 +150,37 @@ psa_status_t mbedtls_transparent_test_driver_mac_compute( size_t mac_size, size_t *mac_length ); -psa_status_t mbedtls_transparent_test_driver_mac_sign_setup( +psa_status_t libtestdriver1_mbedtls_psa_mac_sign_setup( mbedtls_psa_mac_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg ); -psa_status_t mbedtls_transparent_test_driver_mac_verify_setup( +psa_status_t libtestdriver1_mbedtls_psa_mac_verify_setup( mbedtls_psa_mac_operation_t *operation, const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg ); -psa_status_t mbedtls_transparent_test_driver_mac_update( +psa_status_t libtestdriver1_mbedtls_psa_mac_update( mbedtls_psa_mac_operation_t *operation, const uint8_t *input, size_t input_length ); -psa_status_t mbedtls_transparent_test_driver_mac_sign_finish( +psa_status_t libtestdriver1_mbedtls_psa_mac_sign_finish( mbedtls_psa_mac_operation_t *operation, uint8_t *mac, size_t mac_size, size_t *mac_length ); -psa_status_t mbedtls_transparent_test_driver_mac_verify_finish( +psa_status_t libtestdriver1_mbedtls_psa_mac_verify_finish( mbedtls_psa_mac_operation_t *operation, const uint8_t *mac, size_t mac_length ); -psa_status_t mbedtls_transparent_test_driver_mac_abort( +psa_status_t libtestdriver1_mbedtls_psa_mac_abort( mbedtls_psa_mac_operation_t *operation ); #endif /* MBEDTLS_PSA_CRYPTO_CONFIG */ diff --git a/tests/include/test/drivers/signature.h b/tests/include/test/drivers/signature.h index d2321ba09..8ea2cfafe 100644 --- a/tests/include/test/drivers/signature.h +++ b/tests/include/test/drivers/signature.h @@ -127,25 +127,25 @@ psa_status_t mbedtls_test_opaque_signature_verify_hash( #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) -psa_status_t mbedtls_transparent_test_driver_ecdsa_sign_hash( +psa_status_t libtestdriver1_mbedtls_psa_ecdsa_sign_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, uint8_t *signature, size_t signature_size, size_t *signature_length ); -psa_status_t mbedtls_transparent_test_driver_ecdsa_verify_hash( +psa_status_t libtestdriver1_mbedtls_psa_ecdsa_verify_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, const uint8_t *signature, size_t signature_length ); -psa_status_t mbedtls_transparent_test_driver_rsa_sign_hash( +psa_status_t libtestdriver1_mbedtls_psa_rsa_sign_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, uint8_t *signature, size_t signature_size, size_t *signature_length ); -psa_status_t mbedtls_transparent_test_driver_rsa_verify_hash( +psa_status_t libtestdriver1_mbedtls_psa_rsa_verify_hash( const psa_key_attributes_t *attributes, const uint8_t *key_buffer, size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, diff --git a/tests/src/drivers/hash.c b/tests/src/drivers/hash.c index e61866096..99de56f1c 100644 --- a/tests/src/drivers/hash.c +++ b/tests/src/drivers/hash.c @@ -47,7 +47,7 @@ psa_status_t mbedtls_test_transparent_hash_compute( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_hash_hooks.driver_status = - mbedtls_transparent_test_driver_hash_compute( + libtestdriver1_mbedtls_psa_hash_compute( alg, input, input_length, hash, hash_size, hash_length ); #elif defined(MBEDTLS_PSA_BUILTIN_HASH) @@ -84,7 +84,7 @@ psa_status_t mbedtls_test_transparent_hash_setup( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_hash_hooks.driver_status = - mbedtls_transparent_test_driver_hash_setup( operation, alg ); + libtestdriver1_mbedtls_psa_hash_setup( operation, alg ); #elif defined(MBEDTLS_PSA_BUILTIN_HASH) mbedtls_test_driver_hash_hooks.driver_status = mbedtls_psa_hash_setup( operation, alg ); @@ -113,8 +113,8 @@ psa_status_t mbedtls_test_transparent_hash_clone( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_hash_hooks.driver_status = - mbedtls_transparent_test_driver_hash_clone( source_operation, - target_operation ); + libtestdriver1_mbedtls_psa_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 ); @@ -144,7 +144,7 @@ psa_status_t mbedtls_test_transparent_hash_update( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_hash_hooks.driver_status = - mbedtls_transparent_test_driver_hash_update( + libtestdriver1_mbedtls_psa_hash_update( operation, input, input_length ); #elif defined(MBEDTLS_PSA_BUILTIN_HASH) mbedtls_test_driver_hash_hooks.driver_status = @@ -177,7 +177,7 @@ psa_status_t mbedtls_test_transparent_hash_finish( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_hash_hooks.driver_status = - mbedtls_transparent_test_driver_hash_finish( + libtestdriver1_mbedtls_psa_hash_finish( operation, hash, hash_size, hash_length ); #elif defined(MBEDTLS_PSA_BUILTIN_HASH) mbedtls_test_driver_hash_hooks.driver_status = @@ -208,7 +208,7 @@ psa_status_t mbedtls_test_transparent_hash_abort( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_hash_hooks.driver_status = - mbedtls_transparent_test_driver_hash_abort( operation ); + libtestdriver1_mbedtls_psa_hash_abort( operation ); #elif defined(MBEDTLS_PSA_BUILTIN_HASH) mbedtls_test_driver_hash_hooks.driver_status = mbedtls_psa_hash_abort( operation ); diff --git a/tests/src/drivers/test_driver_cipher.c b/tests/src/drivers/test_driver_cipher.c index 03c160de8..b70ef61fc 100644 --- a/tests/src/drivers/test_driver_cipher.c +++ b/tests/src/drivers/test_driver_cipher.c @@ -71,7 +71,7 @@ psa_status_t mbedtls_test_transparent_cipher_encrypt( psa_generate_random( output, PSA_CIPHER_IV_LENGTH( attributes->core.type, alg ) ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_cipher_encrypt( + return( libtestdriver1_mbedtls_psa_cipher_encrypt( attributes, key_buffer, key_buffer_size, alg, input, input_length, output, output_size, output_length ) ); @@ -115,7 +115,7 @@ psa_status_t mbedtls_test_transparent_cipher_decrypt( return( mbedtls_test_driver_cipher_hooks.forced_status ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_cipher_decrypt( + return( libtestdriver1_mbedtls_psa_cipher_decrypt( attributes, key_buffer, key_buffer_size, alg, input, input_length, output, output_size, output_length ) ); @@ -147,7 +147,7 @@ psa_status_t mbedtls_test_transparent_cipher_encrypt_setup( return( mbedtls_test_driver_cipher_hooks.forced_status ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_cipher_encrypt_setup( + return( libtestdriver1_mbedtls_psa_cipher_encrypt_setup( operation, attributes, key, key_length, alg ) ); #elif defined(MBEDTLS_PSA_BUILTIN_CIPHER) return( mbedtls_psa_cipher_encrypt_setup( @@ -169,7 +169,7 @@ psa_status_t mbedtls_test_transparent_cipher_decrypt_setup( return( mbedtls_test_driver_cipher_hooks.forced_status ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_cipher_decrypt_setup( + return( libtestdriver1_mbedtls_psa_cipher_decrypt_setup( operation, attributes, key, key_length, alg ) ); #elif defined(MBEDTLS_PSA_BUILTIN_CIPHER) return( mbedtls_psa_cipher_decrypt_setup( @@ -188,7 +188,7 @@ psa_status_t mbedtls_test_transparent_cipher_abort( return( PSA_SUCCESS ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - mbedtls_transparent_test_driver_cipher_abort( operation ); + libtestdriver1_mbedtls_psa_cipher_abort( operation ); #elif defined(MBEDTLS_PSA_BUILTIN_CIPHER) mbedtls_psa_cipher_abort( operation ); #endif @@ -213,7 +213,7 @@ psa_status_t mbedtls_test_transparent_cipher_set_iv( return( mbedtls_test_driver_cipher_hooks.forced_status ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_cipher_set_iv( + return( libtestdriver1_mbedtls_psa_cipher_set_iv( operation, iv, iv_length ) ); #elif defined(MBEDTLS_PSA_BUILTIN_CIPHER) return( mbedtls_psa_cipher_set_iv( operation, iv, iv_length ) ); @@ -249,7 +249,7 @@ psa_status_t mbedtls_test_transparent_cipher_update( return( mbedtls_test_driver_cipher_hooks.forced_status ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_cipher_update( + return( libtestdriver1_mbedtls_psa_cipher_update( operation, input, input_length, output, output_size, output_length ) ); #elif defined(MBEDTLS_PSA_BUILTIN_CIPHER) @@ -286,7 +286,7 @@ psa_status_t mbedtls_test_transparent_cipher_finish( return( mbedtls_test_driver_cipher_hooks.forced_status ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_cipher_finish( + return( libtestdriver1_mbedtls_psa_cipher_finish( operation, output, output_size, output_length ) ); #elif defined(MBEDTLS_PSA_BUILTIN_CIPHER) return( mbedtls_psa_cipher_finish( diff --git a/tests/src/drivers/test_driver_key_management.c b/tests/src/drivers/test_driver_key_management.c index 3d8828549..ce646bad7 100644 --- a/tests/src/drivers/test_driver_key_management.c +++ b/tests/src/drivers/test_driver_key_management.c @@ -105,7 +105,7 @@ psa_status_t mbedtls_test_transparent_generate_key( { #if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_ecp_generate_key( + return( libtestdriver1_mbedtls_psa_ecp_generate_key( attributes, key, key_size, key_length ) ); #elif defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR) return( mbedtls_psa_ecp_generate_key( @@ -116,7 +116,7 @@ psa_status_t mbedtls_test_transparent_generate_key( { #if defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_rsa_generate_key( + return( libtestdriver1_mbedtls_psa_rsa_generate_key( attributes, key, key_size, key_length ) ); #elif defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_RSA_KEY_PAIR) return( mbedtls_psa_rsa_generate_key( @@ -160,7 +160,7 @@ psa_status_t mbedtls_test_transparent_import_key( #if ( defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) || \ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_ecp_import_key( + return( libtestdriver1_mbedtls_psa_ecp_import_key( attributes, data, data_length, key_buffer, key_buffer_size, @@ -179,7 +179,7 @@ psa_status_t mbedtls_test_transparent_import_key( #if ( defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) || \ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_rsa_import_key( + return( libtestdriver1_mbedtls_psa_rsa_import_key( attributes, data, data_length, key_buffer, key_buffer_size, @@ -298,7 +298,7 @@ psa_status_t mbedtls_test_transparent_export_public_key( #if ( defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_KEY_PAIR) || \ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_ECC_PUBLIC_KEY) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_ecp_export_public_key( + return( libtestdriver1_mbedtls_psa_ecp_export_public_key( attributes, key_buffer, key_buffer_size, data, data_size, data_length ) ); @@ -315,7 +315,7 @@ psa_status_t mbedtls_test_transparent_export_public_key( #if ( defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_KEY_PAIR) || \ defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_RSA_PUBLIC_KEY) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_rsa_export_public_key( + return( libtestdriver1_mbedtls_psa_rsa_export_public_key( attributes, key_buffer, key_buffer_size, data, data_size, data_length ) ); diff --git a/tests/src/drivers/test_driver_mac.c b/tests/src/drivers/test_driver_mac.c index 6f8c3c4b9..a6c2c88a6 100644 --- a/tests/src/drivers/test_driver_mac.c +++ b/tests/src/drivers/test_driver_mac.c @@ -53,7 +53,7 @@ psa_status_t mbedtls_test_transparent_mac_compute( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_mac_hooks.driver_status = - mbedtls_transparent_test_driver_mac_compute( + libtestdriver1_mbedtls_psa_mac_compute( attributes, key_buffer, key_buffer_size, alg, input, input_length, mac, mac_size, mac_length ); @@ -98,7 +98,7 @@ psa_status_t mbedtls_test_transparent_mac_sign_setup( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_mac_hooks.driver_status = - mbedtls_transparent_test_driver_mac_sign_setup( + libtestdriver1_mbedtls_psa_mac_sign_setup( operation, attributes, key_buffer, key_buffer_size, alg ); #elif defined(MBEDTLS_PSA_BUILTIN_MAC) mbedtls_test_driver_mac_hooks.driver_status = @@ -135,7 +135,7 @@ psa_status_t mbedtls_test_transparent_mac_verify_setup( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_mac_hooks.driver_status = - mbedtls_transparent_test_driver_mac_verify_setup( + libtestdriver1_mbedtls_psa_mac_verify_setup( operation, attributes, key_buffer, key_buffer_size, alg ); #elif defined(MBEDTLS_PSA_BUILTIN_MAC) mbedtls_test_driver_mac_hooks.driver_status = @@ -170,7 +170,7 @@ psa_status_t mbedtls_test_transparent_mac_update( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_mac_hooks.driver_status = - mbedtls_transparent_test_driver_mac_update( + libtestdriver1_mbedtls_psa_mac_update( operation, input, input_length ); #elif defined(MBEDTLS_PSA_BUILTIN_MAC) mbedtls_test_driver_mac_hooks.driver_status = @@ -204,7 +204,7 @@ psa_status_t mbedtls_test_transparent_mac_sign_finish( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_mac_hooks.driver_status = - mbedtls_transparent_test_driver_mac_sign_finish( + libtestdriver1_mbedtls_psa_mac_sign_finish( operation, mac, mac_size, mac_length ); #elif defined(MBEDTLS_PSA_BUILTIN_MAC) mbedtls_test_driver_mac_hooks.driver_status = @@ -238,7 +238,7 @@ psa_status_t mbedtls_test_transparent_mac_verify_finish( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_mac_hooks.driver_status = - mbedtls_transparent_test_driver_mac_verify_finish( + libtestdriver1_mbedtls_psa_mac_verify_finish( operation, mac, mac_length ); #elif defined(MBEDTLS_PSA_BUILTIN_MAC) mbedtls_test_driver_mac_hooks.driver_status = @@ -269,7 +269,7 @@ psa_status_t mbedtls_test_transparent_mac_abort( { #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) mbedtls_test_driver_mac_hooks.driver_status = - mbedtls_transparent_test_driver_mac_abort( operation ); + libtestdriver1_mbedtls_psa_mac_abort( operation ); #elif defined(MBEDTLS_PSA_BUILTIN_MAC) mbedtls_test_driver_mac_hooks.driver_status = mbedtls_psa_mac_abort( operation ); diff --git a/tests/src/drivers/test_driver_signature.c b/tests/src/drivers/test_driver_signature.c index 443b52eef..a656287b6 100644 --- a/tests/src/drivers/test_driver_signature.c +++ b/tests/src/drivers/test_driver_signature.c @@ -35,6 +35,7 @@ #include "test/drivers/hash.h" #include "test/drivers/signature.h" +#include "test/drivers/hash.h" #include "mbedtls/md.h" #include "mbedtls/ecdsa.h" @@ -67,18 +68,18 @@ psa_status_t sign_hash( #if ( defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \ defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_rsa_sign_hash( + return( libtestdriver1_mbedtls_psa_rsa_sign_hash( attributes, key_buffer, key_buffer_size, alg, hash, hash_length, signature, signature_size, signature_length ) ); #elif defined(MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_SIGN) || \ defined(MBEDTLS_PSA_BUILTIN_ALG_RSA_PSS) - return( mbedtls_psa_rsa_sign_hash( - attributes, - key_buffer, key_buffer_size, - alg, hash, hash_length, - signature, signature_size, signature_length ) ); + return( mbedtls_psa_rsa_sign_hash( + attributes, + key_buffer, key_buffer_size, + alg, hash, hash_length, + signature, signature_size, signature_length ) ); #endif } else @@ -93,7 +94,7 @@ psa_status_t sign_hash( #if ( defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \ defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_ecdsa_sign_hash( + return( libtestdriver1_mbedtls_psa_ecdsa_sign_hash( attributes, key_buffer, key_buffer_size, alg, hash, hash_length, @@ -143,18 +144,18 @@ psa_status_t verify_hash( #if ( defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PKCS1V15_SIGN) || \ defined(MBEDTLS_PSA_ACCEL_ALG_RSA_PSS) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_rsa_verify_hash( + return( libtestdriver1_mbedtls_psa_rsa_verify_hash( attributes, key_buffer, key_buffer_size, alg, hash, hash_length, signature, signature_length ) ); #elif defined(MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_SIGN) || \ defined(MBEDTLS_PSA_BUILTIN_ALG_RSA_PSS) - return( mbedtls_psa_rsa_verify_hash( - attributes, - key_buffer, key_buffer_size, - alg, hash, hash_length, - signature, signature_length ) ); + return( mbedtls_psa_rsa_verify_hash( + attributes, + key_buffer, key_buffer_size, + alg, hash, hash_length, + signature, signature_length ) ); #endif } else @@ -169,7 +170,7 @@ psa_status_t verify_hash( #if ( defined(MBEDTLS_PSA_ACCEL_ALG_ECDSA) || \ defined(MBEDTLS_PSA_ACCEL_ALG_DETERMINISTIC_ECDSA) ) && \ defined(MBEDTLS_PSA_CRYPTO_CONFIG) - return( mbedtls_transparent_test_driver_ecdsa_verify_hash( + return( libtestdriver1_mbedtls_psa_ecdsa_verify_hash( attributes, key_buffer, key_buffer_size, alg, hash, hash_length, @@ -233,7 +234,7 @@ psa_status_t mbedtls_test_transparent_signature_sign_message( } #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - status = mbedtls_transparent_test_driver_hash_compute( + status = libtestdriver1_mbedtls_psa_hash_compute( PSA_ALG_SIGN_GET_HASH( alg ), input, input_length, hash, sizeof( hash ), &hash_length ); #elif defined(MBEDTLS_PSA_BUILTIN_HASH) @@ -297,7 +298,7 @@ psa_status_t mbedtls_test_transparent_signature_verify_message( return( mbedtls_test_driver_signature_verify_hooks.forced_status ); #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) - status = mbedtls_transparent_test_driver_hash_compute( + status = libtestdriver1_mbedtls_psa_hash_compute( PSA_ALG_SIGN_GET_HASH( alg ), input, input_length, hash, sizeof( hash ), &hash_length ); #elif defined(MBEDTLS_PSA_BUILTIN_HASH) @@ -361,9 +362,9 @@ psa_status_t mbedtls_test_transparent_signature_sign_hash( return( PSA_SUCCESS ); } - return sign_hash( attributes, key_buffer, key_buffer_size, + return( sign_hash( attributes, key_buffer, key_buffer_size, alg, hash, hash_length, - signature, signature_size, signature_length ); + signature, signature_size, signature_length ) ); } psa_status_t mbedtls_test_opaque_signature_sign_hash(