Remove mbedtls_ prefix from bignum test cases

Signed-off-by: Tom Cosgrove <tom.cosgrove@arm.com>
This commit is contained in:
Tom Cosgrove 2022-09-02 10:24:55 +01:00
parent b0fb17a829
commit 1b2947a614
2 changed files with 4870 additions and 4870 deletions

File diff suppressed because it is too large Load Diff

View File

@ -182,7 +182,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_read_binary( data_t * buf, char * input_A )
void mpi_read_binary( data_t * buf, char * input_A )
{
mbedtls_mpi X;
char str[1000];
@ -202,7 +202,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_core_io_null()
void mpi_core_io_null()
{
mbedtls_mpi_uint X = 0;
int ret;
@ -233,8 +233,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_core_io_be( data_t *input, int nb_int, int nx_32_int, int iret,
int oret )
void mpi_core_io_be( data_t *input, int nb_int, int nx_32_int, int iret,
int oret )
{
if( iret != 0 )
TEST_ASSERT( oret == 0 );
@ -290,8 +290,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_core_io_le( data_t *input, int nb_int, int nx_32_int, int iret,
int oret )
void mpi_core_io_le( data_t *input, int nb_int, int nx_32_int, int iret,
int oret )
{
if( iret != 0 )
TEST_ASSERT( oret == 0 );
@ -345,7 +345,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_mod_setup( int ext_rep, int int_rep, int iret )
void mpi_mod_setup( int ext_rep, int int_rep, int iret )
{
#define MLIMBS 8
mbedtls_mpi_uint mp[MLIMBS];
@ -374,8 +374,8 @@ exit:
/* BEGIN_CASE */
void mbedtls_mpi_mod_raw_io( data_t *input, int nb_int, int nx_32_int,
int iendian, int iret, int oret )
void mpi_mod_raw_io( data_t *input, int nb_int, int nx_32_int,
int iendian, int iret, int oret )
{
if( iret != 0 )
TEST_ASSERT( oret == 0 );
@ -469,7 +469,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_read_binary_le( data_t * buf, char * input_A )
void mpi_read_binary_le( data_t * buf, char * input_A )
{
mbedtls_mpi X;
char str[1000];
@ -489,8 +489,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_write_binary( char * input_X, data_t * input_A,
int output_size, int result )
void mpi_write_binary( char * input_X, data_t * input_A,
int output_size, int result )
{
mbedtls_mpi X;
unsigned char buf[1000];
@ -520,8 +520,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_write_binary_le( char * input_X, data_t * input_A,
int output_size, int result )
void mpi_write_binary_le( char * input_X, data_t * input_A,
int output_size, int result )
{
mbedtls_mpi X;
unsigned char buf[1000];
@ -551,7 +551,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO */
void mbedtls_mpi_read_file( char * input_file, data_t * input_A, int result )
void mpi_read_file( char * input_file, data_t * input_A, int result )
{
mbedtls_mpi X;
unsigned char buf[1000];
@ -586,7 +586,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO */
void mbedtls_mpi_write_file( char * input_X, char * output_file )
void mpi_write_file( char * input_X, char * output_file )
{
mbedtls_mpi X, Y;
FILE *file_out, *file_in;
@ -616,7 +616,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_get_bit( char * input_X, int pos, int val )
void mpi_get_bit( char * input_X, int pos, int val )
{
mbedtls_mpi X;
mbedtls_mpi_init( &X );
@ -629,8 +629,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_set_bit( char * input_X, int pos, int val,
char * output_Y, int result )
void mpi_set_bit( char * input_X, int pos, int val,
char * output_Y, int result )
{
mbedtls_mpi X, Y;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y );
@ -651,7 +651,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_lsb( char * input_X, int nr_bits )
void mpi_lsb( char * input_X, int nr_bits )
{
mbedtls_mpi X;
mbedtls_mpi_init( &X );
@ -665,7 +665,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_bitlen( char * input_X, int nr_bits )
void mpi_bitlen( char * input_X, int nr_bits )
{
mbedtls_mpi X;
mbedtls_mpi_init( &X );
@ -679,8 +679,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_gcd( char * input_X, char * input_Y,
char * input_A )
void mpi_gcd( char * input_X, char * input_Y,
char * input_A )
{
mbedtls_mpi A, X, Y, Z;
mbedtls_mpi_init( &A ); mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &Z );
@ -698,7 +698,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_cmp_int( int input_X, int input_A, int result_CMP )
void mpi_cmp_int( int input_X, int input_A, int result_CMP )
{
mbedtls_mpi X;
mbedtls_mpi_init( &X );
@ -712,8 +712,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_cmp_mpi( char * input_X, char * input_Y,
int input_A )
void mpi_cmp_mpi( char * input_X, char * input_Y,
int input_A )
{
mbedtls_mpi X, Y;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y );
@ -764,9 +764,9 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_lt_mpi_ct( int size_X, char * input_X,
int size_Y, char * input_Y,
int input_ret, int input_err )
void mpi_lt_mpi_ct( int size_X, char * input_X,
int size_Y, char * input_Y,
int input_ret, int input_err )
{
unsigned ret = -1;
unsigned input_uret = input_ret;
@ -789,8 +789,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_cmp_abs( char * input_X, char * input_Y,
int input_A )
void mpi_cmp_abs( char * input_X, char * input_Y,
int input_A )
{
mbedtls_mpi X, Y;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y );
@ -805,7 +805,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_copy( char *src_hex, char *dst_hex )
void mpi_copy( char *src_hex, char *dst_hex )
{
mbedtls_mpi src, dst, ref;
mbedtls_mpi_init( &src );
@ -863,7 +863,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_swap( char *X_hex, char *Y_hex )
void mpi_swap( char *X_hex, char *Y_hex )
{
mbedtls_mpi X, Y, X0, Y0;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y );
@ -928,7 +928,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_shrink( int before, int used, int min, int after )
void mpi_shrink( int before, int used, int min, int after )
{
mbedtls_mpi X;
mbedtls_mpi_init( &X );
@ -949,8 +949,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_add_mpi( char * input_X, char * input_Y,
char * input_A )
void mpi_add_mpi( char * input_X, char * input_Y,
char * input_A )
{
mbedtls_mpi X, Y, Z, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &Z ); mbedtls_mpi_init( &A );
@ -979,7 +979,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_add_mpi_inplace( char * input_X, char * input_A )
void mpi_add_mpi_inplace( char * input_X, char * input_A )
{
mbedtls_mpi X, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &A );
@ -1008,8 +1008,8 @@ exit:
/* BEGIN_CASE */
void mbedtls_mpi_add_abs( char * input_X, char * input_Y,
char * input_A )
void mpi_add_abs( char * input_X, char * input_Y,
char * input_A )
{
mbedtls_mpi X, Y, Z, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &Z ); mbedtls_mpi_init( &A );
@ -1038,8 +1038,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_add_int( char * input_X, int input_Y,
char * input_A )
void mpi_add_int( char * input_X, int input_Y,
char * input_A )
{
mbedtls_mpi X, Z, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Z ); mbedtls_mpi_init( &A );
@ -1056,8 +1056,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_sub_mpi( char * input_X, char * input_Y,
char * input_A )
void mpi_sub_mpi( char * input_X, char * input_Y,
char * input_A )
{
mbedtls_mpi X, Y, Z, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &Z ); mbedtls_mpi_init( &A );
@ -1086,8 +1086,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_sub_abs( char * input_X, char * input_Y,
char * input_A, int sub_result )
void mpi_sub_abs( char * input_X, char * input_Y,
char * input_A, int sub_result )
{
mbedtls_mpi X, Y, Z, A;
int res;
@ -1122,8 +1122,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_sub_int( char * input_X, int input_Y,
char * input_A )
void mpi_sub_int( char * input_X, int input_Y,
char * input_A )
{
mbedtls_mpi X, Z, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Z ); mbedtls_mpi_init( &A );
@ -1140,8 +1140,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_mul_mpi( char * input_X, char * input_Y,
char * input_A )
void mpi_mul_mpi( char * input_X, char * input_Y,
char * input_A )
{
mbedtls_mpi X, Y, Z, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Y ); mbedtls_mpi_init( &Z ); mbedtls_mpi_init( &A );
@ -1159,8 +1159,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_mul_int( char * input_X, int input_Y,
char * input_A, char * result_comparison )
void mpi_mul_int( char * input_X, int input_Y,
char * input_A, char * result_comparison )
{
mbedtls_mpi X, Z, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &Z ); mbedtls_mpi_init( &A );
@ -1182,9 +1182,9 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_div_mpi( char * input_X, char * input_Y,
char * input_A, char * input_B,
int div_result )
void mpi_div_mpi( char * input_X, char * input_Y,
char * input_A, char * input_B,
int div_result )
{
mbedtls_mpi X, Y, Q, R, A, B;
int res;
@ -1212,9 +1212,9 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_div_int( char * input_X, int input_Y,
char * input_A, char * input_B,
int div_result )
void mpi_div_int( char * input_X, int input_Y,
char * input_A, char * input_B,
int div_result )
{
mbedtls_mpi X, Q, R, A, B;
int res;
@ -1241,8 +1241,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_mod_mpi( char * input_X, char * input_Y,
char * input_A, int div_result )
void mpi_mod_mpi( char * input_X, char * input_Y,
char * input_A, int div_result )
{
mbedtls_mpi X, Y, A;
int res;
@ -1265,8 +1265,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_mod_int( char * input_X, int input_Y,
int input_A, int div_result )
void mpi_mod_int( char * input_X, int input_Y,
int input_A, int div_result )
{
mbedtls_mpi X;
int res;
@ -1287,9 +1287,9 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_exp_mod( char * input_A, char * input_E,
char * input_N, char * input_X,
int exp_result )
void mpi_exp_mod( char * input_A, char * input_E,
char * input_N, char * input_X,
int exp_result )
{
mbedtls_mpi A, E, N, RR, Z, X;
int res;
@ -1334,8 +1334,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_exp_mod_size( int A_bytes, int E_bytes, int N_bytes,
char * input_RR, int exp_result )
void mpi_exp_mod_size( int A_bytes, int E_bytes, int N_bytes,
char * input_RR, int exp_result )
{
mbedtls_mpi A, E, N, RR, Z;
mbedtls_mpi_init( &A ); mbedtls_mpi_init( &E ); mbedtls_mpi_init( &N );
@ -1368,8 +1368,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_inv_mod( char * input_X, char * input_Y,
char * input_A, int div_result )
void mpi_inv_mod( char * input_X, char * input_Y,
char * input_A, int div_result )
{
mbedtls_mpi X, Y, Z, A;
int res;
@ -1392,7 +1392,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_GENPRIME */
void mbedtls_mpi_is_prime( char * input_X, int div_result )
void mpi_is_prime( char * input_X, int div_result )
{
mbedtls_mpi X;
int res;
@ -1408,8 +1408,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_GENPRIME */
void mbedtls_mpi_is_prime_det( data_t * input_X, data_t * witnesses,
int chunk_len, int rounds )
void mpi_is_prime_det( data_t * input_X, data_t * witnesses,
int chunk_len, int rounds )
{
mbedtls_mpi X;
int res;
@ -1441,7 +1441,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_GENPRIME */
void mbedtls_mpi_gen_prime( int bits, int flags, int ref_ret )
void mpi_gen_prime( int bits, int flags, int ref_ret )
{
mbedtls_mpi X;
int my_ret;
@ -1479,8 +1479,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_shift_l( char * input_X, int shift_X,
char * input_A )
void mpi_shift_l( char * input_X, int shift_X,
char * input_A )
{
mbedtls_mpi X, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &A );
@ -1497,8 +1497,8 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_shift_r( char * input_X, int shift_X,
char * input_A )
void mpi_shift_r( char * input_X, int shift_X,
char * input_A )
{
mbedtls_mpi X, A;
mbedtls_mpi_init( &X ); mbedtls_mpi_init( &A );
@ -1721,9 +1721,9 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_core_add_if( char * input_l, char * input_r,
char * input_X4, int carry4,
char * input_X8, int carry8 )
void mpi_core_add_if( char * input_l, char * input_r,
char * input_X4, int carry4,
char * input_X8, int carry8 )
{
mbedtls_mpi X4, X8, l, r;
mbedtls_mpi_uint *la = NULL;
@ -1817,9 +1817,9 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_core_sub( char * input_l, char * input_r,
char * input_X4, char * input_X8,
int carry )
void mpi_core_sub( char * input_l, char * input_r,
char * input_X4, char * input_X8,
int carry )
{
mbedtls_mpi l, r, X4, X8;
mbedtls_mpi_uint *la = NULL;
@ -1907,9 +1907,9 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_core_mla( char * input_d, char * input_s, char * input_b,
char * input_X4, char * input_cy4,
char * input_X8, char * input_cy8 )
void mpi_core_mla( char * input_d, char * input_s, char * input_b,
char * input_X4, char * input_cy4,
char * input_X8, char * input_cy8 )
{
/* We are testing d += s * b; d, s are MPIs, b is a scalar.
*
@ -1996,7 +1996,7 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_montg_init( char * input_N, char * input_mm )
void mpi_montg_init( char * input_N, char * input_mm )
{
mbedtls_mpi N, mm;
@ -2031,13 +2031,13 @@ exit:
/* END_CASE */
/* BEGIN_CASE */
void mbedtls_mpi_core_montmul( int limbs_AN4, int limbs_B4,
int limbs_AN8, int limbs_B8,
char * input_A,
char * input_B,
char * input_N,
char * input_X4,
char * input_X8 )
void mpi_core_montmul( int limbs_AN4, int limbs_B4,
int limbs_AN8, int limbs_B8,
char * input_A,
char * input_B,
char * input_N,
char * input_X4,
char * input_X8 )
{
mbedtls_mpi A, B, N, X4, X8, T, R;