static double Time_F(int s);
static void print_message(const char *s,long num,int length);
-static void pkey_print_message(char *str,char *str2,long num,int bits,int sec);
+static void pkey_print_message(const char *str, const char *str2,
+ long num, int bits, int sec);
static void print_result(int alg,int run_no,int count,double time_used);
#ifdef HAVE_FORK
static int do_multi(int multi);
NID_sect409r1,
NID_sect571r1
};
- static char * test_curves_names[EC_NUM] =
+ static const char * test_curves_names[EC_NUM] =
{
/* Prime Curves */
"secp160r1",
#endif
#ifndef OPENSSL_NO_ECDSA
- unsigned char ecdsasig[256];
- unsigned int ecdsasiglen;
- EC_KEY *ecdsa[EC_NUM];
- long ecdsa_c[EC_NUM][2];
+ unsigned char ecdsasig[256];
+ unsigned int ecdsasiglen;
+ EC_KEY *ecdsa[EC_NUM];
+ long ecdsa_c[EC_NUM][2];
#endif
#ifndef OPENSSL_NO_ECDH
- EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM];
- unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE];
- int secret_size_a, secret_size_b;
- int ecdh_checks = 0;
- int secret_idx = 0;
- long ecdh_c[EC_NUM][2];
+ EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM];
+ unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE];
+ int secret_size_a, secret_size_b;
+ int ecdh_checks = 0;
+ int secret_idx = 0;
+ long ecdh_c[EC_NUM][2];
#endif
int rsa_doit[RSA_NUM];
BIO_printf(bio_err,"First we calculate the approximate speed ...\n");
count=10;
do {
- long i;
+ long it;
count*=2;
Time_F(START);
- for (i=count; i; i--)
+ for (it=count; it; it--)
DES_ecb_encrypt(buf_as_des_cblock,buf_as_des_cblock,
&sch,DES_ENCRYPT);
d=Time_F(STOP);
#ifndef OPENSSL_NO_ECDSA
ecdsa_c[R_EC_P160][0]=count/1000;
ecdsa_c[R_EC_P160][1]=count/1000/2;
- for (i=R_EC_P224; i<=R_EC_P521; i++)
+ for (i=R_EC_P192; i<=R_EC_P521; i++)
{
ecdsa_c[i][0]=ecdsa_c[i-1][0]/2;
ecdsa_c[i][1]=ecdsa_c[i-1][1]/2;
#ifndef OPENSSL_NO_ECDH
ecdh_c[R_EC_P160][0]=count/1000;
ecdh_c[R_EC_P160][1]=count/1000;
- for (i=R_EC_P224; i<=R_EC_P521; i++)
+ for (i=R_EC_P192; i<=R_EC_P521; i++)
{
ecdh_c[i][0]=ecdh_c[i-1][0]/2;
ecdh_c[i][1]=ecdh_c[i-1][1]/2;
break;
}
}
- d=Time_F(STOP);
+ d=Time_F(STOP);
- BIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\n" :
+ BIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\n" :
"%ld %d bit ECDSA signs in %.2fs \n",
count, test_curves_bits[j], d);
- ecdsa_results[j][0]=d/(double)count;
- rsa_count=count;
+ ecdsa_results[j][0]=d/(double)count;
+ rsa_count=count;
}
/* Perform ECDSA verification test */
break;
}
}
- d=Time_F(STOP);
- BIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\n"
+ d=Time_F(STOP);
+ BIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\n"
: "%ld %d bit ECDSA verify in %.2fs\n",
- count, test_curves_bits[j], d);
- ecdsa_results[j][1]=d/(double)count;
+ count, test_curves_bits[j], d);
+ ecdsa_results[j][1]=d/(double)count;
}
if (rsa_count <= 1)
#endif
}
-static void pkey_print_message(char *str, char *str2, long num, int bits,
- int tm)
+static void pkey_print_message(const char *str, const char *str2, long num,
+ int bits, int tm)
{
#ifdef SIGALRM
BIO_printf(bio_err,mr ? "+DTP:%d:%s:%s:%d\n"