4747#define ECC_KEY_SIZE_512 512
4848#define ECC_KEY_SIZE_521 521
4949#define BYTE_SZ 8
50- #define BENCH_TIME_SEC 1
5150#define CHECK_RET (a , b , eLabel , msg ) { \
5251 if (a != b) { \
5352 printf("failed %s\n", msg); \
@@ -62,10 +61,6 @@ int do_sig_ver_test(int eccKeySz);
6261 static void hexdump (const void * buffer , word32 len , byte cols );
6362#endif
6463
65- // int ret;
66- double start_time , total_time ;
67-
68-
6964int ecc_sign_verify (void )
7065{
7166 int ret = 0 ;
@@ -121,7 +116,13 @@ int do_sig_ver_test(int eccKeySz)
121116 byte * sig = NULL ; // get rid of this magic number
122117 WC_RNG rng ;
123118 int verified = 0 ;
124- int count ; // for the benchmark
119+
120+ /* Variables for Benchmark */
121+ double start_time , total_time ;
122+ #ifndef BENCH_TIME_SEC
123+ #define BENCH_TIME_SEC 1
124+ #endif
125+ int count ;
125126
126127
127128 /*
@@ -164,7 +165,7 @@ int do_sig_ver_test(int eccKeySz)
164165 count = 0 ;
165166 start_time = current_time (1 );
166167
167- while ( BENCH_TIME_SEC > (total_time = current_time (0 ) - start_time ) ){
168+ while ( ( double ) BENCH_TIME_SEC > (total_time = current_time (0 ) - start_time ) ){
168169#endif
169170 ret = wc_ecc_init(&key);
170171 CHECK_RET (ret , 0 , sig_done , "wc_ecc_init()" );
0 commit comments