From 25555227e5341cdff9a1fda4641bc788c0d07d77 Mon Sep 17 00:00:00 2001 From: Steven Cooreman Date: Mon, 8 Mar 2021 16:20:04 +0100 Subject: [PATCH] Rename hash test driver functions to match auto-naming scheme Signed-off-by: Steven Cooreman --- library/psa_crypto_driver_wrappers.c | 12 ++++----- library/psa_crypto_driver_wrappers_contexts.h | 2 +- library/psa_crypto_hash.c | 24 ++++++++--------- library/psa_crypto_hash.h | 26 +++++++++---------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/library/psa_crypto_driver_wrappers.c b/library/psa_crypto_driver_wrappers.c index 7bb0185dd..97e4ee869 100644 --- a/library/psa_crypto_driver_wrappers.c +++ b/library/psa_crypto_driver_wrappers.c @@ -1084,7 +1084,7 @@ psa_status_t psa_driver_wrapper_hash_compute( /* Try accelerators first */ #if defined(PSA_CRYPTO_DRIVER_TEST) - status = test_transparent_hash_compute( alg, input, input_length, + status = mbedtls_transparent_test_driver_hash_compute( alg, input, input_length, hash, hash_size, hash_length ); if( status != PSA_ERROR_NOT_SUPPORTED ) return( status ); @@ -1116,7 +1116,7 @@ psa_status_t psa_driver_wrapper_hash_setup( /* Try setup on accelerators first */ #if defined(PSA_CRYPTO_DRIVER_TEST) - status = test_transparent_hash_setup( &operation->ctx.test_ctx, alg ); + status = mbedtls_transparent_test_driver_hash_setup( &operation->ctx.test_ctx, alg ); if( status == PSA_SUCCESS ) operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID; @@ -1149,7 +1149,7 @@ psa_status_t psa_driver_wrapper_hash_clone( #if defined(PSA_CRYPTO_DRIVER_TEST) case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID: target_operation->id = PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID; - return( test_transparent_hash_clone( &source_operation->ctx.test_ctx, + return( mbedtls_transparent_test_driver_hash_clone( &source_operation->ctx.test_ctx, &target_operation->ctx.test_ctx ) ); #endif #if defined(MBEDTLS_PSA_BUILTIN_HASH) @@ -1174,7 +1174,7 @@ psa_status_t psa_driver_wrapper_hash_update( { #if defined(PSA_CRYPTO_DRIVER_TEST) case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID: - return( test_transparent_hash_update( &operation->ctx.test_ctx, + return( mbedtls_transparent_test_driver_hash_update( &operation->ctx.test_ctx, input, input_length ) ); #endif #if defined(MBEDTLS_PSA_BUILTIN_HASH) @@ -1200,7 +1200,7 @@ psa_status_t psa_driver_wrapper_hash_finish( { #if defined(PSA_CRYPTO_DRIVER_TEST) case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID: - return( test_transparent_hash_finish( &operation->ctx.test_ctx, + return( mbedtls_transparent_test_driver_hash_finish( &operation->ctx.test_ctx, hash, hash_size, hash_length ) ); #endif #if defined(MBEDTLS_PSA_BUILTIN_HASH) @@ -1225,7 +1225,7 @@ psa_status_t psa_driver_wrapper_hash_abort( { #if defined(PSA_CRYPTO_DRIVER_TEST) case PSA_CRYPTO_TRANSPARENT_TEST_DRIVER_ID: - return( test_transparent_hash_abort( &operation->ctx.test_ctx ) ); + return( mbedtls_transparent_test_driver_hash_abort( &operation->ctx.test_ctx ) ); #endif #if defined(MBEDTLS_PSA_BUILTIN_HASH) case PSA_CRYPTO_MBED_TLS_DRIVER_ID: diff --git a/library/psa_crypto_driver_wrappers_contexts.h b/library/psa_crypto_driver_wrappers_contexts.h index 8cc21a287..8db55c937 100644 --- a/library/psa_crypto_driver_wrappers_contexts.h +++ b/library/psa_crypto_driver_wrappers_contexts.h @@ -46,7 +46,7 @@ typedef union { unsigned dummy; /* Make sure this structure is always non-empty */ mbedtls_psa_hash_operation_t mbedtls_ctx; #if defined(PSA_CRYPTO_DRIVER_TEST) - test_transparent_hash_operation_t test_ctx; + mbedtls_transparent_test_driver_hash_operation_t test_ctx; #endif } psa_driver_hash_context_t; diff --git a/library/psa_crypto_hash.c b/library/psa_crypto_hash.c index 9a9dd0997..b573c7aee 100644 --- a/library/psa_crypto_hash.c +++ b/library/psa_crypto_hash.c @@ -541,7 +541,7 @@ psa_status_t is_hash_accelerated( psa_algorithm_t alg ) } #endif /* INCLUDE_HASH_TEST_DRIVER */ -psa_status_t test_transparent_hash_compute( +psa_status_t mbedtls_transparent_test_driver_hash_compute( psa_algorithm_t alg, const uint8_t *input, size_t input_length, @@ -566,8 +566,8 @@ psa_status_t test_transparent_hash_compute( #endif } -psa_status_t test_transparent_hash_setup( - test_transparent_hash_operation_t *operation, +psa_status_t mbedtls_transparent_test_driver_hash_setup( + mbedtls_transparent_test_driver_hash_operation_t *operation, psa_algorithm_t alg ) { #if defined(INCLUDE_HASH_TEST_DRIVER) @@ -582,9 +582,9 @@ psa_status_t test_transparent_hash_setup( #endif } -psa_status_t test_transparent_hash_clone( - const test_transparent_hash_operation_t *source_operation, - test_transparent_hash_operation_t *target_operation ) +psa_status_t mbedtls_transparent_test_driver_hash_clone( + const mbedtls_transparent_test_driver_hash_operation_t *source_operation, + mbedtls_transparent_test_driver_hash_operation_t *target_operation ) { #if defined(INCLUDE_HASH_TEST_DRIVER) if( is_hash_accelerated( source_operation->operation.alg ) == PSA_SUCCESS ) @@ -599,8 +599,8 @@ psa_status_t test_transparent_hash_clone( #endif } -psa_status_t test_transparent_hash_update( - test_transparent_hash_operation_t *operation, +psa_status_t mbedtls_transparent_test_driver_hash_update( + mbedtls_transparent_test_driver_hash_operation_t *operation, const uint8_t *input, size_t input_length ) { @@ -618,8 +618,8 @@ psa_status_t test_transparent_hash_update( #endif } -psa_status_t test_transparent_hash_finish( - test_transparent_hash_operation_t *operation, +psa_status_t mbedtls_transparent_test_driver_hash_finish( + mbedtls_transparent_test_driver_hash_operation_t *operation, uint8_t *hash, size_t hash_size, size_t *hash_length ) @@ -639,8 +639,8 @@ psa_status_t test_transparent_hash_finish( #endif } -psa_status_t test_transparent_hash_abort( - test_transparent_hash_operation_t *operation ) +psa_status_t mbedtls_transparent_test_driver_hash_abort( + mbedtls_transparent_test_driver_hash_operation_t *operation ) { #if defined(INCLUDE_HASH_TEST_DRIVER) return( mbedtls_psa_hash_abort( &operation->operation ) ); diff --git a/library/psa_crypto_hash.h b/library/psa_crypto_hash.h index ed528ab4c..7d52624a0 100644 --- a/library/psa_crypto_hash.h +++ b/library/psa_crypto_hash.h @@ -278,9 +278,9 @@ psa_status_t mbedtls_psa_hash_abort( #if defined(PSA_CRYPTO_DRIVER_TEST) typedef struct { mbedtls_psa_hash_operation_t operation; -} test_transparent_hash_operation_t; +} mbedtls_transparent_test_driver_hash_operation_t; -psa_status_t test_transparent_hash_compute( +psa_status_t mbedtls_transparent_test_driver_hash_compute( psa_algorithm_t alg, const uint8_t *input, size_t input_length, @@ -288,27 +288,27 @@ psa_status_t test_transparent_hash_compute( size_t hash_size, size_t *hash_length); -psa_status_t test_transparent_hash_setup( - test_transparent_hash_operation_t *operation, +psa_status_t mbedtls_transparent_test_driver_hash_setup( + mbedtls_transparent_test_driver_hash_operation_t *operation, psa_algorithm_t alg ); -psa_status_t test_transparent_hash_clone( - const test_transparent_hash_operation_t *source_operation, - test_transparent_hash_operation_t *target_operation ); +psa_status_t mbedtls_transparent_test_driver_hash_clone( + const mbedtls_transparent_test_driver_hash_operation_t *source_operation, + mbedtls_transparent_test_driver_hash_operation_t *target_operation ); -psa_status_t test_transparent_hash_update( - test_transparent_hash_operation_t *operation, +psa_status_t mbedtls_transparent_test_driver_hash_update( + mbedtls_transparent_test_driver_hash_operation_t *operation, const uint8_t *input, size_t input_length ); -psa_status_t test_transparent_hash_finish( - test_transparent_hash_operation_t *operation, +psa_status_t mbedtls_transparent_test_driver_hash_finish( + mbedtls_transparent_test_driver_hash_operation_t *operation, uint8_t *hash, size_t hash_size, size_t *hash_length ); -psa_status_t test_transparent_hash_abort( - test_transparent_hash_operation_t *operation ); +psa_status_t mbedtls_transparent_test_driver_hash_abort( + mbedtls_transparent_test_driver_hash_operation_t *operation ); #endif /* PSA_CRYPTO_DRIVER_TEST */