mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
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:
parent
a586099fd3
commit
d239794deb
17 changed files with 77 additions and 79 deletions
|
|
@ -506,7 +506,7 @@ void mbedtls_rsa_pkcs1_sign( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -586,7 +586,7 @@ void rsa_pkcs1_sign_raw( data_t * hash_result,
|
|||
output ) == 0 );
|
||||
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
|
||||
#if defined(MBEDTLS_PKCS1_V15)
|
||||
/* For PKCS#1 v1.5, there is an alternative way to generate signatures */
|
||||
|
|
@ -608,7 +608,7 @@ void rsa_pkcs1_sign_raw( data_t * hash_result,
|
|||
|
||||
if( res == 0 )
|
||||
{
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
}
|
||||
#endif /* MBEDTLS_PKCS1_V15 */
|
||||
|
|
@ -714,7 +714,7 @@ void mbedtls_rsa_pkcs1_encrypt( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -752,7 +752,7 @@ void rsa_pkcs1_encrypt_bad_rng( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -800,7 +800,7 @@ void mbedtls_rsa_pkcs1_decrypt( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, output_len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, output_len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -837,7 +837,7 @@ void mbedtls_rsa_public( data_t * message_str, int mod, int radix_N,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
|
||||
/* And now with the copy */
|
||||
|
|
@ -852,7 +852,7 @@ void mbedtls_rsa_public( data_t * message_str, int mod, int radix_N,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -902,7 +902,7 @@ void mbedtls_rsa_private( data_t * message_str, int mod, int radix_P,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -919,7 +919,7 @@ void mbedtls_rsa_private( data_t * message_str, int mod, int radix_P,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( hexcmp( output, result_hex_str->x, ctx2.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x, ctx2.len, result_hex_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue