diff --git a/tests/include/test/helpers.h b/tests/include/test/helpers.h index 134e49b7d..ad6b9d793 100644 --- a/tests/include/test/helpers.h +++ b/tests/include/test/helpers.h @@ -77,7 +77,7 @@ unsigned char *mbedtls_test_zero_alloc( size_t len ); * * For convenience, dies if allocation fails. */ -unsigned char *unhexify_alloc( const char *ibuf, size_t *olen ); +unsigned char *mbedtls_test_unhexify_alloc( const char *ibuf, size_t *olen ); int hexcmp( uint8_t * a, uint8_t * b, uint32_t a_len, uint32_t b_len ); diff --git a/tests/src/helpers.c b/tests/src/helpers.c index 063ebcd68..5f1250110 100644 --- a/tests/src/helpers.c +++ b/tests/src/helpers.c @@ -113,7 +113,7 @@ unsigned char *mbedtls_test_zero_alloc( size_t len ) return( p ); } -unsigned char *unhexify_alloc( const char *ibuf, size_t *olen ) +unsigned char *mbedtls_test_unhexify_alloc( const char *ibuf, size_t *olen ) { unsigned char *obuf; diff --git a/tests/suites/test_suite_aes.function b/tests/suites/test_suite_aes.function index 8fe0bda9b..887cee84d 100644 --- a/tests/suites/test_suite_aes.function +++ b/tests/suites/test_suite_aes.function @@ -119,14 +119,14 @@ void aes_encrypt_xts( char *hex_key_string, char *hex_data_unit_string, mbedtls_aes_xts_init( &ctx ); - data_unit = unhexify_alloc( hex_data_unit_string, &data_unit_len ); + data_unit = mbedtls_test_unhexify_alloc( hex_data_unit_string, &data_unit_len ); TEST_ASSERT( data_unit_len == AES_BLOCK_SIZE ); - key = unhexify_alloc( hex_key_string, &key_len ); + key = mbedtls_test_unhexify_alloc( hex_key_string, &key_len ); TEST_ASSERT( key_len % 2 == 0 ); - src = unhexify_alloc( hex_src_string, &src_len ); - dst = unhexify_alloc( hex_dst_string, &dst_len ); + src = mbedtls_test_unhexify_alloc( hex_src_string, &src_len ); + dst = mbedtls_test_unhexify_alloc( hex_dst_string, &dst_len ); TEST_ASSERT( src_len == dst_len ); output = mbedtls_test_zero_alloc( dst_len ); @@ -162,14 +162,14 @@ void aes_decrypt_xts( char *hex_key_string, char *hex_data_unit_string, mbedtls_aes_xts_init( &ctx ); - data_unit = unhexify_alloc( hex_data_unit_string, &data_unit_len ); + data_unit = mbedtls_test_unhexify_alloc( hex_data_unit_string, &data_unit_len ); TEST_ASSERT( data_unit_len == AES_BLOCK_SIZE ); - key = unhexify_alloc( hex_key_string, &key_len ); + key = mbedtls_test_unhexify_alloc( hex_key_string, &key_len ); TEST_ASSERT( key_len % 2 == 0 ); - src = unhexify_alloc( hex_src_string, &src_len ); - dst = unhexify_alloc( hex_dst_string, &dst_len ); + src = mbedtls_test_unhexify_alloc( hex_src_string, &src_len ); + dst = mbedtls_test_unhexify_alloc( hex_dst_string, &dst_len ); TEST_ASSERT( src_len == dst_len ); output = mbedtls_test_zero_alloc( dst_len ); diff --git a/tests/suites/test_suite_hkdf.function b/tests/suites/test_suite_hkdf.function index 9781e7f28..47e8ee63f 100644 --- a/tests/suites/test_suite_hkdf.function +++ b/tests/suites/test_suite_hkdf.function @@ -63,9 +63,9 @@ void test_hkdf_extract( int md_alg, char *hex_ikm_string, output_prk_len = mbedtls_md_get_size( md ); output_prk = mbedtls_calloc( 1, output_prk_len ); - ikm = unhexify_alloc( hex_ikm_string, &ikm_len ); - salt = unhexify_alloc( hex_salt_string, &salt_len ); - prk = unhexify_alloc( hex_prk_string, &prk_len ); + ikm = mbedtls_test_unhexify_alloc( hex_ikm_string, &ikm_len ); + salt = mbedtls_test_unhexify_alloc( hex_salt_string, &salt_len ); + prk = mbedtls_test_unhexify_alloc( hex_prk_string, &prk_len ); TEST_ASSERT( prk_len == output_prk_len ); ret = mbedtls_hkdf_extract( md, salt, salt_len, ikm, ikm_len, output_prk ); @@ -98,9 +98,9 @@ void test_hkdf_expand( int md_alg, char *hex_info_string, output_okm = mbedtls_calloc( OKM_LEN, 1 ); - prk = unhexify_alloc( hex_prk_string, &prk_len ); - info = unhexify_alloc( hex_info_string, &info_len ); - okm = unhexify_alloc( hex_okm_string, &okm_len ); + prk = mbedtls_test_unhexify_alloc( hex_prk_string, &prk_len ); + info = mbedtls_test_unhexify_alloc( hex_info_string, &info_len ); + okm = mbedtls_test_unhexify_alloc( hex_okm_string, &okm_len ); TEST_ASSERT( prk_len == mbedtls_md_get_size( md ) ); TEST_ASSERT( okm_len < OKM_LEN );