mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2026-01-04 21:56:21 +01:00
tests: suites: Remove hex in name of variables of type data_t
Remove `hex` in name of variables of type data_t to reserve it for variables of type char* that are the hexadecimal representation of a data buffer. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
9fde353f68
commit
aea41df254
15 changed files with 197 additions and 252 deletions
|
|
@ -470,7 +470,7 @@ void mbedtls_rsa_pkcs1_sign( data_t * message_str, int padding_mode,
|
|||
int digest, int mod, int radix_P, char * input_P,
|
||||
int radix_Q, char * input_Q, int radix_N,
|
||||
char * input_N, int radix_E, char * input_E,
|
||||
data_t * result_hex_str, int result )
|
||||
data_t * result_str, int result )
|
||||
{
|
||||
unsigned char hash_result[MBEDTLS_MD_MAX_SIZE];
|
||||
unsigned char output[256];
|
||||
|
|
@ -506,8 +506,8 @@ void mbedtls_rsa_pkcs1_sign( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len, result_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -556,7 +556,7 @@ void rsa_pkcs1_sign_raw( data_t * hash_result,
|
|||
int padding_mode, int mod, int radix_P,
|
||||
char * input_P, int radix_Q, char * input_Q,
|
||||
int radix_N, char * input_N, int radix_E,
|
||||
char * input_E, data_t * result_hex_str )
|
||||
char * input_E, data_t * result_str )
|
||||
{
|
||||
unsigned char output[256];
|
||||
mbedtls_rsa_context ctx;
|
||||
|
|
@ -587,8 +587,8 @@ void rsa_pkcs1_sign_raw( data_t * hash_result,
|
|||
output ) == 0 );
|
||||
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len, result_str->len ) == 0 );
|
||||
|
||||
#if defined(MBEDTLS_PKCS1_V15)
|
||||
/* For PKCS#1 v1.5, there is an alternative way to generate signatures */
|
||||
|
|
@ -610,9 +610,9 @@ void rsa_pkcs1_sign_raw( data_t * hash_result,
|
|||
|
||||
if( res == 0 )
|
||||
{
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len,
|
||||
result_hex_str->len ) == 0 );
|
||||
result_str->len ) == 0 );
|
||||
}
|
||||
}
|
||||
#endif /* MBEDTLS_PKCS1_V15 */
|
||||
|
|
@ -690,7 +690,7 @@ exit:
|
|||
void mbedtls_rsa_pkcs1_encrypt( data_t * message_str, int padding_mode,
|
||||
int mod, int radix_N, char * input_N,
|
||||
int radix_E, char * input_E,
|
||||
data_t * result_hex_str, int result )
|
||||
data_t * result_str, int result )
|
||||
{
|
||||
unsigned char output[256];
|
||||
mbedtls_rsa_context ctx;
|
||||
|
|
@ -718,8 +718,8 @@ void mbedtls_rsa_pkcs1_encrypt( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len, result_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -732,7 +732,7 @@ exit:
|
|||
void rsa_pkcs1_encrypt_bad_rng( data_t * message_str, int padding_mode,
|
||||
int mod, int radix_N, char * input_N,
|
||||
int radix_E, char * input_E,
|
||||
data_t * result_hex_str, int result )
|
||||
data_t * result_str, int result )
|
||||
{
|
||||
unsigned char output[256];
|
||||
mbedtls_rsa_context ctx;
|
||||
|
|
@ -757,8 +757,8 @@ void rsa_pkcs1_encrypt_bad_rng( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len, result_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -772,7 +772,7 @@ void mbedtls_rsa_pkcs1_decrypt( data_t * message_str, int padding_mode,
|
|||
int mod, int radix_P, char * input_P,
|
||||
int radix_Q, char * input_Q, int radix_N,
|
||||
char * input_N, int radix_E, char * input_E,
|
||||
int max_output, data_t * result_hex_str,
|
||||
int max_output, data_t * result_str,
|
||||
int result )
|
||||
{
|
||||
unsigned char output[32];
|
||||
|
|
@ -806,9 +806,9 @@ void mbedtls_rsa_pkcs1_decrypt( data_t * message_str, int padding_mode,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
output_len,
|
||||
result_hex_str->len ) == 0 );
|
||||
result_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -821,7 +821,7 @@ exit:
|
|||
/* BEGIN_CASE */
|
||||
void mbedtls_rsa_public( data_t * message_str, int mod, int radix_N,
|
||||
char * input_N, int radix_E, char * input_E,
|
||||
data_t * result_hex_str, int result )
|
||||
data_t * result_str, int result )
|
||||
{
|
||||
unsigned char output[256];
|
||||
mbedtls_rsa_context ctx, ctx2; /* Also test mbedtls_rsa_copy() while at it */
|
||||
|
|
@ -845,8 +845,8 @@ void mbedtls_rsa_public( data_t * message_str, int mod, int radix_N,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len, result_str->len ) == 0 );
|
||||
}
|
||||
|
||||
/* And now with the copy */
|
||||
|
|
@ -861,8 +861,8 @@ void mbedtls_rsa_public( data_t * message_str, int mod, int radix_N,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
ctx.len, result_hex_str->len ) == 0 );
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len, result_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
@ -876,7 +876,7 @@ exit:
|
|||
void mbedtls_rsa_private( data_t * message_str, int mod, int radix_P,
|
||||
char * input_P, int radix_Q, char * input_Q,
|
||||
int radix_N, char * input_N, int radix_E,
|
||||
char * input_E, data_t * result_hex_str,
|
||||
char * input_E, data_t * result_str,
|
||||
int result )
|
||||
{
|
||||
unsigned char output[256];
|
||||
|
|
@ -912,9 +912,9 @@ void mbedtls_rsa_private( data_t * message_str, int mod, int radix_P,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx.len,
|
||||
result_hex_str->len ) == 0 );
|
||||
result_str->len ) == 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -931,9 +931,9 @@ void mbedtls_rsa_private( data_t * message_str, int mod, int radix_P,
|
|||
if( result == 0 )
|
||||
{
|
||||
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_hex_str->x,
|
||||
TEST_ASSERT( mbedtls_test_hexcmp( output, result_str->x,
|
||||
ctx2.len,
|
||||
result_hex_str->len ) == 0 );
|
||||
result_str->len ) == 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue