X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fspeed.c;h=5ed510ced69b94ca505b41824e28f0a06a10ea6d;hb=2cf68c0b1ad860572e712893fbc4d471cf95a515;hp=1c2b4eeda297b5c97dc88452e7d92a24eb4e5e94;hpb=0cd8572b2d83fa0b9121a74dc6fa857c73ef6064;p=oweals%2Fopenssl.git diff --git a/apps/speed.c b/apps/speed.c index 1c2b4eeda2..5ed510ced6 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -58,6 +58,8 @@ /* most of this code has been pilfered from my libdes speed.c program */ +#ifndef OPENSSL_NO_SPEED + #undef SECONDS #define SECONDS 3 #define RSA_SECONDS 10 @@ -131,7 +133,7 @@ #endif #ifndef OPENSSL_NO_DES -#include +#include #endif #ifndef OPENSSL_NO_AES #include @@ -187,7 +189,8 @@ /* The following if from times(3) man page. It may need to be changed */ #ifndef HZ -# ifdef _SC_CLK_TCK +# if defined(_SC_CLK_TCK) \ + && (!defined(OPENSSL_SYS_VMS) || __CTRL_VER >= 70000000) # define HZ ((double)sysconf(_SC_CLK_TCK)) # else # ifndef CLK_TCK @@ -369,14 +372,18 @@ int MAIN(int, char **); int MAIN(int argc, char **argv) { +#ifndef OPENSSL_NO_ENGINE ENGINE *e = NULL; +#endif unsigned char *buf=NULL,*buf2=NULL; int mret=1; long count=0,save_count=0; int i,j,k; +#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA) + long rsa_count; +#endif #ifndef OPENSSL_NO_RSA unsigned rsa_num; - long rsa_count; #endif unsigned char md[EVP_MAX_MD_SIZE]; #ifndef OPENSSL_NO_MD2 @@ -437,9 +444,9 @@ int MAIN(int argc, char **argv) unsigned char iv[MAX_BLOCK_SIZE/8]; #ifndef OPENSSL_NO_DES DES_cblock *buf_as_des_cblock = NULL; - static des_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; - static des_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; - static des_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; + static DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}; + static DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12}; + static DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34}; DES_key_schedule sch; DES_key_schedule sch2; DES_key_schedule sch3; @@ -530,7 +537,7 @@ int MAIN(int argc, char **argv) goto end; } #ifndef OPENSSL_NO_DES - buf_as_des_cblock = (des_cblock *)buf; + buf_as_des_cblock = (DES_cblock *)buf; #endif if ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL) { @@ -587,6 +594,7 @@ int MAIN(int argc, char **argv) j--; /* Otherwise, -elapsed gets confused with an algorithm. */ } +#ifndef OPENSSL_NO_ENGINE else if ((argc > 0) && (strcmp(*argv,"-engine") == 0)) { argc--; @@ -603,6 +611,7 @@ int MAIN(int argc, char **argv) means all of them should be run) */ j--; } +#endif #ifdef HAVE_FORK else if ((argc > 0) && (strcmp(*argv,"-multi") == 0)) { @@ -764,6 +773,7 @@ int MAIN(int argc, char **argv) { dsa_doit[R_DSA_512]=1; dsa_doit[R_DSA_1024]=1; + dsa_doit[R_DSA_2048]=1; } else #endif @@ -859,10 +869,12 @@ int MAIN(int argc, char **argv) BIO_printf(bio_err,"\n"); BIO_printf(bio_err,"Available options:\n"); -#ifdef TIMES +#if defined(TIMES) || defined(USE_TOD) BIO_printf(bio_err,"-elapsed measure time in real time instead of CPU user time.\n"); #endif +#ifndef OPENSSL_NO_ENGINE BIO_printf(bio_err,"-engine e use engine e, possibly a hardware device.\n"); +#endif BIO_printf(bio_err,"-evp e use EVP e.\n"); BIO_printf(bio_err,"-decrypt time decryption instead of encryption (only EVP).\n"); BIO_printf(bio_err,"-mr produce machine readable output.\n"); @@ -995,6 +1007,9 @@ int MAIN(int argc, char **argv) c[D_CBC_RC5][0]=count; c[D_CBC_BF][0]=count; c[D_CBC_CAST][0]=count; + c[D_CBC_128_AES][0]=count; + c[D_CBC_192_AES][0]=count; + c[D_CBC_256_AES][0]=count; for (i=1; i