int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)
	{
	register u32 s0,s1,s2,s3;
	k[0] = s0 = GETU32(rawKey);
	k[1] = s1 = GETU32(rawKey+4);
	k[2] = s2 = GETU32(rawKey+8);
	k[3] = s3 = GETU32(rawKey+12);
	if (keyBitLength != 128)
		{
		k[8] = s0 = GETU32(rawKey+16);
		k[9] = s1 = GETU32(rawKey+20);
		if (keyBitLength == 192)
			{
			k[10] = s2 = ~s0;
			k[11] = s3 = ~s1;
			}
		else
			{
			k[10] = s2 = GETU32(rawKey+24);
			k[11] = s3 = GETU32(rawKey+28);
			}
		s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
		}
	Camellia_Feistel(s0,s1,s2,s3,SIGMA+0);
	Camellia_Feistel(s2,s3,s0,s1,SIGMA+2);
	s0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];
	Camellia_Feistel(s0,s1,s2,s3,SIGMA+4);
	Camellia_Feistel(s2,s3,s0,s1,SIGMA+6);
	if (keyBitLength == 128)
		{
		k[ 4] = s0, k[ 5] = s1, k[ 6] = s2, k[ 7] = s3;
		RotLeft128(s0,s1,s2,s3,15);
		k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
		RotLeft128(s0,s1,s2,s3,15);
		k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3;
		RotLeft128(s0,s1,s2,s3,15);
		k[24] = s0, k[25] = s1;
		RotLeft128(s0,s1,s2,s3,15);
		k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3;
		RotLeft128(s1,s2,s3,s0,2);
		k[40] = s1, k[41] = s2, k[42] = s3, k[43] = s0;
		RotLeft128(s1,s2,s3,s0,17);
		k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0;
		s0 = k[ 0], s1 = k[ 1], s2 = k[ 2], s3 = k[ 3];
		RotLeft128(s0,s1,s2,s3,15);
		k[ 8] = s0, k[ 9] = s1, k[10] = s2, k[11] = s3;
		RotLeft128(s0,s1,s2,s3,30);
		k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3;
		RotLeft128(s0,s1,s2,s3,15);
		k[26] = s2, k[27] = s3;
		RotLeft128(s0,s1,s2,s3,17);
		k[32] = s0, k[33] = s1, k[34] = s2, k[35] = s3;
		RotLeft128(s0,s1,s2,s3,17);
		k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;
		RotLeft128(s0,s1,s2,s3,17);
		k[44] = s0, k[45] = s1, k[46] = s2, k[47] = s3;
		return 3;
		}
	else
		{
		k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
		s0 ^= k[8], s1 ^= k[9], s2 ^=k[10], s3 ^=k[11];
		Camellia_Feistel(s0,s1,s2,s3,(SIGMA+8));
		Camellia_Feistel(s2,s3,s0,s1,(SIGMA+10));
		k[ 4] = s0, k[ 5] = s1, k[ 6] = s2, k[ 7] = s3;
		RotLeft128(s0,s1,s2,s3,30);
		k[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3;
		RotLeft128(s0,s1,s2,s3,30);
		k[40] = s0, k[41] = s1, k[42] = s2, k[43] = s3;
		RotLeft128(s1,s2,s3,s0,19);
		k[64] = s1, k[65] = s2, k[66] = s3, k[67] = s0;
		s0 = k[ 8], s1 = k[ 9], s2 = k[10], s3 = k[11];
		RotLeft128(s0,s1,s2,s3,15);
		k[ 8] = s0, k[ 9] = s1, k[10] = s2, k[11] = s3;
		RotLeft128(s0,s1,s2,s3,15);
		k[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3;
		RotLeft128(s0,s1,s2,s3,30);
		k[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;
		RotLeft128(s1,s2,s3,s0,2);
		k[52] = s1, k[53] = s2, k[54] = s3, k[55] = s0;
		s0 = k[12], s1 = k[13], s2 = k[14], s3 = k[15];
		RotLeft128(s0,s1,s2,s3,15);
		k[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;
		RotLeft128(s0,s1,s2,s3,30);
		k[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3;
		k[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0;
		RotLeft128(s1,s2,s3,s0,17);
		k[56] = s1, k[57] = s2, k[58] = s3, k[59] = s0;
		s0 = k[ 0], s1 = k[ 1], s2 = k[ 2], s3 = k[ 3];
		RotLeft128(s1,s2,s3,s0,13);
		k[24] = s1, k[25] = s2, k[26] = s3, k[27] = s0;
		RotLeft128(s1,s2,s3,s0,15);
		k[32] = s1, k[33] = s2, k[34] = s3, k[35] = s0;
		RotLeft128(s1,s2,s3,s0,17);
		k[44] = s1, k[45] = s2, k[46] = s3, k[47] = s0;
		RotLeft128(s2,s3,s0,s1,2);
		k[60] = s2, k[61] = s3, k[62] = s0, k[63] = s1;
		return 4;
		}
	}
['int MAIN(int argc, char **argv)\n\t{\n\tunsigned char *buf=NULL,*buf2=NULL;\n\tint mret=1;\n\tlong count=0,save_count=0;\n\tint i,j,k;\n#if !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_DSA)\n\tlong rsa_count;\n#endif\n#ifndef OPENSSL_NO_RSA\n\tunsigned rsa_num;\n#endif\n\tunsigned char md[EVP_MAX_MD_SIZE];\n#ifndef OPENSSL_NO_MD2\n\tunsigned char md2[MD2_DIGEST_LENGTH];\n#endif\n#ifndef OPENSSL_NO_MDC2\n\tunsigned char mdc2[MDC2_DIGEST_LENGTH];\n#endif\n#ifndef OPENSSL_NO_MD4\n\tunsigned char md4[MD4_DIGEST_LENGTH];\n#endif\n#ifndef OPENSSL_NO_MD5\n\tunsigned char md5[MD5_DIGEST_LENGTH];\n\tunsigned char hmac[MD5_DIGEST_LENGTH];\n#endif\n#ifndef OPENSSL_NO_SHA\n\tunsigned char sha[SHA_DIGEST_LENGTH];\n#ifndef OPENSSL_NO_SHA256\n\tunsigned char sha256[SHA256_DIGEST_LENGTH];\n#endif\n#ifndef OPENSSL_NO_SHA512\n\tunsigned char sha512[SHA512_DIGEST_LENGTH];\n#endif\n#endif\n#ifndef OPENSSL_NO_WHIRLPOOL\n\tunsigned char whirlpool[WHIRLPOOL_DIGEST_LENGTH];\n#endif\n#ifndef OPENSSL_NO_RIPEMD\n\tunsigned char rmd160[RIPEMD160_DIGEST_LENGTH];\n#endif\n#ifndef OPENSSL_NO_RC4\n\tRC4_KEY rc4_ks;\n#endif\n#ifndef OPENSSL_NO_RC5\n\tRC5_32_KEY rc5_ks;\n#endif\n#ifndef OPENSSL_NO_RC2\n\tRC2_KEY rc2_ks;\n#endif\n#ifndef OPENSSL_NO_IDEA\n\tIDEA_KEY_SCHEDULE idea_ks;\n#endif\n#ifndef OPENSSL_NO_SEED\n\tSEED_KEY_SCHEDULE seed_ks;\n#endif\n#ifndef OPENSSL_NO_BF\n\tBF_KEY bf_ks;\n#endif\n#ifndef OPENSSL_NO_CAST\n\tCAST_KEY cast_ks;\n#endif\n\tstatic const unsigned char key16[16]=\n\t\t{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,\n\t\t 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};\n#ifndef OPENSSL_NO_AES\n\tstatic const unsigned char key24[24]=\n\t\t{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,\n\t\t 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,\n\t\t 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};\n\tstatic const unsigned char key32[32]=\n\t\t{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,\n\t\t 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,\n\t\t 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,\n\t\t 0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56};\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\tstatic const unsigned char ckey24[24]=\n\t\t{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,\n\t\t 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,\n\t\t 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};\n\tstatic const unsigned char ckey32[32]=\n\t\t{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,\n\t\t 0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,\n\t\t 0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,\n\t\t 0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34,0x56};\n#endif\n#ifndef OPENSSL_NO_AES\n#define MAX_BLOCK_SIZE 128\n#else\n#define MAX_BLOCK_SIZE 64\n#endif\n\tunsigned char DES_iv[8];\n\tunsigned char iv[2*MAX_BLOCK_SIZE/8];\n#ifndef OPENSSL_NO_DES\n\tstatic DES_cblock key ={0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0};\n\tstatic DES_cblock key2={0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12};\n\tstatic DES_cblock key3={0x56,0x78,0x9a,0xbc,0xde,0xf0,0x12,0x34};\n\tDES_key_schedule sch;\n\tDES_key_schedule sch2;\n\tDES_key_schedule sch3;\n#endif\n#ifndef OPENSSL_NO_AES\n\tAES_KEY aes_ks1, aes_ks2, aes_ks3;\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\tCAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3;\n#endif\n#define\tD_MD2\t\t0\n#define\tD_MDC2\t\t1\n#define\tD_MD4\t\t2\n#define\tD_MD5\t\t3\n#define\tD_HMAC\t\t4\n#define\tD_SHA1\t\t5\n#define D_RMD160\t6\n#define\tD_RC4\t\t7\n#define\tD_CBC_DES\t8\n#define\tD_EDE3_DES\t9\n#define\tD_CBC_IDEA\t10\n#define\tD_CBC_SEED\t11\n#define\tD_CBC_RC2\t12\n#define\tD_CBC_RC5\t13\n#define\tD_CBC_BF\t14\n#define\tD_CBC_CAST\t15\n#define D_CBC_128_AES\t16\n#define D_CBC_192_AES\t17\n#define D_CBC_256_AES\t18\n#define D_CBC_128_CML   19\n#define D_CBC_192_CML   20\n#define D_CBC_256_CML   21\n#define D_EVP\t\t22\n#define D_SHA256\t23\n#define D_SHA512\t24\n#define D_WHIRLPOOL\t25\n#define D_IGE_128_AES   26\n#define D_IGE_192_AES   27\n#define D_IGE_256_AES   28\n#define D_GHASH\t\t29\n\tdouble d=0.0;\n\tlong c[ALGOR_NUM][SIZE_NUM];\n#define\tR_DSA_512\t0\n#define\tR_DSA_1024\t1\n#define\tR_DSA_2048\t2\n#define\tR_RSA_512\t0\n#define\tR_RSA_1024\t1\n#define\tR_RSA_2048\t2\n#define\tR_RSA_4096\t3\n#define R_EC_P160    0\n#define R_EC_P192    1\n#define R_EC_P224    2\n#define R_EC_P256    3\n#define R_EC_P384    4\n#define R_EC_P521    5\n#define R_EC_K163    6\n#define R_EC_K233    7\n#define R_EC_K283    8\n#define R_EC_K409    9\n#define R_EC_K571    10\n#define R_EC_B163    11\n#define R_EC_B233    12\n#define R_EC_B283    13\n#define R_EC_B409    14\n#define R_EC_B571    15\n#ifndef OPENSSL_NO_RSA\n\tRSA *rsa_key[RSA_NUM];\n\tlong rsa_c[RSA_NUM][2];\n\tstatic unsigned int rsa_bits[RSA_NUM]={512,1024,2048,4096};\n\tstatic unsigned char *rsa_data[RSA_NUM]=\n\t\t{test512,test1024,test2048,test4096};\n\tstatic int rsa_data_length[RSA_NUM]={\n\t\tsizeof(test512),sizeof(test1024),\n\t\tsizeof(test2048),sizeof(test4096)};\n#endif\n#ifndef OPENSSL_NO_DSA\n\tDSA *dsa_key[DSA_NUM];\n\tlong dsa_c[DSA_NUM][2];\n\tstatic unsigned int dsa_bits[DSA_NUM]={512,1024,2048};\n#endif\n#ifndef OPENSSL_NO_EC\n\tstatic unsigned int test_curves[EC_NUM] =\n\t{\n\tNID_secp160r1,\n\tNID_X9_62_prime192v1,\n\tNID_secp224r1,\n\tNID_X9_62_prime256v1,\n\tNID_secp384r1,\n\tNID_secp521r1,\n\tNID_sect163k1,\n\tNID_sect233k1,\n\tNID_sect283k1,\n\tNID_sect409k1,\n\tNID_sect571k1,\n\tNID_sect163r2,\n\tNID_sect233r1,\n\tNID_sect283r1,\n\tNID_sect409r1,\n\tNID_sect571r1\n\t};\n\tstatic const char * test_curves_names[EC_NUM] =\n\t{\n\t"secp160r1",\n\t"nistp192",\n\t"nistp224",\n\t"nistp256",\n\t"nistp384",\n\t"nistp521",\n\t"nistk163",\n\t"nistk233",\n\t"nistk283",\n\t"nistk409",\n\t"nistk571",\n\t"nistb163",\n\t"nistb233",\n\t"nistb283",\n\t"nistb409",\n\t"nistb571"\n\t};\n\tstatic int test_curves_bits[EC_NUM] =\n        {\n        160, 192, 224, 256, 384, 521,\n        163, 233, 283, 409, 571,\n        163, 233, 283, 409, 571\n        };\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\tunsigned char ecdsasig[256];\n\tunsigned int ecdsasiglen;\n\tEC_KEY *ecdsa[EC_NUM];\n\tlong ecdsa_c[EC_NUM][2];\n#endif\n#ifndef OPENSSL_NO_ECDH\n\tEC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM];\n\tunsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE];\n\tint secret_size_a, secret_size_b;\n\tint ecdh_checks = 0;\n\tint secret_idx = 0;\n\tlong ecdh_c[EC_NUM][2];\n#endif\n\tint rsa_doit[RSA_NUM];\n\tint dsa_doit[DSA_NUM];\n#ifndef OPENSSL_NO_ECDSA\n\tint ecdsa_doit[EC_NUM];\n#endif\n#ifndef OPENSSL_NO_ECDH\n        int ecdh_doit[EC_NUM];\n#endif\n\tint doit[ALGOR_NUM];\n\tint pr_header=0;\n\tconst EVP_CIPHER *evp_cipher=NULL;\n\tconst EVP_MD *evp_md=NULL;\n\tint decrypt=0;\n#ifndef NO_FORK\n\tint multi=0;\n#endif\n#ifndef TIMES\n\tusertime=-1;\n#endif\n\tapps_startup();\n\tmemset(results, 0, sizeof(results));\n#ifndef OPENSSL_NO_DSA\n\tmemset(dsa_key,0,sizeof(dsa_key));\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\tfor (i=0; i<EC_NUM; i++) ecdsa[i] = NULL;\n#endif\n#ifndef OPENSSL_NO_ECDH\n\tfor (i=0; i<EC_NUM; i++)\n\t\t{\n\t\tecdh_a[i] = NULL;\n\t\tecdh_b[i] = NULL;\n\t\t}\n#endif\n\tif (bio_err == NULL)\n\t\tif ((bio_err=BIO_new(BIO_s_file())) != NULL)\n\t\t\tBIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT);\n\tif (!load_config(bio_err, NULL))\n\t\tgoto end;\n#ifndef OPENSSL_NO_RSA\n\tmemset(rsa_key,0,sizeof(rsa_key));\n\tfor (i=0; i<RSA_NUM; i++)\n\t\trsa_key[i]=NULL;\n#endif\n\tif ((buf=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)\n\t\t{\n\t\tBIO_printf(bio_err,"out of memory\\n");\n\t\tgoto end;\n\t\t}\n\tif ((buf2=(unsigned char *)OPENSSL_malloc((int)BUFSIZE)) == NULL)\n\t\t{\n\t\tBIO_printf(bio_err,"out of memory\\n");\n\t\tgoto end;\n\t\t}\n\tmemset(c,0,sizeof(c));\n\tmemset(DES_iv,0,sizeof(DES_iv));\n\tmemset(iv,0,sizeof(iv));\n\tfor (i=0; i<ALGOR_NUM; i++)\n\t\tdoit[i]=0;\n\tfor (i=0; i<RSA_NUM; i++)\n\t\trsa_doit[i]=0;\n\tfor (i=0; i<DSA_NUM; i++)\n\t\tdsa_doit[i]=0;\n#ifndef OPENSSL_NO_ECDSA\n\tfor (i=0; i<EC_NUM; i++)\n\t\tecdsa_doit[i]=0;\n#endif\n#ifndef OPENSSL_NO_ECDH\n\tfor (i=0; i<EC_NUM; i++)\n\t\tecdh_doit[i]=0;\n#endif\n\tj=0;\n\targc--;\n\targv++;\n\twhile (argc)\n\t\t{\n\t\tif\t((argc > 0) && (strcmp(*argv,"-elapsed") == 0))\n\t\t\t{\n\t\t\tusertime = 0;\n\t\t\tj--;\n\t\t\t}\n\t\telse if\t((argc > 0) && (strcmp(*argv,"-evp") == 0))\n\t\t\t{\n\t\t\targc--;\n\t\t\targv++;\n\t\t\tif(argc == 0)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"no EVP given\\n");\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\tevp_cipher=EVP_get_cipherbyname(*argv);\n\t\t\tif(!evp_cipher)\n\t\t\t\t{\n\t\t\t\tevp_md=EVP_get_digestbyname(*argv);\n\t\t\t\t}\n\t\t\tif(!evp_cipher && !evp_md)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"%s is an unknown cipher or digest\\n",*argv);\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\tdoit[D_EVP]=1;\n\t\t\t}\n\t\telse if (argc > 0 && !strcmp(*argv,"-decrypt"))\n\t\t\t{\n\t\t\tdecrypt=1;\n\t\t\tj--;\n\t\t\t}\n#ifndef OPENSSL_NO_ENGINE\n\t\telse if\t((argc > 0) && (strcmp(*argv,"-engine") == 0))\n\t\t\t{\n\t\t\targc--;\n\t\t\targv++;\n\t\t\tif(argc == 0)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"no engine given\\n");\n\t\t\t\tgoto end;\n\t\t\t\t}\n                        setup_engine(bio_err, *argv, 0);\n\t\t\tj--;\n\t\t\t}\n#endif\n#ifndef NO_FORK\n\t\telse if\t((argc > 0) && (strcmp(*argv,"-multi") == 0))\n\t\t\t{\n\t\t\targc--;\n\t\t\targv++;\n\t\t\tif(argc == 0)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"no multi count given\\n");\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\tmulti=atoi(argv[0]);\n\t\t\tif(multi <= 0)\n\t\t\t    {\n\t\t\t\tBIO_printf(bio_err,"bad multi count\\n");\n\t\t\t\tgoto end;\n\t\t\t\t}\n\t\t\tj--;\n\t\t\t}\n#endif\n\t\telse if (argc > 0 && !strcmp(*argv,"-mr"))\n\t\t\t{\n\t\t\tmr=1;\n\t\t\tj--;\n\t\t\t}\n\t\telse\n#ifndef OPENSSL_NO_MD2\n\t\tif\t(strcmp(*argv,"md2") == 0) doit[D_MD2]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_MDC2\n\t\t\tif (strcmp(*argv,"mdc2") == 0) doit[D_MDC2]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_MD4\n\t\t\tif (strcmp(*argv,"md4") == 0) doit[D_MD4]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_MD5\n\t\t\tif (strcmp(*argv,"md5") == 0) doit[D_MD5]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_MD5\n\t\t\tif (strcmp(*argv,"hmac") == 0) doit[D_HMAC]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_SHA\n\t\t\tif (strcmp(*argv,"sha1") == 0) doit[D_SHA1]=1;\n\t\telse\n\t\t\tif (strcmp(*argv,"sha") == 0)\tdoit[D_SHA1]=1,\n\t\t\t\t\t\t\tdoit[D_SHA256]=1,\n\t\t\t\t\t\t\tdoit[D_SHA512]=1;\n\t\telse\n#ifndef OPENSSL_NO_SHA256\n\t\t\tif (strcmp(*argv,"sha256") == 0) doit[D_SHA256]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_SHA512\n\t\t\tif (strcmp(*argv,"sha512") == 0) doit[D_SHA512]=1;\n\t\telse\n#endif\n#endif\n#ifndef OPENSSL_NO_WHIRLPOOL\n\t\t\tif (strcmp(*argv,"whirlpool") == 0) doit[D_WHIRLPOOL]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_RIPEMD\n\t\t\tif (strcmp(*argv,"ripemd") == 0) doit[D_RMD160]=1;\n\t\telse\n\t\t\tif (strcmp(*argv,"rmd160") == 0) doit[D_RMD160]=1;\n\t\telse\n\t\t\tif (strcmp(*argv,"ripemd160") == 0) doit[D_RMD160]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_RC4\n\t\t\tif (strcmp(*argv,"rc4") == 0) doit[D_RC4]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_DES\n\t\t\tif (strcmp(*argv,"des-cbc") == 0) doit[D_CBC_DES]=1;\n\t\telse\tif (strcmp(*argv,"des-ede3") == 0) doit[D_EDE3_DES]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_AES\n\t\t\tif (strcmp(*argv,"aes-128-cbc") == 0) doit[D_CBC_128_AES]=1;\n\t\telse\tif (strcmp(*argv,"aes-192-cbc") == 0) doit[D_CBC_192_AES]=1;\n\t\telse\tif (strcmp(*argv,"aes-256-cbc") == 0) doit[D_CBC_256_AES]=1;\n\t\telse    if (strcmp(*argv,"aes-128-ige") == 0) doit[D_IGE_128_AES]=1;\n\t\telse\tif (strcmp(*argv,"aes-192-ige") == 0) doit[D_IGE_192_AES]=1;\n\t\telse\tif (strcmp(*argv,"aes-256-ige") == 0) doit[D_IGE_256_AES]=1;\n                else\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\t\t\tif (strcmp(*argv,"camellia-128-cbc") == 0) doit[D_CBC_128_CML]=1;\n\t\telse    if (strcmp(*argv,"camellia-192-cbc") == 0) doit[D_CBC_192_CML]=1;\n\t\telse    if (strcmp(*argv,"camellia-256-cbc") == 0) doit[D_CBC_256_CML]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_RSA\n#if 0\n\t\t\tif (strcmp(*argv,"rsaref") == 0)\n\t\t\t{\n\t\t\tRSA_set_default_openssl_method(RSA_PKCS1_RSAref());\n\t\t\tj--;\n\t\t\t}\n\t\telse\n#endif\n#ifndef RSA_NULL\n\t\t\tif (strcmp(*argv,"openssl") == 0)\n\t\t\t{\n\t\t\tRSA_set_default_method(RSA_PKCS1_SSLeay());\n\t\t\tj--;\n\t\t\t}\n\t\telse\n#endif\n#endif\n\t\t     if (strcmp(*argv,"dsa512") == 0) dsa_doit[R_DSA_512]=2;\n\t\telse if (strcmp(*argv,"dsa1024") == 0) dsa_doit[R_DSA_1024]=2;\n\t\telse if (strcmp(*argv,"dsa2048") == 0) dsa_doit[R_DSA_2048]=2;\n\t\telse if (strcmp(*argv,"rsa512") == 0) rsa_doit[R_RSA_512]=2;\n\t\telse if (strcmp(*argv,"rsa1024") == 0) rsa_doit[R_RSA_1024]=2;\n\t\telse if (strcmp(*argv,"rsa2048") == 0) rsa_doit[R_RSA_2048]=2;\n\t\telse if (strcmp(*argv,"rsa4096") == 0) rsa_doit[R_RSA_4096]=2;\n\t\telse\n#ifndef OPENSSL_NO_RC2\n\t\t     if (strcmp(*argv,"rc2-cbc") == 0) doit[D_CBC_RC2]=1;\n\t\telse if (strcmp(*argv,"rc2") == 0) doit[D_CBC_RC2]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_RC5\n\t\t     if (strcmp(*argv,"rc5-cbc") == 0) doit[D_CBC_RC5]=1;\n\t\telse if (strcmp(*argv,"rc5") == 0) doit[D_CBC_RC5]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_IDEA\n\t\t     if (strcmp(*argv,"idea-cbc") == 0) doit[D_CBC_IDEA]=1;\n\t\telse if (strcmp(*argv,"idea") == 0) doit[D_CBC_IDEA]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_SEED\n\t\t     if (strcmp(*argv,"seed-cbc") == 0) doit[D_CBC_SEED]=1;\n\t\telse if (strcmp(*argv,"seed") == 0) doit[D_CBC_SEED]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_BF\n\t\t     if (strcmp(*argv,"bf-cbc") == 0) doit[D_CBC_BF]=1;\n\t\telse if (strcmp(*argv,"blowfish") == 0) doit[D_CBC_BF]=1;\n\t\telse if (strcmp(*argv,"bf") == 0) doit[D_CBC_BF]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_CAST\n\t\t     if (strcmp(*argv,"cast-cbc") == 0) doit[D_CBC_CAST]=1;\n\t\telse if (strcmp(*argv,"cast") == 0) doit[D_CBC_CAST]=1;\n\t\telse if (strcmp(*argv,"cast5") == 0) doit[D_CBC_CAST]=1;\n\t\telse\n#endif\n#ifndef OPENSSL_NO_DES\n\t\t\tif (strcmp(*argv,"des") == 0)\n\t\t\t{\n\t\t\tdoit[D_CBC_DES]=1;\n\t\t\tdoit[D_EDE3_DES]=1;\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_AES\n\t\t\tif (strcmp(*argv,"aes") == 0)\n\t\t\t{\n\t\t\tdoit[D_CBC_128_AES]=1;\n\t\t\tdoit[D_CBC_192_AES]=1;\n\t\t\tdoit[D_CBC_256_AES]=1;\n\t\t\t}\n\t\telse if (strcmp(*argv,"ghash") == 0)\n\t\t\t{\n\t\t\tdoit[D_GHASH]=1;\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\t\t\tif (strcmp(*argv,"camellia") == 0)\n\t\t\t{\n\t\t\tdoit[D_CBC_128_CML]=1;\n\t\t\tdoit[D_CBC_192_CML]=1;\n\t\t\tdoit[D_CBC_256_CML]=1;\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_RSA\n\t\t\tif (strcmp(*argv,"rsa") == 0)\n\t\t\t{\n\t\t\trsa_doit[R_RSA_512]=1;\n\t\t\trsa_doit[R_RSA_1024]=1;\n\t\t\trsa_doit[R_RSA_2048]=1;\n\t\t\trsa_doit[R_RSA_4096]=1;\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_DSA\n\t\t\tif (strcmp(*argv,"dsa") == 0)\n\t\t\t{\n\t\t\tdsa_doit[R_DSA_512]=1;\n\t\t\tdsa_doit[R_DSA_1024]=1;\n\t\t\tdsa_doit[R_DSA_2048]=1;\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\t\t     if (strcmp(*argv,"ecdsap160") == 0) ecdsa_doit[R_EC_P160]=2;\n\t\telse if (strcmp(*argv,"ecdsap192") == 0) ecdsa_doit[R_EC_P192]=2;\n\t\telse if (strcmp(*argv,"ecdsap224") == 0) ecdsa_doit[R_EC_P224]=2;\n\t\telse if (strcmp(*argv,"ecdsap256") == 0) ecdsa_doit[R_EC_P256]=2;\n\t\telse if (strcmp(*argv,"ecdsap384") == 0) ecdsa_doit[R_EC_P384]=2;\n\t\telse if (strcmp(*argv,"ecdsap521") == 0) ecdsa_doit[R_EC_P521]=2;\n\t\telse if (strcmp(*argv,"ecdsak163") == 0) ecdsa_doit[R_EC_K163]=2;\n\t\telse if (strcmp(*argv,"ecdsak233") == 0) ecdsa_doit[R_EC_K233]=2;\n\t\telse if (strcmp(*argv,"ecdsak283") == 0) ecdsa_doit[R_EC_K283]=2;\n\t\telse if (strcmp(*argv,"ecdsak409") == 0) ecdsa_doit[R_EC_K409]=2;\n\t\telse if (strcmp(*argv,"ecdsak571") == 0) ecdsa_doit[R_EC_K571]=2;\n\t\telse if (strcmp(*argv,"ecdsab163") == 0) ecdsa_doit[R_EC_B163]=2;\n\t\telse if (strcmp(*argv,"ecdsab233") == 0) ecdsa_doit[R_EC_B233]=2;\n\t\telse if (strcmp(*argv,"ecdsab283") == 0) ecdsa_doit[R_EC_B283]=2;\n\t\telse if (strcmp(*argv,"ecdsab409") == 0) ecdsa_doit[R_EC_B409]=2;\n\t\telse if (strcmp(*argv,"ecdsab571") == 0) ecdsa_doit[R_EC_B571]=2;\n\t\telse if (strcmp(*argv,"ecdsa") == 0)\n\t\t\t{\n\t\t\tfor (i=0; i < EC_NUM; i++)\n\t\t\t\tecdsa_doit[i]=1;\n\t\t\t}\n\t\telse\n#endif\n#ifndef OPENSSL_NO_ECDH\n\t\t     if (strcmp(*argv,"ecdhp160") == 0) ecdh_doit[R_EC_P160]=2;\n\t\telse if (strcmp(*argv,"ecdhp192") == 0) ecdh_doit[R_EC_P192]=2;\n\t\telse if (strcmp(*argv,"ecdhp224") == 0) ecdh_doit[R_EC_P224]=2;\n\t\telse if (strcmp(*argv,"ecdhp256") == 0) ecdh_doit[R_EC_P256]=2;\n\t\telse if (strcmp(*argv,"ecdhp384") == 0) ecdh_doit[R_EC_P384]=2;\n\t\telse if (strcmp(*argv,"ecdhp521") == 0) ecdh_doit[R_EC_P521]=2;\n\t\telse if (strcmp(*argv,"ecdhk163") == 0) ecdh_doit[R_EC_K163]=2;\n\t\telse if (strcmp(*argv,"ecdhk233") == 0) ecdh_doit[R_EC_K233]=2;\n\t\telse if (strcmp(*argv,"ecdhk283") == 0) ecdh_doit[R_EC_K283]=2;\n\t\telse if (strcmp(*argv,"ecdhk409") == 0) ecdh_doit[R_EC_K409]=2;\n\t\telse if (strcmp(*argv,"ecdhk571") == 0) ecdh_doit[R_EC_K571]=2;\n\t\telse if (strcmp(*argv,"ecdhb163") == 0) ecdh_doit[R_EC_B163]=2;\n\t\telse if (strcmp(*argv,"ecdhb233") == 0) ecdh_doit[R_EC_B233]=2;\n\t\telse if (strcmp(*argv,"ecdhb283") == 0) ecdh_doit[R_EC_B283]=2;\n\t\telse if (strcmp(*argv,"ecdhb409") == 0) ecdh_doit[R_EC_B409]=2;\n\t\telse if (strcmp(*argv,"ecdhb571") == 0) ecdh_doit[R_EC_B571]=2;\n\t\telse if (strcmp(*argv,"ecdh") == 0)\n\t\t\t{\n\t\t\tfor (i=0; i < EC_NUM; i++)\n\t\t\t\tecdh_doit[i]=1;\n\t\t\t}\n\t\telse\n#endif\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"Error: bad option or value\\n");\n\t\t\tBIO_printf(bio_err,"\\n");\n\t\t\tBIO_printf(bio_err,"Available values:\\n");\n#ifndef OPENSSL_NO_MD2\n\t\t\tBIO_printf(bio_err,"md2      ");\n#endif\n#ifndef OPENSSL_NO_MDC2\n\t\t\tBIO_printf(bio_err,"mdc2     ");\n#endif\n#ifndef OPENSSL_NO_MD4\n\t\t\tBIO_printf(bio_err,"md4      ");\n#endif\n#ifndef OPENSSL_NO_MD5\n\t\t\tBIO_printf(bio_err,"md5      ");\n#ifndef OPENSSL_NO_HMAC\n\t\t\tBIO_printf(bio_err,"hmac     ");\n#endif\n#endif\n#ifndef OPENSSL_NO_SHA1\n\t\t\tBIO_printf(bio_err,"sha1     ");\n#endif\n#ifndef OPENSSL_NO_SHA256\n\t\t\tBIO_printf(bio_err,"sha256   ");\n#endif\n#ifndef OPENSSL_NO_SHA512\n\t\t\tBIO_printf(bio_err,"sha512   ");\n#endif\n#ifndef OPENSSL_NO_WHIRLPOOL\n\t\t\tBIO_printf(bio_err,"whirlpool");\n#endif\n#ifndef OPENSSL_NO_RIPEMD160\n\t\t\tBIO_printf(bio_err,"rmd160");\n#endif\n#if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \\\n    !defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \\\n    !defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) || \\\n    !defined(OPENSSL_NO_WHIRLPOOL)\n\t\t\tBIO_printf(bio_err,"\\n");\n#endif\n#ifndef OPENSSL_NO_IDEA\n\t\t\tBIO_printf(bio_err,"idea-cbc ");\n#endif\n#ifndef OPENSSL_NO_SEED\n\t\t\tBIO_printf(bio_err,"seed-cbc ");\n#endif\n#ifndef OPENSSL_NO_RC2\n\t\t\tBIO_printf(bio_err,"rc2-cbc  ");\n#endif\n#ifndef OPENSSL_NO_RC5\n\t\t\tBIO_printf(bio_err,"rc5-cbc  ");\n#endif\n#ifndef OPENSSL_NO_BF\n\t\t\tBIO_printf(bio_err,"bf-cbc");\n#endif\n#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || !defined(OPENSSL_NO_RC2) || \\\n    !defined(OPENSSL_NO_BF) || !defined(OPENSSL_NO_RC5)\n\t\t\tBIO_printf(bio_err,"\\n");\n#endif\n#ifndef OPENSSL_NO_DES\n\t\t\tBIO_printf(bio_err,"des-cbc  des-ede3 ");\n#endif\n#ifndef OPENSSL_NO_AES\n\t\t\tBIO_printf(bio_err,"aes-128-cbc aes-192-cbc aes-256-cbc ");\n\t\t\tBIO_printf(bio_err,"aes-128-ige aes-192-ige aes-256-ige ");\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\t\t\tBIO_printf(bio_err,"\\n");\n\t\t\tBIO_printf(bio_err,"camellia-128-cbc camellia-192-cbc camellia-256-cbc ");\n#endif\n#ifndef OPENSSL_NO_RC4\n\t\t\tBIO_printf(bio_err,"rc4");\n#endif\n\t\t\tBIO_printf(bio_err,"\\n");\n#ifndef OPENSSL_NO_RSA\n\t\t\tBIO_printf(bio_err,"rsa512   rsa1024  rsa2048  rsa4096\\n");\n#endif\n#ifndef OPENSSL_NO_DSA\n\t\t\tBIO_printf(bio_err,"dsa512   dsa1024  dsa2048\\n");\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\t\t\tBIO_printf(bio_err,"ecdsap160 ecdsap192 ecdsap224 ecdsap256 ecdsap384 ecdsap521\\n");\n\t\t\tBIO_printf(bio_err,"ecdsak163 ecdsak233 ecdsak283 ecdsak409 ecdsak571\\n");\n\t\t\tBIO_printf(bio_err,"ecdsab163 ecdsab233 ecdsab283 ecdsab409 ecdsab571\\n");\n\t\t\tBIO_printf(bio_err,"ecdsa\\n");\n#endif\n#ifndef OPENSSL_NO_ECDH\n\t\t\tBIO_printf(bio_err,"ecdhp160  ecdhp192  ecdhp224  ecdhp256  ecdhp384  ecdhp521\\n");\n\t\t\tBIO_printf(bio_err,"ecdhk163  ecdhk233  ecdhk283  ecdhk409  ecdhk571\\n");\n\t\t\tBIO_printf(bio_err,"ecdhb163  ecdhb233  ecdhb283  ecdhb409  ecdhb571\\n");\n\t\t\tBIO_printf(bio_err,"ecdh\\n");\n#endif\n#ifndef OPENSSL_NO_IDEA\n\t\t\tBIO_printf(bio_err,"idea     ");\n#endif\n#ifndef OPENSSL_NO_SEED\n\t\t\tBIO_printf(bio_err,"seed     ");\n#endif\n#ifndef OPENSSL_NO_RC2\n\t\t\tBIO_printf(bio_err,"rc2      ");\n#endif\n#ifndef OPENSSL_NO_DES\n\t\t\tBIO_printf(bio_err,"des      ");\n#endif\n#ifndef OPENSSL_NO_AES\n\t\t\tBIO_printf(bio_err,"aes      ");\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\t\t\tBIO_printf(bio_err,"camellia ");\n#endif\n#ifndef OPENSSL_NO_RSA\n\t\t\tBIO_printf(bio_err,"rsa      ");\n#endif\n#ifndef OPENSSL_NO_BF\n\t\t\tBIO_printf(bio_err,"blowfish");\n#endif\n#if !defined(OPENSSL_NO_IDEA) || !defined(OPENSSL_NO_SEED) || \\\n    !defined(OPENSSL_NO_RC2) || !defined(OPENSSL_NO_DES) || \\\n    !defined(OPENSSL_NO_RSA) || !defined(OPENSSL_NO_BF) || \\\n    !defined(OPENSSL_NO_AES) || !defined(OPENSSL_NO_CAMELLIA)\n\t\t\tBIO_printf(bio_err,"\\n");\n#endif\n\t\t\tBIO_printf(bio_err,"\\n");\n\t\t\tBIO_printf(bio_err,"Available options:\\n");\n#if defined(TIMES) || defined(USE_TOD)\n\t\t\tBIO_printf(bio_err,"-elapsed        measure time in real time instead of CPU user time.\\n");\n#endif\n#ifndef OPENSSL_NO_ENGINE\n\t\t\tBIO_printf(bio_err,"-engine e       use engine e, possibly a hardware device.\\n");\n#endif\n\t\t\tBIO_printf(bio_err,"-evp e          use EVP e.\\n");\n\t\t\tBIO_printf(bio_err,"-decrypt        time decryption instead of encryption (only EVP).\\n");\n\t\t\tBIO_printf(bio_err,"-mr             produce machine readable output.\\n");\n#ifndef NO_FORK\n\t\t\tBIO_printf(bio_err,"-multi n        run n benchmarks in parallel.\\n");\n#endif\n\t\t\tgoto end;\n\t\t\t}\n\t\targc--;\n\t\targv++;\n\t\tj++;\n\t\t}\n#ifndef NO_FORK\n\tif(multi && do_multi(multi))\n\t\tgoto show_res;\n#endif\n\tif (j == 0)\n\t\t{\n\t\tfor (i=0; i<ALGOR_NUM; i++)\n\t\t\t{\n\t\t\tif (i != D_EVP)\n\t\t\t\tdoit[i]=1;\n\t\t\t}\n\t\tfor (i=0; i<RSA_NUM; i++)\n\t\t\trsa_doit[i]=1;\n\t\tfor (i=0; i<DSA_NUM; i++)\n\t\t\tdsa_doit[i]=1;\n#ifndef OPENSSL_NO_ECDSA\n\t\tfor (i=0; i<EC_NUM; i++)\n\t\t\tecdsa_doit[i]=1;\n#endif\n#ifndef OPENSSL_NO_ECDH\n\t\tfor (i=0; i<EC_NUM; i++)\n\t\t\tecdh_doit[i]=1;\n#endif\n\t\t}\n\tfor (i=0; i<ALGOR_NUM; i++)\n\t\tif (doit[i]) pr_header++;\n\tif (usertime == 0 && !mr)\n\t\tBIO_printf(bio_err,"You have chosen to measure elapsed time instead of user CPU time.\\n");\n#ifndef OPENSSL_NO_RSA\n\tfor (i=0; i<RSA_NUM; i++)\n\t\t{\n\t\tconst unsigned char *p;\n\t\tp=rsa_data[i];\n\t\trsa_key[i]=d2i_RSAPrivateKey(NULL,&p,rsa_data_length[i]);\n\t\tif (rsa_key[i] == NULL)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"internal error loading RSA key number %d\\n",i);\n\t\t\tgoto end;\n\t\t\t}\n#if 0\n\t\telse\n\t\t\t{\n\t\t\tBIO_printf(bio_err,mr ? "+RK:%d:"\n\t\t\t\t   : "Loaded RSA key, %d bit modulus and e= 0x",\n\t\t\t\t   BN_num_bits(rsa_key[i]->n));\n\t\t\tBN_print(bio_err,rsa_key[i]->e);\n\t\t\tBIO_printf(bio_err,"\\n");\n\t\t\t}\n#endif\n\t\t}\n#endif\n#ifndef OPENSSL_NO_DSA\n\tdsa_key[0]=get_dsa512();\n\tdsa_key[1]=get_dsa1024();\n\tdsa_key[2]=get_dsa2048();\n#endif\n#ifndef OPENSSL_NO_DES\n\tDES_set_key_unchecked(&key,&sch);\n\tDES_set_key_unchecked(&key2,&sch2);\n\tDES_set_key_unchecked(&key3,&sch3);\n#endif\n#ifndef OPENSSL_NO_AES\n\tAES_set_encrypt_key(key16,128,&aes_ks1);\n\tAES_set_encrypt_key(key24,192,&aes_ks2);\n\tAES_set_encrypt_key(key32,256,&aes_ks3);\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\tCamellia_set_key(key16,128,&camellia_ks1);\n\tCamellia_set_key(ckey24,192,&camellia_ks2);\n\tCamellia_set_key(ckey32,256,&camellia_ks3);\n#endif\n#ifndef OPENSSL_NO_IDEA\n\tidea_set_encrypt_key(key16,&idea_ks);\n#endif\n#ifndef OPENSSL_NO_SEED\n\tSEED_set_key(key16,&seed_ks);\n#endif\n#ifndef OPENSSL_NO_RC4\n\tRC4_set_key(&rc4_ks,16,key16);\n#endif\n#ifndef OPENSSL_NO_RC2\n\tRC2_set_key(&rc2_ks,16,key16,128);\n#endif\n#ifndef OPENSSL_NO_RC5\n\tRC5_32_set_key(&rc5_ks,16,key16,12);\n#endif\n#ifndef OPENSSL_NO_BF\n\tBF_set_key(&bf_ks,16,key16);\n#endif\n#ifndef OPENSSL_NO_CAST\n\tCAST_set_key(&cast_ks,16,key16);\n#endif\n#ifndef OPENSSL_NO_RSA\n\tmemset(rsa_c,0,sizeof(rsa_c));\n#endif\n#ifndef SIGALRM\n#ifndef OPENSSL_NO_DES\n\tBIO_printf(bio_err,"First we calculate the approximate speed ...\\n");\n\tcount=10;\n\tdo\t{\n\t\tlong it;\n\t\tcount*=2;\n\t\tTime_F(START);\n\t\tfor (it=count; it; it--)\n\t\t\tDES_ecb_encrypt((DES_cblock *)buf,\n\t\t\t\t(DES_cblock *)buf,\n\t\t\t\t&sch,DES_ENCRYPT);\n\t\td=Time_F(STOP);\n\t\t} while (d <3);\n\tsave_count=count;\n\tc[D_MD2][0]=count/10;\n\tc[D_MDC2][0]=count/10;\n\tc[D_MD4][0]=count;\n\tc[D_MD5][0]=count;\n\tc[D_HMAC][0]=count;\n\tc[D_SHA1][0]=count;\n\tc[D_RMD160][0]=count;\n\tc[D_RC4][0]=count*5;\n\tc[D_CBC_DES][0]=count;\n\tc[D_EDE3_DES][0]=count/3;\n\tc[D_CBC_IDEA][0]=count;\n\tc[D_CBC_SEED][0]=count;\n\tc[D_CBC_RC2][0]=count;\n\tc[D_CBC_RC5][0]=count;\n\tc[D_CBC_BF][0]=count;\n\tc[D_CBC_CAST][0]=count;\n\tc[D_CBC_128_AES][0]=count;\n\tc[D_CBC_192_AES][0]=count;\n\tc[D_CBC_256_AES][0]=count;\n\tc[D_CBC_128_CML][0]=count;\n\tc[D_CBC_192_CML][0]=count;\n\tc[D_CBC_256_CML][0]=count;\n\tc[D_SHA256][0]=count;\n\tc[D_SHA512][0]=count;\n\tc[D_WHIRLPOOL][0]=count;\n\tc[D_IGE_128_AES][0]=count;\n\tc[D_IGE_192_AES][0]=count;\n\tc[D_IGE_256_AES][0]=count;\n\tc[D_GHASH][0]=count;\n\tfor (i=1; i<SIZE_NUM; i++)\n\t\t{\n\t\tc[D_MD2][i]=c[D_MD2][0]*4*lengths[0]/lengths[i];\n\t\tc[D_MDC2][i]=c[D_MDC2][0]*4*lengths[0]/lengths[i];\n\t\tc[D_MD4][i]=c[D_MD4][0]*4*lengths[0]/lengths[i];\n\t\tc[D_MD5][i]=c[D_MD5][0]*4*lengths[0]/lengths[i];\n\t\tc[D_HMAC][i]=c[D_HMAC][0]*4*lengths[0]/lengths[i];\n\t\tc[D_SHA1][i]=c[D_SHA1][0]*4*lengths[0]/lengths[i];\n\t\tc[D_RMD160][i]=c[D_RMD160][0]*4*lengths[0]/lengths[i];\n\t\tc[D_SHA256][i]=c[D_SHA256][0]*4*lengths[0]/lengths[i];\n\t\tc[D_SHA512][i]=c[D_SHA512][0]*4*lengths[0]/lengths[i];\n\t\tc[D_WHIRLPOOL][i]=c[D_WHIRLPOOL][0]*4*lengths[0]/lengths[i];\n\t\t}\n\tfor (i=1; i<SIZE_NUM; i++)\n\t\t{\n\t\tlong l0,l1;\n\t\tl0=(long)lengths[i-1];\n\t\tl1=(long)lengths[i];\n\t\tc[D_RC4][i]=c[D_RC4][i-1]*l0/l1;\n\t\tc[D_CBC_DES][i]=c[D_CBC_DES][i-1]*l0/l1;\n\t\tc[D_EDE3_DES][i]=c[D_EDE3_DES][i-1]*l0/l1;\n\t\tc[D_CBC_IDEA][i]=c[D_CBC_IDEA][i-1]*l0/l1;\n\t\tc[D_CBC_SEED][i]=c[D_CBC_SEED][i-1]*l0/l1;\n\t\tc[D_CBC_RC2][i]=c[D_CBC_RC2][i-1]*l0/l1;\n\t\tc[D_CBC_RC5][i]=c[D_CBC_RC5][i-1]*l0/l1;\n\t\tc[D_CBC_BF][i]=c[D_CBC_BF][i-1]*l0/l1;\n\t\tc[D_CBC_CAST][i]=c[D_CBC_CAST][i-1]*l0/l1;\n\t\tc[D_CBC_128_AES][i]=c[D_CBC_128_AES][i-1]*l0/l1;\n\t\tc[D_CBC_192_AES][i]=c[D_CBC_192_AES][i-1]*l0/l1;\n\t\tc[D_CBC_256_AES][i]=c[D_CBC_256_AES][i-1]*l0/l1;\n \t\tc[D_CBC_128_CML][i]=c[D_CBC_128_CML][i-1]*l0/l1;\n\t\tc[D_CBC_192_CML][i]=c[D_CBC_192_CML][i-1]*l0/l1;\n\t\tc[D_CBC_256_CML][i]=c[D_CBC_256_CML][i-1]*l0/l1;\n\t\tc[D_IGE_128_AES][i]=c[D_IGE_128_AES][i-1]*l0/l1;\n\t\tc[D_IGE_192_AES][i]=c[D_IGE_192_AES][i-1]*l0/l1;\n\t\tc[D_IGE_256_AES][i]=c[D_IGE_256_AES][i-1]*l0/l1;\n\t\t}\n#ifndef OPENSSL_NO_RSA\n\trsa_c[R_RSA_512][0]=count/2000;\n\trsa_c[R_RSA_512][1]=count/400;\n\tfor (i=1; i<RSA_NUM; i++)\n\t\t{\n\t\trsa_c[i][0]=rsa_c[i-1][0]/8;\n\t\trsa_c[i][1]=rsa_c[i-1][1]/4;\n\t\tif ((rsa_doit[i] <= 1) && (rsa_c[i][0] == 0))\n\t\t\trsa_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (rsa_c[i][0] == 0)\n\t\t\t\t{\n\t\t\t\trsa_c[i][0]=1;\n\t\t\t\trsa_c[i][1]=20;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_DSA\n\tdsa_c[R_DSA_512][0]=count/1000;\n\tdsa_c[R_DSA_512][1]=count/1000/2;\n\tfor (i=1; i<DSA_NUM; i++)\n\t\t{\n\t\tdsa_c[i][0]=dsa_c[i-1][0]/4;\n\t\tdsa_c[i][1]=dsa_c[i-1][1]/4;\n\t\tif ((dsa_doit[i] <= 1) && (dsa_c[i][0] == 0))\n\t\t\tdsa_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (dsa_c[i] == 0)\n\t\t\t\t{\n\t\t\t\tdsa_c[i][0]=1;\n\t\t\t\tdsa_c[i][1]=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\tecdsa_c[R_EC_P160][0]=count/1000;\n\tecdsa_c[R_EC_P160][1]=count/1000/2;\n\tfor (i=R_EC_P192; i<=R_EC_P521; i++)\n\t\t{\n\t\tecdsa_c[i][0]=ecdsa_c[i-1][0]/2;\n\t\tecdsa_c[i][1]=ecdsa_c[i-1][1]/2;\n\t\tif ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))\n\t\t\tecdsa_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (ecdsa_c[i] == 0)\n\t\t\t\t{\n\t\t\t\tecdsa_c[i][0]=1;\n\t\t\t\tecdsa_c[i][1]=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tecdsa_c[R_EC_K163][0]=count/1000;\n\tecdsa_c[R_EC_K163][1]=count/1000/2;\n\tfor (i=R_EC_K233; i<=R_EC_K571; i++)\n\t\t{\n\t\tecdsa_c[i][0]=ecdsa_c[i-1][0]/2;\n\t\tecdsa_c[i][1]=ecdsa_c[i-1][1]/2;\n\t\tif ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))\n\t\t\tecdsa_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (ecdsa_c[i] == 0)\n\t\t\t\t{\n\t\t\t\tecdsa_c[i][0]=1;\n\t\t\t\tecdsa_c[i][1]=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tecdsa_c[R_EC_B163][0]=count/1000;\n\tecdsa_c[R_EC_B163][1]=count/1000/2;\n\tfor (i=R_EC_B233; i<=R_EC_B571; i++)\n\t\t{\n\t\tecdsa_c[i][0]=ecdsa_c[i-1][0]/2;\n\t\tecdsa_c[i][1]=ecdsa_c[i-1][1]/2;\n\t\tif ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))\n\t\t\tecdsa_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (ecdsa_c[i] == 0)\n\t\t\t\t{\n\t\t\t\tecdsa_c[i][0]=1;\n\t\t\t\tecdsa_c[i][1]=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_ECDH\n\tecdh_c[R_EC_P160][0]=count/1000;\n\tecdh_c[R_EC_P160][1]=count/1000;\n\tfor (i=R_EC_P192; i<=R_EC_P521; i++)\n\t\t{\n\t\tecdh_c[i][0]=ecdh_c[i-1][0]/2;\n\t\tecdh_c[i][1]=ecdh_c[i-1][1]/2;\n\t\tif ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))\n\t\t\tecdh_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (ecdh_c[i] == 0)\n\t\t\t\t{\n\t\t\t\tecdh_c[i][0]=1;\n\t\t\t\tecdh_c[i][1]=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tecdh_c[R_EC_K163][0]=count/1000;\n\tecdh_c[R_EC_K163][1]=count/1000;\n\tfor (i=R_EC_K233; i<=R_EC_K571; i++)\n\t\t{\n\t\tecdh_c[i][0]=ecdh_c[i-1][0]/2;\n\t\tecdh_c[i][1]=ecdh_c[i-1][1]/2;\n\t\tif ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))\n\t\t\tecdh_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (ecdh_c[i] == 0)\n\t\t\t\t{\n\t\t\t\tecdh_c[i][0]=1;\n\t\t\t\tecdh_c[i][1]=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tecdh_c[R_EC_B163][0]=count/1000;\n\tecdh_c[R_EC_B163][1]=count/1000;\n\tfor (i=R_EC_B233; i<=R_EC_B571; i++)\n\t\t{\n\t\tecdh_c[i][0]=ecdh_c[i-1][0]/2;\n\t\tecdh_c[i][1]=ecdh_c[i-1][1]/2;\n\t\tif ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))\n\t\t\tecdh_doit[i]=0;\n\t\telse\n\t\t\t{\n\t\t\tif (ecdh_c[i] == 0)\n\t\t\t\t{\n\t\t\t\tecdh_c[i][0]=1;\n\t\t\t\tecdh_c[i][1]=1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n#endif\n#define COND(d)\t(count < (d))\n#define COUNT(d) (d)\n#else\n# error "You cannot disable DES on systems without SIGALRM."\n#endif\n#else\n#define COND(c)\t(run && count<0x7fffffff)\n#define COUNT(d) (count)\n#ifndef _WIN32\n\tsignal(SIGALRM,sig_done);\n#endif\n#endif\n#ifndef OPENSSL_NO_MD2\n\tif (doit[D_MD2])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_MD2],c[D_MD2][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_MD2][j]); count++)\n\t\t\t\tEVP_Digest(buf,(unsigned long)lengths[j],&(md2[0]),NULL,EVP_md2(),NULL);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_MD2,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_MDC2\n\tif (doit[D_MDC2])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_MDC2],c[D_MDC2][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_MDC2][j]); count++)\n\t\t\t\tEVP_Digest(buf,(unsigned long)lengths[j],&(mdc2[0]),NULL,EVP_mdc2(),NULL);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_MDC2,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_MD4\n\tif (doit[D_MD4])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_MD4],c[D_MD4][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_MD4][j]); count++)\n\t\t\t\tEVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md4[0]),NULL,EVP_md4(),NULL);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_MD4,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_MD5\n\tif (doit[D_MD5])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_MD5],c[D_MD5][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_MD5][j]); count++)\n\t\t\t\tEVP_Digest(&(buf[0]),(unsigned long)lengths[j],&(md5[0]),NULL,EVP_get_digestbyname("md5"),NULL);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_MD5,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#if !defined(OPENSSL_NO_MD5) && !defined(OPENSSL_NO_HMAC)\n\tif (doit[D_HMAC])\n\t\t{\n\t\tHMAC_CTX hctx;\n\t\tHMAC_CTX_init(&hctx);\n\t\tHMAC_Init_ex(&hctx,(unsigned char *)"This is a key...",\n\t\t\t16,EVP_md5(), NULL);\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_HMAC],c[D_HMAC][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_HMAC][j]); count++)\n\t\t\t\t{\n\t\t\t\tHMAC_Init_ex(&hctx,NULL,0,NULL,NULL);\n\t\t\t\tHMAC_Update(&hctx,buf,lengths[j]);\n\t\t\t\tHMAC_Final(&hctx,&(hmac[0]),NULL);\n\t\t\t\t}\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_HMAC,j,count,d);\n\t\t\t}\n\t\tHMAC_CTX_cleanup(&hctx);\n\t\t}\n#endif\n#ifndef OPENSSL_NO_SHA\n\tif (doit[D_SHA1])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_SHA1],c[D_SHA1][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_SHA1][j]); count++)\n\t\t\t\tEVP_Digest(buf,(unsigned long)lengths[j],&(sha[0]),NULL,EVP_sha1(),NULL);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_SHA1,j,count,d);\n\t\t\t}\n\t\t}\n#ifndef OPENSSL_NO_SHA256\n\tif (doit[D_SHA256])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_SHA256],c[D_SHA256][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_SHA256][j]); count++)\n\t\t\t\tSHA256(buf,lengths[j],sha256);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_SHA256,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_SHA512\n\tif (doit[D_SHA512])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_SHA512],c[D_SHA512][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_SHA512][j]); count++)\n\t\t\t\tSHA512(buf,lengths[j],sha512);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_SHA512,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#endif\n#ifndef OPENSSL_NO_WHIRLPOOL\n\tif (doit[D_WHIRLPOOL])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_WHIRLPOOL],c[D_WHIRLPOOL][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_WHIRLPOOL][j]); count++)\n\t\t\t\tWHIRLPOOL(buf,lengths[j],whirlpool);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_WHIRLPOOL,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_RIPEMD\n\tif (doit[D_RMD160])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_RMD160],c[D_RMD160][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_RMD160][j]); count++)\n\t\t\t\tEVP_Digest(buf,(unsigned long)lengths[j],&(rmd160[0]),NULL,EVP_ripemd160(),NULL);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_RMD160,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_RC4\n\tif (doit[D_RC4])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_RC4],c[D_RC4][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_RC4][j]); count++)\n\t\t\t\tRC4(&rc4_ks,(unsigned int)lengths[j],\n\t\t\t\t\tbuf,buf);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_RC4,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_DES\n\tif (doit[D_CBC_DES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_DES],c[D_CBC_DES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_DES][j]); count++)\n\t\t\t\tDES_ncbc_encrypt(buf,buf,lengths[j],&sch,\n\t\t\t\t\t\t &DES_iv,DES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_DES,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_EDE3_DES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_EDE3_DES],c[D_EDE3_DES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_EDE3_DES][j]); count++)\n\t\t\t\tDES_ede3_cbc_encrypt(buf,buf,lengths[j],\n\t\t\t\t\t\t     &sch,&sch2,&sch3,\n\t\t\t\t\t\t     &DES_iv,DES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_EDE3_DES,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_AES\n\tif (doit[D_CBC_128_AES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_128_AES],c[D_CBC_128_AES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_128_AES][j]); count++)\n\t\t\t\tAES_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&aes_ks1,\n\t\t\t\t\tiv,AES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_128_AES,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_CBC_192_AES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_192_AES],c[D_CBC_192_AES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_192_AES][j]); count++)\n\t\t\t\tAES_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&aes_ks2,\n\t\t\t\t\tiv,AES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_192_AES,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_CBC_256_AES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_256_AES],c[D_CBC_256_AES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_256_AES][j]); count++)\n\t\t\t\tAES_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&aes_ks3,\n\t\t\t\t\tiv,AES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_256_AES,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_IGE_128_AES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_IGE_128_AES],c[D_IGE_128_AES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_IGE_128_AES][j]); count++)\n\t\t\t\tAES_ige_encrypt(buf,buf2,\n\t\t\t\t\t(unsigned long)lengths[j],&aes_ks1,\n\t\t\t\t\tiv,AES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_IGE_128_AES,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_IGE_192_AES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_IGE_192_AES],c[D_IGE_192_AES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_IGE_192_AES][j]); count++)\n\t\t\t\tAES_ige_encrypt(buf,buf2,\n\t\t\t\t\t(unsigned long)lengths[j],&aes_ks2,\n\t\t\t\t\tiv,AES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_IGE_192_AES,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_IGE_256_AES])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_IGE_256_AES],c[D_IGE_256_AES][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_IGE_256_AES][j]); count++)\n\t\t\t\tAES_ige_encrypt(buf,buf2,\n\t\t\t\t\t(unsigned long)lengths[j],&aes_ks3,\n\t\t\t\t\tiv,AES_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_IGE_256_AES,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_GHASH])\n\t\t{\n\t\tGCM128_CONTEXT *ctx = CRYPTO_gcm128_new(&aes_ks1,(block128_f)AES_encrypt);\n\t\tCRYPTO_gcm128_setiv (ctx,(unsigned char *)"0123456789ab",12);\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_GHASH],c[D_GHASH][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_GHASH][j]); count++)\n\t\t\t\tCRYPTO_gcm128_aad(ctx,buf,lengths[j]);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_GHASH,j,count,d);\n\t\t\t}\n\t\tCRYPTO_gcm128_release(ctx);\n\t\t}\n#endif\n#ifndef OPENSSL_NO_CAMELLIA\n\tif (doit[D_CBC_128_CML])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_128_CML],c[D_CBC_128_CML][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_128_CML][j]); count++)\n\t\t\t\tCamellia_cbc_encrypt(buf,buf,\n\t\t\t\t        (unsigned long)lengths[j],&camellia_ks1,\n\t\t\t\t        iv,CAMELLIA_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_128_CML,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_CBC_192_CML])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_192_CML],c[D_CBC_192_CML][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_192_CML][j]); count++)\n\t\t\t\tCamellia_cbc_encrypt(buf,buf,\n\t\t\t\t        (unsigned long)lengths[j],&camellia_ks2,\n\t\t\t\t        iv,CAMELLIA_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_192_CML,j,count,d);\n\t\t\t}\n\t\t}\n\tif (doit[D_CBC_256_CML])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_256_CML],c[D_CBC_256_CML][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_256_CML][j]); count++)\n\t\t\t\tCamellia_cbc_encrypt(buf,buf,\n\t\t\t\t        (unsigned long)lengths[j],&camellia_ks3,\n\t\t\t\t        iv,CAMELLIA_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_256_CML,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_IDEA\n\tif (doit[D_CBC_IDEA])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_IDEA],c[D_CBC_IDEA][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_IDEA][j]); count++)\n\t\t\t\tidea_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&idea_ks,\n\t\t\t\t\tiv,IDEA_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_IDEA,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_SEED\n\tif (doit[D_CBC_SEED])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_SEED],c[D_CBC_SEED][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_SEED][j]); count++)\n\t\t\t\tSEED_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&seed_ks,iv,1);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_SEED,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_RC2\n\tif (doit[D_CBC_RC2])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_RC2],c[D_CBC_RC2][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_RC2][j]); count++)\n\t\t\t\tRC2_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&rc2_ks,\n\t\t\t\t\tiv,RC2_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_RC2,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_RC5\n\tif (doit[D_CBC_RC5])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_RC5],c[D_CBC_RC5][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_RC5][j]); count++)\n\t\t\t\tRC5_32_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&rc5_ks,\n\t\t\t\t\tiv,RC5_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_RC5,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_BF\n\tif (doit[D_CBC_BF])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_BF],c[D_CBC_BF][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_BF][j]); count++)\n\t\t\t\tBF_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&bf_ks,\n\t\t\t\t\tiv,BF_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_BF,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n#ifndef OPENSSL_NO_CAST\n\tif (doit[D_CBC_CAST])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tprint_message(names[D_CBC_CAST],c[D_CBC_CAST][j],lengths[j]);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(c[D_CBC_CAST][j]); count++)\n\t\t\t\tCAST_cbc_encrypt(buf,buf,\n\t\t\t\t\t(unsigned long)lengths[j],&cast_ks,\n\t\t\t\t\tiv,CAST_ENCRYPT);\n\t\t\td=Time_F(STOP);\n\t\t\tprint_result(D_CBC_CAST,j,count,d);\n\t\t\t}\n\t\t}\n#endif\n\tif (doit[D_EVP])\n\t\t{\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tif (evp_cipher)\n\t\t\t\t{\n\t\t\t\tEVP_CIPHER_CTX ctx;\n\t\t\t\tint outl;\n\t\t\t\tnames[D_EVP]=OBJ_nid2ln(evp_cipher->nid);\n\t\t\t\tprint_message(names[D_EVP],save_count,\n\t\t\t\t\tlengths[j]);\n\t\t\t\tEVP_CIPHER_CTX_init(&ctx);\n\t\t\t\tif(decrypt)\n\t\t\t\t\tEVP_DecryptInit_ex(&ctx,evp_cipher,NULL,key16,iv);\n\t\t\t\telse\n\t\t\t\t\tEVP_EncryptInit_ex(&ctx,evp_cipher,NULL,key16,iv);\n\t\t\t\tEVP_CIPHER_CTX_set_padding(&ctx, 0);\n\t\t\t\tTime_F(START);\n\t\t\t\tif(decrypt)\n\t\t\t\t\tfor (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)\n\t\t\t\t\t\tEVP_DecryptUpdate(&ctx,buf,&outl,buf,lengths[j]);\n\t\t\t\telse\n\t\t\t\t\tfor (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)\n\t\t\t\t\t\tEVP_EncryptUpdate(&ctx,buf,&outl,buf,lengths[j]);\n\t\t\t\tif(decrypt)\n\t\t\t\t\tEVP_DecryptFinal_ex(&ctx,buf,&outl);\n\t\t\t\telse\n\t\t\t\t\tEVP_EncryptFinal_ex(&ctx,buf,&outl);\n\t\t\t\td=Time_F(STOP);\n\t\t\t\tEVP_CIPHER_CTX_cleanup(&ctx);\n\t\t\t\t}\n\t\t\tif (evp_md)\n\t\t\t\t{\n\t\t\t\tnames[D_EVP]=OBJ_nid2ln(evp_md->type);\n\t\t\t\tprint_message(names[D_EVP],save_count,\n\t\t\t\t\tlengths[j]);\n\t\t\t\tTime_F(START);\n\t\t\t\tfor (count=0,run=1; COND(save_count*4*lengths[0]/lengths[j]); count++)\n\t\t\t\t\tEVP_Digest(buf,lengths[j],&(md[0]),NULL,evp_md,NULL);\n\t\t\t\td=Time_F(STOP);\n\t\t\t\t}\n\t\t\tprint_result(D_EVP,j,count,d);\n\t\t\t}\n\t\t}\n\tRAND_pseudo_bytes(buf,36);\n#ifndef OPENSSL_NO_RSA\n\tfor (j=0; j<RSA_NUM; j++)\n\t\t{\n\t\tint ret;\n\t\tif (!rsa_doit[j]) continue;\n\t\tret=RSA_sign(NID_md5_sha1, buf,36, buf2, &rsa_num, rsa_key[j]);\n\t\tif (ret == 0)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"RSA sign failure.  No RSA sign will be done.\\n");\n\t\t\tERR_print_errors(bio_err);\n\t\t\trsa_count=1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tpkey_print_message("private","rsa",\n\t\t\t\trsa_c[j][0],rsa_bits[j],\n\t\t\t\tRSA_SECONDS);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(rsa_c[j][0]); count++)\n\t\t\t\t{\n\t\t\t\tret=RSA_sign(NID_md5_sha1, buf,36, buf2,\n\t\t\t\t\t&rsa_num, rsa_key[j]);\n\t\t\t\tif (ret == 0)\n\t\t\t\t\t{\n\t\t\t\t\tBIO_printf(bio_err,\n\t\t\t\t\t\t"RSA sign failure\\n");\n\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\tcount=1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\td=Time_F(STOP);\n\t\t\tBIO_printf(bio_err,mr ? "+R1:%ld:%d:%.2f\\n"\n\t\t\t\t   : "%ld %d bit private RSA\'s in %.2fs\\n",\n\t\t\t\t   count,rsa_bits[j],d);\n\t\t\trsa_results[j][0]=d/(double)count;\n\t\t\trsa_count=count;\n\t\t\t}\n#if 1\n\t\tret=RSA_verify(NID_md5_sha1, buf,36, buf2, rsa_num, rsa_key[j]);\n\t\tif (ret <= 0)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"RSA verify failure.  No RSA verify will be done.\\n");\n\t\t\tERR_print_errors(bio_err);\n\t\t\trsa_doit[j] = 0;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tpkey_print_message("public","rsa",\n\t\t\t\trsa_c[j][1],rsa_bits[j],\n\t\t\t\tRSA_SECONDS);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(rsa_c[j][1]); count++)\n\t\t\t\t{\n\t\t\t\tret=RSA_verify(NID_md5_sha1, buf,36, buf2,\n\t\t\t\t\trsa_num, rsa_key[j]);\n\t\t\t\tif (ret <= 0)\n\t\t\t\t\t{\n\t\t\t\t\tBIO_printf(bio_err,\n\t\t\t\t\t\t"RSA verify failure\\n");\n\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\tcount=1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\td=Time_F(STOP);\n\t\t\tBIO_printf(bio_err,mr ? "+R2:%ld:%d:%.2f\\n"\n\t\t\t\t   : "%ld %d bit public RSA\'s in %.2fs\\n",\n\t\t\t\t   count,rsa_bits[j],d);\n\t\t\trsa_results[j][1]=d/(double)count;\n\t\t\t}\n#endif\n\t\tif (rsa_count <= 1)\n\t\t\t{\n\t\t\tfor (j++; j<RSA_NUM; j++)\n\t\t\t\trsa_doit[j]=0;\n\t\t\t}\n\t\t}\n#endif\n\tRAND_pseudo_bytes(buf,20);\n#ifndef OPENSSL_NO_DSA\n\tif (RAND_status() != 1)\n\t\t{\n\t\tRAND_seed(rnd_seed, sizeof rnd_seed);\n\t\trnd_fake = 1;\n\t\t}\n\tfor (j=0; j<DSA_NUM; j++)\n\t\t{\n\t\tunsigned int kk;\n\t\tint ret;\n\t\tif (!dsa_doit[j]) continue;\n\t\tret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,\n\t\t\t&kk,dsa_key[j]);\n\t\tif (ret == 0)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"DSA sign failure.  No DSA sign will be done.\\n");\n\t\t\tERR_print_errors(bio_err);\n\t\t\trsa_count=1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tpkey_print_message("sign","dsa",\n\t\t\t\tdsa_c[j][0],dsa_bits[j],\n\t\t\t\tDSA_SECONDS);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(dsa_c[j][0]); count++)\n\t\t\t\t{\n\t\t\t\tret=DSA_sign(EVP_PKEY_DSA,buf,20,buf2,\n\t\t\t\t\t&kk,dsa_key[j]);\n\t\t\t\tif (ret == 0)\n\t\t\t\t\t{\n\t\t\t\t\tBIO_printf(bio_err,\n\t\t\t\t\t\t"DSA sign failure\\n");\n\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\tcount=1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\td=Time_F(STOP);\n\t\t\tBIO_printf(bio_err,mr ? "+R3:%ld:%d:%.2f\\n"\n\t\t\t\t   : "%ld %d bit DSA signs in %.2fs\\n",\n\t\t\t\t   count,dsa_bits[j],d);\n\t\t\tdsa_results[j][0]=d/(double)count;\n\t\t\trsa_count=count;\n\t\t\t}\n\t\tret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,\n\t\t\tkk,dsa_key[j]);\n\t\tif (ret <= 0)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"DSA verify failure.  No DSA verify will be done.\\n");\n\t\t\tERR_print_errors(bio_err);\n\t\t\tdsa_doit[j] = 0;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tpkey_print_message("verify","dsa",\n\t\t\t\tdsa_c[j][1],dsa_bits[j],\n\t\t\t\tDSA_SECONDS);\n\t\t\tTime_F(START);\n\t\t\tfor (count=0,run=1; COND(dsa_c[j][1]); count++)\n\t\t\t\t{\n\t\t\t\tret=DSA_verify(EVP_PKEY_DSA,buf,20,buf2,\n\t\t\t\t\tkk,dsa_key[j]);\n\t\t\t\tif (ret <= 0)\n\t\t\t\t\t{\n\t\t\t\t\tBIO_printf(bio_err,\n\t\t\t\t\t\t"DSA verify failure\\n");\n\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\tcount=1;\n\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\td=Time_F(STOP);\n\t\t\tBIO_printf(bio_err,mr ? "+R4:%ld:%d:%.2f\\n"\n\t\t\t\t   : "%ld %d bit DSA verify in %.2fs\\n",\n\t\t\t\t   count,dsa_bits[j],d);\n\t\t\tdsa_results[j][1]=d/(double)count;\n\t\t\t}\n\t\tif (rsa_count <= 1)\n\t\t\t{\n\t\t\tfor (j++; j<DSA_NUM; j++)\n\t\t\t\tdsa_doit[j]=0;\n\t\t\t}\n\t\t}\n\tif (rnd_fake) RAND_cleanup();\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\tif (RAND_status() != 1)\n\t\t{\n\t\tRAND_seed(rnd_seed, sizeof rnd_seed);\n\t\trnd_fake = 1;\n\t\t}\n\tfor (j=0; j<EC_NUM; j++)\n\t\t{\n\t\tint ret;\n\t\tif (!ecdsa_doit[j]) continue;\n\t\tecdsa[j] = EC_KEY_new_by_curve_name(test_curves[j]);\n\t\tif (ecdsa[j] == NULL)\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"ECDSA failure.\\n");\n\t\t\tERR_print_errors(bio_err);\n\t\t\trsa_count=1;\n\t\t\t}\n\t\telse\n\t\t\t{\n#if 1\n\t\t\tEC_KEY_precompute_mult(ecdsa[j], NULL);\n#endif\n\t\t\tEC_KEY_generate_key(ecdsa[j]);\n\t\t\tret = ECDSA_sign(0, buf, 20, ecdsasig,\n\t\t\t\t&ecdsasiglen, ecdsa[j]);\n\t\t\tif (ret == 0)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"ECDSA sign failure.  No ECDSA sign will be done.\\n");\n\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\trsa_count=1;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tpkey_print_message("sign","ecdsa",\n\t\t\t\t\tecdsa_c[j][0],\n\t\t\t\t\ttest_curves_bits[j],\n\t\t\t\t\tECDSA_SECONDS);\n\t\t\t\tTime_F(START);\n\t\t\t\tfor (count=0,run=1; COND(ecdsa_c[j][0]);\n\t\t\t\t\tcount++)\n\t\t\t\t\t{\n\t\t\t\t\tret=ECDSA_sign(0, buf, 20,\n\t\t\t\t\t\tecdsasig, &ecdsasiglen,\n\t\t\t\t\t\tecdsa[j]);\n\t\t\t\t\tif (ret == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tBIO_printf(bio_err, "ECDSA sign failure\\n");\n\t\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\t\tcount=1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\td=Time_F(STOP);\n\t\t\t\tBIO_printf(bio_err, mr ? "+R5:%ld:%d:%.2f\\n" :\n\t\t\t\t\t"%ld %d bit ECDSA signs in %.2fs \\n",\n\t\t\t\t\tcount, test_curves_bits[j], d);\n\t\t\t\tecdsa_results[j][0]=d/(double)count;\n\t\t\t\trsa_count=count;\n\t\t\t\t}\n\t\t\tret=ECDSA_verify(0, buf, 20, ecdsasig,\n\t\t\t\tecdsasiglen, ecdsa[j]);\n\t\t\tif (ret != 1)\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"ECDSA verify failure.  No ECDSA verify will be done.\\n");\n\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\tecdsa_doit[j] = 0;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tpkey_print_message("verify","ecdsa",\n\t\t\t\tecdsa_c[j][1],\n\t\t\t\ttest_curves_bits[j],\n\t\t\t\tECDSA_SECONDS);\n\t\t\t\tTime_F(START);\n\t\t\t\tfor (count=0,run=1; COND(ecdsa_c[j][1]); count++)\n\t\t\t\t\t{\n\t\t\t\t\tret=ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]);\n\t\t\t\t\tif (ret != 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\tBIO_printf(bio_err, "ECDSA verify failure\\n");\n\t\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\t\tcount=1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\td=Time_F(STOP);\n\t\t\t\tBIO_printf(bio_err, mr? "+R6:%ld:%d:%.2f\\n"\n\t\t\t\t\t\t: "%ld %d bit ECDSA verify in %.2fs\\n",\n\t\t\t\tcount, test_curves_bits[j], d);\n\t\t\t\tecdsa_results[j][1]=d/(double)count;\n\t\t\t\t}\n\t\t\tif (rsa_count <= 1)\n\t\t\t\t{\n\t\t\t\tfor (j++; j<EC_NUM; j++)\n\t\t\t\tecdsa_doit[j]=0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tif (rnd_fake) RAND_cleanup();\n#endif\n#ifndef OPENSSL_NO_ECDH\n\tif (RAND_status() != 1)\n\t\t{\n\t\tRAND_seed(rnd_seed, sizeof rnd_seed);\n\t\trnd_fake = 1;\n\t\t}\n\tfor (j=0; j<EC_NUM; j++)\n\t\t{\n\t\tif (!ecdh_doit[j]) continue;\n\t\tecdh_a[j] = EC_KEY_new_by_curve_name(test_curves[j]);\n\t\tecdh_b[j] = EC_KEY_new_by_curve_name(test_curves[j]);\n\t\tif ((ecdh_a[j] == NULL) || (ecdh_b[j] == NULL))\n\t\t\t{\n\t\t\tBIO_printf(bio_err,"ECDH failure.\\n");\n\t\t\tERR_print_errors(bio_err);\n\t\t\trsa_count=1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tif (!EC_KEY_generate_key(ecdh_a[j]) ||\n\t\t\t\t!EC_KEY_generate_key(ecdh_b[j]))\n\t\t\t\t{\n\t\t\t\tBIO_printf(bio_err,"ECDH key generation failure.\\n");\n\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\trsa_count=1;\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\tint field_size, outlen;\n\t\t\t\tvoid *(*kdf)(const void *in, size_t inlen, void *out, size_t *xoutlen);\n\t\t\t\tfield_size = EC_GROUP_get_degree(EC_KEY_get0_group(ecdh_a[j]));\n\t\t\t\tif (field_size <= 24 * 8)\n\t\t\t\t\t{\n\t\t\t\t\toutlen = KDF1_SHA1_len;\n\t\t\t\t\tkdf = KDF1_SHA1;\n\t\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\toutlen = (field_size+7)/8;\n\t\t\t\t\tkdf = NULL;\n\t\t\t\t\t}\n\t\t\t\tsecret_size_a = ECDH_compute_key(secret_a, outlen,\n\t\t\t\t\tEC_KEY_get0_public_key(ecdh_b[j]),\n\t\t\t\t\tecdh_a[j], kdf);\n\t\t\t\tsecret_size_b = ECDH_compute_key(secret_b, outlen,\n\t\t\t\t\tEC_KEY_get0_public_key(ecdh_a[j]),\n\t\t\t\t\tecdh_b[j], kdf);\n\t\t\t\tif (secret_size_a != secret_size_b)\n\t\t\t\t\tecdh_checks = 0;\n\t\t\t\telse\n\t\t\t\t\tecdh_checks = 1;\n\t\t\t\tfor (secret_idx = 0;\n\t\t\t\t    (secret_idx < secret_size_a)\n\t\t\t\t\t&& (ecdh_checks == 1);\n\t\t\t\t    secret_idx++)\n\t\t\t\t\t{\n\t\t\t\t\tif (secret_a[secret_idx] != secret_b[secret_idx])\n\t\t\t\t\tecdh_checks = 0;\n\t\t\t\t\t}\n\t\t\t\tif (ecdh_checks == 0)\n\t\t\t\t\t{\n\t\t\t\t\tBIO_printf(bio_err,"ECDH computations don\'t match.\\n");\n\t\t\t\t\tERR_print_errors(bio_err);\n\t\t\t\t\trsa_count=1;\n\t\t\t\t\t}\n\t\t\t\tpkey_print_message("","ecdh",\n\t\t\t\tecdh_c[j][0],\n\t\t\t\ttest_curves_bits[j],\n\t\t\t\tECDH_SECONDS);\n\t\t\t\tTime_F(START);\n\t\t\t\tfor (count=0,run=1; COND(ecdh_c[j][0]); count++)\n\t\t\t\t\t{\n\t\t\t\t\tECDH_compute_key(secret_a, outlen,\n\t\t\t\t\tEC_KEY_get0_public_key(ecdh_b[j]),\n\t\t\t\t\tecdh_a[j], kdf);\n\t\t\t\t\t}\n\t\t\t\td=Time_F(STOP);\n\t\t\t\tBIO_printf(bio_err, mr ? "+R7:%ld:%d:%.2f\\n" :"%ld %d-bit ECDH ops in %.2fs\\n",\n\t\t\t\tcount, test_curves_bits[j], d);\n\t\t\t\tecdh_results[j][0]=d/(double)count;\n\t\t\t\trsa_count=count;\n\t\t\t\t}\n\t\t\t}\n\t\tif (rsa_count <= 1)\n\t\t\t{\n\t\t\tfor (j++; j<EC_NUM; j++)\n\t\t\tecdh_doit[j]=0;\n\t\t\t}\n\t\t}\n\tif (rnd_fake) RAND_cleanup();\n#endif\n#ifndef NO_FORK\nshow_res:\n#endif\n\tif(!mr)\n\t\t{\n\t\tfprintf(stdout,"%s\\n",SSLeay_version(SSLEAY_VERSION));\n        fprintf(stdout,"%s\\n",SSLeay_version(SSLEAY_BUILT_ON));\n\t\tprintf("options:");\n\t\tprintf("%s ",BN_options());\n#ifndef OPENSSL_NO_MD2\n\t\tprintf("%s ",MD2_options());\n#endif\n#ifndef OPENSSL_NO_RC4\n\t\tprintf("%s ",RC4_options());\n#endif\n#ifndef OPENSSL_NO_DES\n\t\tprintf("%s ",DES_options());\n#endif\n#ifndef OPENSSL_NO_AES\n\t\tprintf("%s ",AES_options());\n#endif\n#ifndef OPENSSL_NO_IDEA\n\t\tprintf("%s ",idea_options());\n#endif\n#ifndef OPENSSL_NO_BF\n\t\tprintf("%s ",BF_options());\n#endif\n\t\tfprintf(stdout,"\\n%s\\n",SSLeay_version(SSLEAY_CFLAGS));\n\t\t}\n\tif (pr_header)\n\t\t{\n\t\tif(mr)\n\t\t\tfprintf(stdout,"+H");\n\t\telse\n\t\t\t{\n\t\t\tfprintf(stdout,"The \'numbers\' are in 1000s of bytes per second processed.\\n");\n\t\t\tfprintf(stdout,"type        ");\n\t\t\t}\n\t\tfor (j=0;  j<SIZE_NUM; j++)\n\t\t\tfprintf(stdout,mr ? ":%d" : "%7d bytes",lengths[j]);\n\t\tfprintf(stdout,"\\n");\n\t\t}\n\tfor (k=0; k<ALGOR_NUM; k++)\n\t\t{\n\t\tif (!doit[k]) continue;\n\t\tif(mr)\n\t\t\tfprintf(stdout,"+F:%d:%s",k,names[k]);\n\t\telse\n\t\t\tfprintf(stdout,"%-13s",names[k]);\n\t\tfor (j=0; j<SIZE_NUM; j++)\n\t\t\t{\n\t\t\tif (results[k][j] > 10000 && !mr)\n\t\t\t\tfprintf(stdout," %11.2fk",results[k][j]/1e3);\n\t\t\telse\n\t\t\t\tfprintf(stdout,mr ? ":%.2f" : " %11.2f ",results[k][j]);\n\t\t\t}\n\t\tfprintf(stdout,"\\n");\n\t\t}\n#ifndef OPENSSL_NO_RSA\n\tj=1;\n\tfor (k=0; k<RSA_NUM; k++)\n\t\t{\n\t\tif (!rsa_doit[k]) continue;\n\t\tif (j && !mr)\n\t\t\t{\n\t\t\tprintf("%18ssign    verify    sign/s verify/s\\n"," ");\n\t\t\tj=0;\n\t\t\t}\n\t\tif(mr)\n\t\t\tfprintf(stdout,"+F2:%u:%u:%f:%f\\n",\n\t\t\t\tk,rsa_bits[k],rsa_results[k][0],\n\t\t\t\trsa_results[k][1]);\n\t\telse\n\t\t\tfprintf(stdout,"rsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\\n",\n\t\t\t\trsa_bits[k],rsa_results[k][0],rsa_results[k][1],\n\t\t\t\t1.0/rsa_results[k][0],1.0/rsa_results[k][1]);\n\t\t}\n#endif\n#ifndef OPENSSL_NO_DSA\n\tj=1;\n\tfor (k=0; k<DSA_NUM; k++)\n\t\t{\n\t\tif (!dsa_doit[k]) continue;\n\t\tif (j && !mr)\n\t\t\t{\n\t\t\tprintf("%18ssign    verify    sign/s verify/s\\n"," ");\n\t\t\tj=0;\n\t\t\t}\n\t\tif(mr)\n\t\t\tfprintf(stdout,"+F3:%u:%u:%f:%f\\n",\n\t\t\t\tk,dsa_bits[k],dsa_results[k][0],dsa_results[k][1]);\n\t\telse\n\t\t\tfprintf(stdout,"dsa %4u bits %8.6fs %8.6fs %8.1f %8.1f\\n",\n\t\t\t\tdsa_bits[k],dsa_results[k][0],dsa_results[k][1],\n\t\t\t\t1.0/dsa_results[k][0],1.0/dsa_results[k][1]);\n\t\t}\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\tj=1;\n\tfor (k=0; k<EC_NUM; k++)\n\t\t{\n\t\tif (!ecdsa_doit[k]) continue;\n\t\tif (j && !mr)\n\t\t\t{\n\t\t\tprintf("%30ssign    verify    sign/s verify/s\\n"," ");\n\t\t\tj=0;\n\t\t\t}\n\t\tif (mr)\n\t\t\tfprintf(stdout,"+F4:%u:%u:%f:%f\\n",\n\t\t\t\tk, test_curves_bits[k],\n\t\t\t\tecdsa_results[k][0],ecdsa_results[k][1]);\n\t\telse\n\t\t\tfprintf(stdout,\n\t\t\t\t"%4u bit ecdsa (%s) %8.4fs %8.4fs %8.1f %8.1f\\n",\n\t\t\t\ttest_curves_bits[k],\n\t\t\t\ttest_curves_names[k],\n\t\t\t\tecdsa_results[k][0],ecdsa_results[k][1],\n\t\t\t\t1.0/ecdsa_results[k][0],1.0/ecdsa_results[k][1]);\n\t\t}\n#endif\n#ifndef OPENSSL_NO_ECDH\n\tj=1;\n\tfor (k=0; k<EC_NUM; k++)\n\t\t{\n\t\tif (!ecdh_doit[k]) continue;\n\t\tif (j && !mr)\n\t\t\t{\n\t\t\tprintf("%30sop      op/s\\n"," ");\n\t\t\tj=0;\n\t\t\t}\n\t\tif (mr)\n\t\t\tfprintf(stdout,"+F5:%u:%u:%f:%f\\n",\n\t\t\t\tk, test_curves_bits[k],\n\t\t\t\tecdh_results[k][0], 1.0/ecdh_results[k][0]);\n\t\telse\n\t\t\tfprintf(stdout,"%4u bit ecdh (%s) %8.4fs %8.1f\\n",\n\t\t\t\ttest_curves_bits[k],\n\t\t\t\ttest_curves_names[k],\n\t\t\t\tecdh_results[k][0], 1.0/ecdh_results[k][0]);\n\t\t}\n#endif\n\tmret=0;\nend:\n\tERR_print_errors(bio_err);\n\tif (buf != NULL) OPENSSL_free(buf);\n\tif (buf2 != NULL) OPENSSL_free(buf2);\n#ifndef OPENSSL_NO_RSA\n\tfor (i=0; i<RSA_NUM; i++)\n\t\tif (rsa_key[i] != NULL)\n\t\t\tRSA_free(rsa_key[i]);\n#endif\n#ifndef OPENSSL_NO_DSA\n\tfor (i=0; i<DSA_NUM; i++)\n\t\tif (dsa_key[i] != NULL)\n\t\t\tDSA_free(dsa_key[i]);\n#endif\n#ifndef OPENSSL_NO_ECDSA\n\tfor (i=0; i<EC_NUM; i++)\n\t\tif (ecdsa[i] != NULL)\n\t\t\tEC_KEY_free(ecdsa[i]);\n#endif\n#ifndef OPENSSL_NO_ECDH\n\tfor (i=0; i<EC_NUM; i++)\n\t{\n\t\tif (ecdh_a[i] != NULL)\n\t\t\tEC_KEY_free(ecdh_a[i]);\n\t\tif (ecdh_b[i] != NULL)\n\t\t\tEC_KEY_free(ecdh_b[i]);\n\t}\n#endif\n\tapps_shutdown();\n\tOPENSSL_EXIT(mret);\n\t}', 'int Camellia_set_key(const unsigned char *userKey, const int bits,\n\tCAMELLIA_KEY *key)\n\t{\n#ifdef OPENSSL_FIPS\n\tfips_cipher_abort(Camellia);\n#endif\n\treturn private_Camellia_set_key(userKey, bits, key);\n\t}', 'int private_Camellia_set_key(const unsigned char *userKey, const int bits,\n\tCAMELLIA_KEY *key)\n\t{\n\tif(!userKey || !key)\n\t\treturn -1;\n\tif(bits != 128 && bits != 192 && bits != 256)\n\t\treturn -2;\n\tkey->grand_rounds = Camellia_Ekeygen(bits , userKey, key->u.rd_key);\n\treturn 0;\n\t}', 'int Camellia_Ekeygen(int keyBitLength, const u8 *rawKey, KEY_TABLE_TYPE k)\n\t{\n\tregister u32 s0,s1,s2,s3;\n\tk[0] = s0 = GETU32(rawKey);\n\tk[1] = s1 = GETU32(rawKey+4);\n\tk[2] = s2 = GETU32(rawKey+8);\n\tk[3] = s3 = GETU32(rawKey+12);\n\tif (keyBitLength != 128)\n\t\t{\n\t\tk[8] = s0 = GETU32(rawKey+16);\n\t\tk[9] = s1 = GETU32(rawKey+20);\n\t\tif (keyBitLength == 192)\n\t\t\t{\n\t\t\tk[10] = s2 = ~s0;\n\t\t\tk[11] = s3 = ~s1;\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\tk[10] = s2 = GETU32(rawKey+24);\n\t\t\tk[11] = s3 = GETU32(rawKey+28);\n\t\t\t}\n\t\ts0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];\n\t\t}\n\tCamellia_Feistel(s0,s1,s2,s3,SIGMA+0);\n\tCamellia_Feistel(s2,s3,s0,s1,SIGMA+2);\n\ts0 ^= k[0], s1 ^= k[1], s2 ^= k[2], s3 ^= k[3];\n\tCamellia_Feistel(s0,s1,s2,s3,SIGMA+4);\n\tCamellia_Feistel(s2,s3,s0,s1,SIGMA+6);\n\tif (keyBitLength == 128)\n\t\t{\n\t\tk[ 4] = s0, k[ 5] = s1, k[ 6] = s2, k[ 7] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[24] = s0, k[25] = s1;\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3;\n\t\tRotLeft128(s1,s2,s3,s0,2);\n\t\tk[40] = s1, k[41] = s2, k[42] = s3, k[43] = s0;\n\t\tRotLeft128(s1,s2,s3,s0,17);\n\t\tk[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0;\n\t\ts0 = k[ 0], s1 = k[ 1], s2 = k[ 2], s3 = k[ 3];\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[ 8] = s0, k[ 9] = s1, k[10] = s2, k[11] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,30);\n\t\tk[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[26] = s2, k[27] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,17);\n\t\tk[32] = s0, k[33] = s1, k[34] = s2, k[35] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,17);\n\t\tk[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,17);\n\t\tk[44] = s0, k[45] = s1, k[46] = s2, k[47] = s3;\n\t\treturn 3;\n\t\t}\n\telse\n\t\t{\n\t\tk[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;\n\t\ts0 ^= k[8], s1 ^= k[9], s2 ^=k[10], s3 ^=k[11];\n\t\tCamellia_Feistel(s0,s1,s2,s3,(SIGMA+8));\n\t\tCamellia_Feistel(s2,s3,s0,s1,(SIGMA+10));\n\t\tk[ 4] = s0, k[ 5] = s1, k[ 6] = s2, k[ 7] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,30);\n\t\tk[20] = s0, k[21] = s1, k[22] = s2, k[23] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,30);\n\t\tk[40] = s0, k[41] = s1, k[42] = s2, k[43] = s3;\n\t\tRotLeft128(s1,s2,s3,s0,19);\n\t\tk[64] = s1, k[65] = s2, k[66] = s3, k[67] = s0;\n\t\ts0 = k[ 8], s1 = k[ 9], s2 = k[10], s3 = k[11];\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[ 8] = s0, k[ 9] = s1, k[10] = s2, k[11] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[16] = s0, k[17] = s1, k[18] = s2, k[19] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,30);\n\t\tk[36] = s0, k[37] = s1, k[38] = s2, k[39] = s3;\n\t\tRotLeft128(s1,s2,s3,s0,2);\n\t\tk[52] = s1, k[53] = s2, k[54] = s3, k[55] = s0;\n\t\ts0 = k[12], s1 = k[13], s2 = k[14], s3 = k[15];\n\t\tRotLeft128(s0,s1,s2,s3,15);\n\t\tk[12] = s0, k[13] = s1, k[14] = s2, k[15] = s3;\n\t\tRotLeft128(s0,s1,s2,s3,30);\n\t\tk[28] = s0, k[29] = s1, k[30] = s2, k[31] = s3;\n\t\tk[48] = s1, k[49] = s2, k[50] = s3, k[51] = s0;\n\t\tRotLeft128(s1,s2,s3,s0,17);\n\t\tk[56] = s1, k[57] = s2, k[58] = s3, k[59] = s0;\n\t\ts0 = k[ 0], s1 = k[ 1], s2 = k[ 2], s3 = k[ 3];\n\t\tRotLeft128(s1,s2,s3,s0,13);\n\t\tk[24] = s1, k[25] = s2, k[26] = s3, k[27] = s0;\n\t\tRotLeft128(s1,s2,s3,s0,15);\n\t\tk[32] = s1, k[33] = s2, k[34] = s3, k[35] = s0;\n\t\tRotLeft128(s1,s2,s3,s0,17);\n\t\tk[44] = s1, k[45] = s2, k[46] = s3, k[47] = s0;\n\t\tRotLeft128(s2,s3,s0,s1,2);\n\t\tk[60] = s2, k[61] = s3, k[62] = s0, k[63] = s1;\n\t\treturn 4;\n\t\t}\n\t}']