tests: Add mbedtls_test_ prefix to hexcmp()

Add mbedtls_test_ prefix to hexcmp() test helper
function.

Command to change *.function files:
find . -name "*.function" -exec awk -i inplace \
    '{sub(/hexcmp\>/,"mbedtls_test_&")}1' {} \;

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2020-06-10 11:03:08 +02:00
parent a586099fd3
commit d239794deb
17 changed files with 77 additions and 79 deletions

View file

@ -28,7 +28,7 @@ void des_encrypt_ecb( data_t * key_str, data_t * src_str,
mbedtls_des_setkey_enc( &ctx, key_str->x );
TEST_ASSERT( mbedtls_des_crypt_ecb( &ctx, src_str->x, output ) == 0 );
TEST_ASSERT( hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
exit:
mbedtls_des_free( &ctx );
@ -49,7 +49,7 @@ void des_decrypt_ecb( data_t * key_str, data_t * src_str,
mbedtls_des_setkey_dec( &ctx, key_str->x );
TEST_ASSERT( mbedtls_des_crypt_ecb( &ctx, src_str->x, output ) == 0 );
TEST_ASSERT( hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
exit:
mbedtls_des_free( &ctx );
@ -73,7 +73,7 @@ void des_encrypt_cbc( data_t * key_str, data_t * iv_str,
if( cbc_result == 0 )
{
TEST_ASSERT( hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
}
exit:
@ -98,7 +98,7 @@ void des_decrypt_cbc( data_t * key_str, data_t * iv_str,
if( cbc_result == 0 )
{
TEST_ASSERT( hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
}
exit:
@ -126,7 +126,7 @@ void des3_encrypt_ecb( int key_count, data_t * key_str,
TEST_ASSERT( mbedtls_des3_crypt_ecb( &ctx, src_str->x, output ) == 0 );
TEST_ASSERT( hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
exit:
mbedtls_des3_free( &ctx );
@ -153,7 +153,7 @@ void des3_decrypt_ecb( int key_count, data_t * key_str,
TEST_ASSERT( mbedtls_des3_crypt_ecb( &ctx, src_str->x, output ) == 0 );
TEST_ASSERT( hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, 8, hex_dst_string->len ) == 0 );
exit:
mbedtls_des3_free( &ctx );
@ -184,7 +184,7 @@ void des3_encrypt_cbc( int key_count, data_t * key_str,
if( cbc_result == 0 )
{
TEST_ASSERT( hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
}
exit:
@ -216,7 +216,7 @@ void des3_decrypt_cbc( int key_count, data_t * key_str,
if( cbc_result == 0 )
{
TEST_ASSERT( hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
TEST_ASSERT( mbedtls_test_hexcmp( output, hex_dst_string->x, src_str->len, hex_dst_string->len ) == 0 );
}
exit: