mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-03-25 11:18:43 +00:00
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>
This commit is contained in:
@@ -23,15 +23,15 @@ void mbedtls_poly1305( char *hex_key_string, char *hex_mac_string, char *hex_src
|
||||
memset( key, 0x00, sizeof( key ) );
|
||||
memset( mac, 0x00, sizeof( mac ) );
|
||||
|
||||
src_len = unhexify( src_str, hex_src_string );
|
||||
unhexify( key, hex_key_string );
|
||||
src_len = mbedtls_test_unhexify( src_str, hex_src_string );
|
||||
mbedtls_test_unhexify( key, hex_key_string );
|
||||
|
||||
/*
|
||||
* Test the integrated API
|
||||
*/
|
||||
TEST_ASSERT( mbedtls_poly1305_mac( key, src_str, src_len, mac ) == 0 );
|
||||
|
||||
hexify( mac_str, mac, 16 );
|
||||
mbedtls_test_hexify( mac_str, mac, 16 );
|
||||
TEST_ASSERT( strcmp( (char *) mac_str, hex_mac_string ) == 0 );
|
||||
|
||||
/*
|
||||
@@ -45,7 +45,7 @@ void mbedtls_poly1305( char *hex_key_string, char *hex_mac_string, char *hex_src
|
||||
|
||||
TEST_ASSERT( mbedtls_poly1305_finish( &ctx, mac ) == 0 );
|
||||
|
||||
hexify( mac_str, mac, 16 );
|
||||
mbedtls_test_hexify( mac_str, mac, 16 );
|
||||
TEST_ASSERT( strcmp( (char *) mac_str, hex_mac_string ) == 0 );
|
||||
|
||||
/*
|
||||
@@ -63,7 +63,7 @@ void mbedtls_poly1305( char *hex_key_string, char *hex_mac_string, char *hex_src
|
||||
|
||||
TEST_ASSERT( mbedtls_poly1305_finish( &ctx, mac ) == 0 );
|
||||
|
||||
hexify( mac_str, mac, 16 );
|
||||
mbedtls_test_hexify( mac_str, mac, 16 );
|
||||
TEST_ASSERT( strcmp( (char *) mac_str, hex_mac_string ) == 0 );
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ void mbedtls_poly1305( char *hex_key_string, char *hex_mac_string, char *hex_src
|
||||
|
||||
TEST_ASSERT( mbedtls_poly1305_finish( &ctx, mac ) == 0 );
|
||||
|
||||
hexify( mac_str, mac, 16 );
|
||||
mbedtls_test_hexify( mac_str, mac, 16 );
|
||||
TEST_ASSERT( strcmp( (char *) mac_str, hex_mac_string ) == 0 );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user