Remove remaining bignum radix args

Functions which are not covered by script, changes made to use radix
16.

Signed-off-by: Werner Lewis <werner.lewis@arm.com>
This commit is contained in:
Werner Lewis 2022-07-07 11:38:44 +01:00
parent 9802d36168
commit f65a327111
5 changed files with 21 additions and 21 deletions

View file

@ -1 +0,0 @@
label_1234567890=643808006803554439230129854961492699151386107534013432918073439524138264842370630061369715394739134090922937332590384720397133335969549256322620979036686633213903952966175107096769180017646161851573147596390153

1
tests/data_files/mpi_16 Normal file
View file

@ -0,0 +1 @@
label_1234567890=1f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09

View file

@ -83,7 +83,7 @@ Test mpi_write_string #10 (Negative hex with odd number of digits)
mpi_read_write_string:16:"-1":16:"":3:0:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL mpi_read_write_string:16:"-1":16:"":3:0:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
Base test mbedtls_mpi_read_binary #1 Base test mbedtls_mpi_read_binary #1
mbedtls_mpi_read_binary:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424" mbedtls_mpi_read_binary:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424"
Base test mbedtls_mpi_read_binary_le #1 Base test mbedtls_mpi_read_binary_le #1
mbedtls_mpi_read_binary_le:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"24448b952fbbef93f89286ba330e62528b151eac265cc8ce3038519d09e148af89288e91f48b41acad55d9dc5e2b18097c106be4ce132721bf6359eaf403e7ff90623e8866ee5c192320418daa682f144adedf84f25de11f49d1fe009d374109" mbedtls_mpi_read_binary_le:"0941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"24448b952fbbef93f89286ba330e62528b151eac265cc8ce3038519d09e148af89288e91f48b41acad55d9dc5e2b18097c106be4ce132721bf6359eaf403e7ff90623e8866ee5c192320418daa682f144adedf84f25de11f49d1fe009d374109"
@ -107,19 +107,19 @@ Test mbedtls_mpi_write_binary_le #2 (Buffer too small)
mbedtls_mpi_write_binary_le:"123123123123123123123123123":"23311223311223311223311223":13:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL mbedtls_mpi_write_binary_le:"123123123123123123123123123":"23311223311223311223311223":13:MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
Base test mbedtls_mpi_read_file #1 Base test mbedtls_mpi_read_file #1
mbedtls_mpi_read_file:10:"data_files/mpi_10":"01f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":0 mbedtls_mpi_read_file:"data_files/mpi_16":"01f55332c3a48b910f9942f6c914e58bef37a47ee45cb164a5b6b8d1006bf59a059c21449939ebebfdf517d2e1dbac88010d7b1f141e997bd6801ddaec9d05910f4f2de2b2c4d714e2c14a72fc7f17aa428d59c531627f09":0
Test mbedtls_mpi_read_file #1 (Empty file) Test mbedtls_mpi_read_file #1 (Empty file)
mbedtls_mpi_read_file:10:"data_files/hash_file_4":"":MBEDTLS_ERR_MPI_FILE_IO_ERROR mbedtls_mpi_read_file:"data_files/hash_file_4":"":MBEDTLS_ERR_MPI_FILE_IO_ERROR
Test mbedtls_mpi_read_file #2 (Illegal input) Test mbedtls_mpi_read_file #2 (Illegal input)
mbedtls_mpi_read_file:10:"data_files/hash_file_3":"":0 mbedtls_mpi_read_file:"data_files/hash_file_2":"":0
Test mbedtls_mpi_read_file #3 (Input too big) Test mbedtls_mpi_read_file #3 (Input too big)
mbedtls_mpi_read_file:10:"data_files/mpi_too_big":"":MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL mbedtls_mpi_read_file:"data_files/mpi_too_big":"":MBEDTLS_ERR_MPI_BUFFER_TOO_SMALL
Base test mbedtls_mpi_write_file #1 Base test mbedtls_mpi_write_file #1
mbedtls_mpi_write_file:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":16:"data_files/mpi_write" mbedtls_mpi_write_file:"941379d00fed1491fe15df284dfde4a142f68aa8d412023195cee66883e6290ffe703f4ea5963bf212713cee46b107c09182b5edcd955adac418bf4918e2889af48e1099d513830cec85c26ac1e158b52620e33ba8692f893efbb2f958b4424":"data_files/mpi_write"
Test mbedtls_mpi_lsb: 0 (null) Test mbedtls_mpi_lsb: 0 (null)
mbedtls_mpi_lsb:"":0 mbedtls_mpi_lsb:"":0

View file

@ -188,8 +188,8 @@ void mbedtls_mpi_read_binary( data_t * buf, char * input_A )
TEST_ASSERT( mbedtls_mpi_read_binary( &X, buf->x, buf->len ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_binary( &X, buf->x, buf->len ) == 0 );
TEST_ASSERT( sign_is_valid( &X ) ); TEST_ASSERT( sign_is_valid( &X ) );
TEST_ASSERT( mbedtls_mpi_write_string( &X, radix_A, str, sizeof( str ), &len ) == 0 ); TEST_ASSERT( mbedtls_mpi_write_string( &X, 16, str, sizeof( str ), &len ) == 0 );
TEST_ASSERT( strcmp( (char *) str, input_A ) == 0 ); TEST_ASSERT( strcasecmp( (char *) str, input_A ) == 0 );
exit: exit:
mbedtls_mpi_free( &X ); mbedtls_mpi_free( &X );
@ -208,8 +208,8 @@ void mbedtls_mpi_read_binary_le( data_t * buf, char * input_A )
TEST_ASSERT( mbedtls_mpi_read_binary_le( &X, buf->x, buf->len ) == 0 ); TEST_ASSERT( mbedtls_mpi_read_binary_le( &X, buf->x, buf->len ) == 0 );
TEST_ASSERT( sign_is_valid( &X ) ); TEST_ASSERT( sign_is_valid( &X ) );
TEST_ASSERT( mbedtls_mpi_write_string( &X, radix_A, str, sizeof( str ), &len ) == 0 ); TEST_ASSERT( mbedtls_mpi_write_string( &X, 16, str, sizeof( str ), &len ) == 0 );
TEST_ASSERT( strcmp( (char *) str, input_A ) == 0 ); TEST_ASSERT( strcasecmp( (char *) str, input_A ) == 0 );
exit: exit:
mbedtls_mpi_free( &X ); mbedtls_mpi_free( &X );
@ -296,7 +296,7 @@ void mbedtls_mpi_read_file( char * input_file,
file = fopen( input_file, "r" ); file = fopen( input_file, "r" );
TEST_ASSERT( file != NULL ); TEST_ASSERT( file != NULL );
ret = mbedtls_mpi_read_file( &X, radix_X, file ); ret = mbedtls_mpi_read_file( &X, 16, file );
fclose(file); fclose(file);
TEST_ASSERT( ret == result ); TEST_ASSERT( ret == result );
@ -317,7 +317,7 @@ exit:
/* END_CASE */ /* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO */ /* BEGIN_CASE depends_on:MBEDTLS_FS_IO */
void mbedtls_mpi_write_file( char * input_X, int output_radix, void mbedtls_mpi_write_file( char * input_X,
char * output_file ) char * output_file )
{ {
mbedtls_mpi X, Y; mbedtls_mpi X, Y;
@ -330,13 +330,13 @@ void mbedtls_mpi_write_file( char * input_X, int output_radix,
file_out = fopen( output_file, "w" ); file_out = fopen( output_file, "w" );
TEST_ASSERT( file_out != NULL ); TEST_ASSERT( file_out != NULL );
ret = mbedtls_mpi_write_file( NULL, &X, output_radix, file_out ); ret = mbedtls_mpi_write_file( NULL, &X, 16, file_out );
fclose(file_out); fclose(file_out);
TEST_ASSERT( ret == 0 ); TEST_ASSERT( ret == 0 );
file_in = fopen( output_file, "r" ); file_in = fopen( output_file, "r" );
TEST_ASSERT( file_in != NULL ); TEST_ASSERT( file_in != NULL );
ret = mbedtls_mpi_read_file( &Y, output_radix, file_in ); ret = mbedtls_mpi_read_file( &Y, 16, file_in );
fclose(file_in); fclose(file_in);
TEST_ASSERT( ret == 0 ); TEST_ASSERT( ret == 0 );

View file

@ -594,9 +594,9 @@ void mbedtls_rsa_check_privkey( int mod, char * input_P,
TEST_ASSERT( mbedtls_test_read_mpi( &ctx.QP, input_QP ) == 0 ); TEST_ASSERT( mbedtls_test_read_mpi( &ctx.QP, input_QP ) == 0 );
} }
#else #else
((void) radix_DP); ((void) input_DP); ((void) input_DP);
((void) radix_DQ); ((void) input_DQ); ((void) input_DQ);
((void) radix_QP); ((void) input_QP); ((void) input_QP);
#endif #endif
TEST_ASSERT( mbedtls_rsa_check_privkey( &ctx ) == result ); TEST_ASSERT( mbedtls_rsa_check_privkey( &ctx ) == result );
@ -667,9 +667,9 @@ void rsa_check_pubpriv( int mod, char * input_Npub,
TEST_ASSERT( mbedtls_test_read_mpi( &prv.QP, input_QP ) == 0 ); TEST_ASSERT( mbedtls_test_read_mpi( &prv.QP, input_QP ) == 0 );
} }
#else #else
((void) radix_DP); ((void) input_DP); ((void) input_DP);
((void) radix_DQ); ((void) input_DQ); ((void) input_DQ);
((void) radix_QP); ((void) input_QP); ((void) input_QP);
#endif #endif
TEST_ASSERT( mbedtls_rsa_check_pub_priv( &pub, &prv ) == result ); TEST_ASSERT( mbedtls_rsa_check_pub_priv( &pub, &prv ) == result );