tests: Add mbedtls_test_ prefix to *hexify functions
Add mbedtls_test_ prefix to hexify() and unhexify()
test helper functions.
Command to change *.function files:
find . -name "*.function" -exec awk -i inplace \
'{sub(/(un|)hexify\>/,"mbedtls_test_&")}1' {} \;
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/tests/suites/test_suite_chacha20.function b/tests/suites/test_suite_chacha20.function
index 49b389c..48ac975 100644
--- a/tests/suites/test_suite_chacha20.function
+++ b/tests/suites/test_suite_chacha20.function
@@ -31,10 +31,10 @@
memset( dst_str, 0x00, sizeof( dst_str ) );
memset( output, 0x00, sizeof( output ) );
- key_len = unhexify( key_str, hex_key_string );
- nonce_len = unhexify( nonce_str, hex_nonce_string );
- src_len = unhexify( src_str, hex_src_string );
- dst_len = unhexify( dst_str, hex_dst_string );
+ key_len = mbedtls_test_unhexify( key_str, hex_key_string );
+ nonce_len = mbedtls_test_unhexify( nonce_str, hex_nonce_string );
+ src_len = mbedtls_test_unhexify( src_str, hex_src_string );
+ dst_len = mbedtls_test_unhexify( dst_str, hex_dst_string );
TEST_ASSERT( src_len == dst_len );
TEST_ASSERT( key_len == 32U );
@@ -45,7 +45,7 @@
*/
TEST_ASSERT( mbedtls_chacha20_crypt( key_str, nonce_str, counter, src_len, src_str, output ) == 0 );
- hexify( dst_str, output, src_len );
+ mbedtls_test_hexify( dst_str, output, src_len );
TEST_ASSERT( strcmp( (char*) dst_str, hex_dst_string ) == 0 );
/*
@@ -60,7 +60,7 @@
memset( output, 0x00, sizeof( output ) );
TEST_ASSERT( mbedtls_chacha20_update( &ctx, src_len, src_str, output ) == 0 );
- hexify( dst_str, output, src_len );
+ mbedtls_test_hexify( dst_str, output, src_len );
TEST_ASSERT( strcmp( (char*) dst_str, hex_dst_string ) == 0 );
/*
@@ -75,7 +75,7 @@
TEST_ASSERT( mbedtls_chacha20_update( &ctx, 1, src_str, output ) == 0 );
TEST_ASSERT( mbedtls_chacha20_update( &ctx, src_len - 1, src_str + 1, output + 1 ) == 0 );
- hexify( dst_str, output, src_len );
+ mbedtls_test_hexify( dst_str, output, src_len );
TEST_ASSERT( strcmp( (char*) dst_str, hex_dst_string ) == 0 );
mbedtls_chacha20_free( &ctx );