Lines Matching defs:testnum
634 static unsigned int testnum;
647 for (count = 0; COND(c[D_MD2][testnum]); count++) {
648 if (!EVP_Digest(buf, (size_t)lengths[testnum], md2, NULL, EVP_md2(),
664 for (count = 0; COND(c[D_MDC2][testnum]); count++) {
665 if (!EVP_Digest(buf, (size_t)lengths[testnum], mdc2, NULL, EVP_mdc2(),
681 for (count = 0; COND(c[D_MD4][testnum]); count++) {
682 if (!EVP_Digest(buf, (size_t)lengths[testnum], md4, NULL, EVP_md4(),
697 for (count = 0; COND(c[D_MD5][testnum]); count++)
698 MD5(buf, lengths[testnum], md5);
710 for (count = 0; COND(c[D_HMAC][testnum]); count++) {
712 HMAC_Update(hctx, buf, lengths[testnum]);
725 for (count = 0; COND(c[D_SHA1][testnum]); count++)
726 SHA1(buf, lengths[testnum], sha);
736 for (count = 0; COND(c[D_SHA256][testnum]); count++)
737 SHA256(buf, lengths[testnum], sha256);
747 for (count = 0; COND(c[D_SHA512][testnum]); count++)
748 SHA512(buf, lengths[testnum], sha512);
759 for (count = 0; COND(c[D_WHIRLPOOL][testnum]); count++)
760 WHIRLPOOL(buf, lengths[testnum], whirlpool);
772 for (count = 0; COND(c[D_RMD160][testnum]); count++) {
773 if (!EVP_Digest(buf, (size_t)lengths[testnum], &(rmd160[0]),
788 for (count = 0; COND(c[D_RC4][testnum]); count++)
789 RC4(&rc4_ks, (size_t)lengths[testnum], buf, buf);
804 for (count = 0; COND(c[D_CBC_DES][testnum]); count++)
805 DES_ncbc_encrypt(buf, buf, lengths[testnum], &sch,
815 for (count = 0; COND(c[D_EDE3_DES][testnum]); count++)
816 DES_ede3_cbc_encrypt(buf, buf, lengths[testnum],
831 for (count = 0; COND(c[D_CBC_128_AES][testnum]); count++)
833 (size_t)lengths[testnum], &aes_ks1, iv, AES_ENCRYPT);
842 for (count = 0; COND(c[D_CBC_192_AES][testnum]); count++)
844 (size_t)lengths[testnum], &aes_ks2, iv, AES_ENCRYPT);
853 for (count = 0; COND(c[D_CBC_256_AES][testnum]); count++)
855 (size_t)lengths[testnum], &aes_ks3, iv, AES_ENCRYPT);
865 for (count = 0; COND(c[D_IGE_128_AES][testnum]); count++)
867 (size_t)lengths[testnum], &aes_ks1, iv, AES_ENCRYPT);
877 for (count = 0; COND(c[D_IGE_192_AES][testnum]); count++)
879 (size_t)lengths[testnum], &aes_ks2, iv, AES_ENCRYPT);
889 for (count = 0; COND(c[D_IGE_256_AES][testnum]); count++)
891 (size_t)lengths[testnum], &aes_ks3, iv, AES_ENCRYPT);
901 for (count = 0; COND(c[D_GHASH][testnum]); count++)
902 CRYPTO_gcm128_aad(gcm_ctx, buf, lengths[testnum]);
912 for (count = 0; COND(c[D_RAND][testnum]); count++)
913 RAND_bytes(buf, lengths[testnum]);
926 int nb_iter = save_count * 4 * lengths[0] / lengths[testnum];
930 rc = EVP_DecryptUpdate(ctx, buf, &outl, buf, lengths[testnum]);
938 rc = EVP_EncryptUpdate(ctx, buf, &outl, buf, lengths[testnum]);
965 int nb_iter = save_count * 4 * lengths[0] / lengths[testnum];
973 EVP_DecryptUpdate(ctx, buf, &outl, buf, lengths[testnum]);
978 EVP_EncryptUpdate(ctx, NULL, &outl, NULL, lengths[testnum]);
980 EVP_EncryptUpdate(ctx, buf, &outl, buf, lengths[testnum]);
1004 int nb_iter = save_count * 4 * lengths[0] / lengths[testnum];
1012 EVP_DecryptUpdate(ctx, buf, &outl, buf, lengths[testnum]);
1019 EVP_EncryptUpdate(ctx, buf, &outl, buf, lengths[testnum]);
1034 int nb_iter = save_count * 4 * lengths[0] / lengths[testnum];
1038 if (!EVP_Digest(buf, lengths[testnum], md, NULL, evp_md, NULL))
1055 for (count = 0; COND(rsa_c[testnum][0]); count++) {
1056 ret = RSA_sign(NID_md5_sha1, buf, 36, buf2, rsa_num, rsa_key[testnum]);
1075 for (count = 0; COND(rsa_c[testnum][1]); count++) {
1077 RSA_verify(NID_md5_sha1, buf, 36, buf2, rsa_num, rsa_key[testnum]);
1099 for (count = 0; COND(dsa_c[testnum][0]); count++) {
1100 ret = DSA_sign(0, buf, 20, buf2, siglen, dsa_key[testnum]);
1119 for (count = 0; COND(dsa_c[testnum][1]); count++) {
1120 ret = DSA_verify(0, buf, 20, buf2, siglen, dsa_key[testnum]);
1142 for (count = 0; COND(ecdsa_c[testnum][0]); count++) {
1143 ret = ECDSA_sign(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[testnum]);
1162 for (count = 0; COND(ecdsa_c[testnum][1]); count++) {
1163 ret = ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[testnum]);
1180 EVP_PKEY_CTX *ctx = tempargs->ecdh_ctx[testnum];
1183 size_t *outlen = &(tempargs->outlen[testnum]);
1185 for (count = 0; COND(ecdh_c[testnum][0]); count++)
1201 for (count = 0; COND(eddsa_c[testnum][0]); count++) {
1202 ret = EVP_DigestSign(edctx[testnum], eddsasig, eddsasigsize, buf, 20);
1222 for (count = 0; COND(eddsa_c[testnum][1]); count++) {
1223 ret = EVP_DigestVerify(edctx[testnum], eddsasig, eddsasigsize, buf, 20);
2150 for (testnum = 0; testnum < size_num; testnum++) {
2151 print_message(names[D_MD2], c[D_MD2][testnum], lengths[testnum],
2156 print_result(D_MD2, testnum, count, d);
2162 for (testnum = 0; testnum < size_num; testnum++) {
2163 print_message(names[D_MDC2], c[D_MDC2][testnum], lengths[testnum],
2168 print_result(D_MDC2, testnum, count, d);
2175 for (testnum = 0; testnum < size_num; testnum++) {
2176 print_message(names[D_MD4], c[D_MD4][testnum], lengths[testnum],
2181 print_result(D_MD4, testnum, count, d);
2188 for (testnum = 0; testnum < size_num; testnum++) {
2189 print_message(names[D_MD5], c[D_MD5][testnum], lengths[testnum],
2194 print_result(D_MD5, testnum, count, d);
2211 for (testnum = 0; testnum < size_num; testnum++) {
2212 print_message(names[D_HMAC], c[D_HMAC][testnum], lengths[testnum],
2217 print_result(D_HMAC, testnum, count, d);
2225 for (testnum = 0; testnum < size_num; testnum++) {
2226 print_message(names[D_SHA1], c[D_SHA1][testnum], lengths[testnum],
2231 print_result(D_SHA1, testnum, count, d);
2235 for (testnum = 0; testnum < size_num; testnum++) {
2236 print_message(names[D_SHA256], c[D_SHA256][testnum],
2237 lengths[testnum], seconds.sym);
2241 print_result(D_SHA256, testnum, count, d);
2245 for (testnum = 0; testnum < size_num; testnum++) {
2246 print_message(names[D_SHA512], c[D_SHA512][testnum],
2247 lengths[testnum], seconds.sym);
2251 print_result(D_SHA512, testnum, count, d);
2256 for (testnum = 0; testnum < size_num; testnum++) {
2257 print_message(names[D_WHIRLPOOL], c[D_WHIRLPOOL][testnum],
2258 lengths[testnum], seconds.sym);
2262 print_result(D_WHIRLPOOL, testnum, count, d);
2269 for (testnum = 0; testnum < size_num; testnum++) {
2270 print_message(names[D_RMD160], c[D_RMD160][testnum],
2271 lengths[testnum], seconds.sym);
2275 print_result(D_RMD160, testnum, count, d);
2281 for (testnum = 0; testnum < size_num; testnum++) {
2282 print_message(names[D_RC4], c[D_RC4][testnum], lengths[testnum],
2287 print_result(D_RC4, testnum, count, d);
2293 for (testnum = 0; testnum < size_num; testnum++) {
2294 print_message(names[D_CBC_DES], c[D_CBC_DES][testnum],
2295 lengths[testnum], seconds.sym);
2299 print_result(D_CBC_DES, testnum, count, d);
2304 for (testnum = 0; testnum < size_num; testnum++) {
2305 print_message(names[D_EDE3_DES], c[D_EDE3_DES][testnum],
2306 lengths[testnum], seconds.sym);
2311 print_result(D_EDE3_DES, testnum, count, d);
2317 for (testnum = 0; testnum < size_num; testnum++) {
2318 print_message(names[D_CBC_128_AES], c[D_CBC_128_AES][testnum],
2319 lengths[testnum], seconds.sym);
2324 print_result(D_CBC_128_AES, testnum, count, d);
2328 for (testnum = 0; testnum < size_num; testnum++) {
2329 print_message(names[D_CBC_192_AES], c[D_CBC_192_AES][testnum],
2330 lengths[testnum], seconds.sym);
2335 print_result(D_CBC_192_AES, testnum, count, d);
2339 for (testnum = 0; testnum < size_num; testnum++) {
2340 print_message(names[D_CBC_256_AES], c[D_CBC_256_AES][testnum],
2341 lengths[testnum], seconds.sym);
2346 print_result(D_CBC_256_AES, testnum, count, d);
2351 for (testnum = 0; testnum < size_num; testnum++) {
2352 print_message(names[D_IGE_128_AES], c[D_IGE_128_AES][testnum],
2353 lengths[testnum], seconds.sym);
2358 print_result(D_IGE_128_AES, testnum, count, d);
2362 for (testnum = 0; testnum < size_num; testnum++) {
2363 print_message(names[D_IGE_192_AES], c[D_IGE_192_AES][testnum],
2364 lengths[testnum], seconds.sym);
2369 print_result(D_IGE_192_AES, testnum, count, d);
2373 for (testnum = 0; testnum < size_num; testnum++) {
2374 print_message(names[D_IGE_256_AES], c[D_IGE_256_AES][testnum],
2375 lengths[testnum], seconds.sym);
2380 print_result(D_IGE_256_AES, testnum, count, d);
2391 for (testnum = 0; testnum < size_num; testnum++) {
2392 print_message(names[D_GHASH], c[D_GHASH][testnum],
2393 lengths[testnum], seconds.sym);
2397 print_result(D_GHASH, testnum, count, d);
2409 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2410 print_message(names[D_CBC_128_CML], c[D_CBC_128_CML][testnum],
2411 lengths[testnum], seconds.sym);
2413 for (count = 0; COND(c[D_CBC_128_CML][testnum]); count++)
2415 (size_t)lengths[testnum], &camellia_ks1,
2418 print_result(D_CBC_128_CML, testnum, count, d);
2427 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2428 print_message(names[D_CBC_192_CML], c[D_CBC_192_CML][testnum],
2429 lengths[testnum], seconds.sym);
2435 for (count = 0; COND(c[D_CBC_192_CML][testnum]); count++)
2437 (size_t)lengths[testnum], &camellia_ks2,
2440 print_result(D_CBC_192_CML, testnum, count, d);
2449 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2450 print_message(names[D_CBC_256_CML], c[D_CBC_256_CML][testnum],
2451 lengths[testnum], seconds.sym);
2453 for (count = 0; COND(c[D_CBC_256_CML][testnum]); count++)
2455 (size_t)lengths[testnum], &camellia_ks3,
2458 print_result(D_CBC_256_CML, testnum, count, d);
2469 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2470 print_message(names[D_CBC_IDEA], c[D_CBC_IDEA][testnum],
2471 lengths[testnum], seconds.sym);
2473 for (count = 0; COND(c[D_CBC_IDEA][testnum]); count++)
2475 (size_t)lengths[testnum], &idea_ks,
2478 print_result(D_CBC_IDEA, testnum, count, d);
2489 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2490 print_message(names[D_CBC_SEED], c[D_CBC_SEED][testnum],
2491 lengths[testnum], seconds.sym);
2493 for (count = 0; COND(c[D_CBC_SEED][testnum]); count++)
2495 (size_t)lengths[testnum], &seed_ks, iv, 1);
2497 print_result(D_CBC_SEED, testnum, count, d);
2508 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2509 print_message(names[D_CBC_RC2], c[D_CBC_RC2][testnum],
2510 lengths[testnum], seconds.sym);
2516 for (count = 0; COND(c[D_CBC_RC2][testnum]); count++)
2518 (size_t)lengths[testnum], &rc2_ks,
2521 print_result(D_CBC_RC2, testnum, count, d);
2532 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2533 print_message(names[D_CBC_RC5], c[D_CBC_RC5][testnum],
2534 lengths[testnum], seconds.sym);
2540 for (count = 0; COND(c[D_CBC_RC5][testnum]); count++)
2542 (size_t)lengths[testnum], &rc5_ks,
2545 print_result(D_CBC_RC5, testnum, count, d);
2556 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2557 print_message(names[D_CBC_BF], c[D_CBC_BF][testnum],
2558 lengths[testnum], seconds.sym);
2560 for (count = 0; COND(c[D_CBC_BF][testnum]); count++)
2562 (size_t)lengths[testnum], &bf_ks,
2565 print_result(D_CBC_BF, testnum, count, d);
2576 for (testnum = 0; testnum < size_num && async_init == 0; testnum++) {
2577 print_message(names[D_CBC_CAST], c[D_CBC_CAST][testnum],
2578 lengths[testnum], seconds.sym);
2580 for (count = 0; COND(c[D_CBC_CAST][testnum]); count++)
2582 (size_t)lengths[testnum], &cast_ks,
2585 print_result(D_CBC_CAST, testnum, count, d);
2590 for (testnum = 0; testnum < size_num; testnum++) {
2591 print_message(names[D_RAND], c[D_RAND][testnum], lengths[testnum],
2596 print_result(D_RAND, testnum, count, d);
2624 for (testnum = 0; testnum < size_num; testnum++) {
2625 print_message(names[D_EVP], save_count, lengths[testnum],
2661 print_result(D_EVP, testnum, count, d);
2666 for (testnum = 0; testnum < size_num; testnum++) {
2667 print_message(names[D_EVP], save_count, lengths[testnum],
2672 print_result(D_EVP, testnum, count, d);
2682 for (testnum = 0; testnum < RSA_NUM; testnum++) {
2684 if (!rsa_doit[testnum])
2699 rsa_choices[testnum].name);
2701 loopargs[i].rsa_key[testnum] = RSA_new();
2702 if (loopargs[i].rsa_key[testnum] == NULL) {
2707 if (!RSA_generate_multi_prime_key(loopargs[i].rsa_key[testnum],
2708 rsa_bits[testnum],
2716 &loopargs[i].siglen, loopargs[i].rsa_key[testnum]);
2727 rsa_c[testnum][0], rsa_bits[testnum],
2729 /* RSA_blinding_on(rsa_key[testnum],NULL); */
2736 count, rsa_bits[testnum], d);
2737 rsa_results[testnum][0] = (double)count / d;
2743 loopargs[i].siglen, loopargs[i].rsa_key[testnum]);
2751 rsa_doit[testnum] = 0;
2754 rsa_c[testnum][1], rsa_bits[testnum],
2762 count, rsa_bits[testnum], d);
2763 rsa_results[testnum][1] = (double)count / d;
2768 for (testnum++; testnum < RSA_NUM; testnum++)
2769 rsa_doit[testnum] = 0;
2779 for (testnum = 0; testnum < DSA_NUM; testnum++) {
2781 if (!dsa_doit[testnum])
2784 /* DSA_generate_key(dsa_key[testnum]); */
2785 /* DSA_sign_setup(dsa_key[testnum],NULL); */
2788 &loopargs[i].siglen, loopargs[i].dsa_key[testnum]);
2799 dsa_c[testnum][0], dsa_bits[testnum],
2807 count, dsa_bits[testnum], d);
2808 dsa_results[testnum][0] = (double)count / d;
2814 loopargs[i].siglen, loopargs[i].dsa_key[testnum]);
2822 dsa_doit[testnum] = 0;
2825 dsa_c[testnum][1], dsa_bits[testnum],
2833 count, dsa_bits[testnum], d);
2834 dsa_results[testnum][1] = (double)count / d;
2839 for (testnum++; testnum < DSA_NUM; testnum++)
2840 dsa_doit[testnum] = 0;
2846 for (testnum = 0; testnum < ECDSA_NUM; testnum++) {
2849 if (!ecdsa_doit[testnum])
2852 loopargs[i].ecdsa[testnum] =
2853 EC_KEY_new_by_curve_name(test_curves[testnum].nid);
2854 if (loopargs[i].ecdsa[testnum] == NULL) {
2865 EC_KEY_precompute_mult(loopargs[i].ecdsa[testnum], NULL);
2867 EC_KEY_generate_key(loopargs[i].ecdsa[testnum]);
2870 loopargs[i].ecdsa[testnum]);
2881 ecdsa_c[testnum][0],
2882 test_curves[testnum].bits, seconds.ecdsa);
2890 count, test_curves[testnum].bits, d);
2891 ecdsa_results[testnum][0] = (double)count / d;
2899 loopargs[i].ecdsa[testnum]);
2907 ecdsa_doit[testnum] = 0;
2910 ecdsa_c[testnum][1],
2911 test_curves[testnum].bits, seconds.ecdsa);
2918 count, test_curves[testnum].bits, d);
2919 ecdsa_results[testnum][1] = (double)count / d;
2924 for (testnum++; testnum < ECDSA_NUM; testnum++)
2925 ecdsa_doit[testnum] = 0;
2930 for (testnum = 0; testnum < EC_NUM; testnum++) {
2933 if (!ecdh_doit[testnum])
2958 kctx = EVP_PKEY_CTX_new_id(test_curves[testnum].nid, NULL); /* keygen ctx from NID */
2989 [testnum].nid) ||
3058 loopargs[i].ecdh_ctx[testnum] = ctx;
3059 loopargs[i].outlen[testnum] = outlen;
3070 ecdh_c[testnum][0],
3071 test_curves[testnum].bits, seconds.ecdh);
3079 test_curves[testnum].bits, d);
3080 ecdh_results[testnum][0] = (double)count / d;
3086 for (testnum++; testnum < OSSL_NELEM(ecdh_doit); testnum++)
3087 ecdh_doit[testnum] = 0;
3091 for (testnum = 0; testnum < EdDSA_NUM; testnum++) {
3096 if (!eddsa_doit[testnum])
3099 loopargs[i].eddsa_ctx[testnum] = EVP_MD_CTX_new();
3100 if (loopargs[i].eddsa_ctx[testnum] == NULL) {
3105 if ((ed_pctx = EVP_PKEY_CTX_new_id(test_ed_curves[testnum].nid, NULL))
3115 if (!EVP_DigestSignInit(loopargs[i].eddsa_ctx[testnum], NULL, NULL,
3130 loopargs[i].sigsize = test_ed_curves[testnum].sigsize;
3131 st = EVP_DigestSign(loopargs[i].eddsa_ctx[testnum],
3143 pkey_print_message("sign", test_ed_curves[testnum].name,
3144 eddsa_c[testnum][0],
3145 test_ed_curves[testnum].bits, seconds.eddsa);
3153 count, test_ed_curves[testnum].bits,
3154 test_ed_curves[testnum].name, d);
3155 eddsa_results[testnum][0] = (double)count / d;
3161 st = EVP_DigestVerify(loopargs[i].eddsa_ctx[testnum],
3171 eddsa_doit[testnum] = 0;
3173 pkey_print_message("verify", test_ed_curves[testnum].name,
3174 eddsa_c[testnum][1],
3175 test_ed_curves[testnum].bits, seconds.eddsa);
3182 count, test_ed_curves[testnum].bits,
3183 test_ed_curves[testnum].name, d);
3184 eddsa_results[testnum][1] = (double)count / d;
3189 for (testnum++; testnum < EdDSA_NUM; testnum++)
3190 eddsa_doit[testnum] = 0;
3231 for (testnum = 0; testnum < size_num; testnum++)
3232 printf(mr ? ":%d" : "%7d bytes", lengths[testnum]);
3243 for (testnum = 0; testnum < size_num; testnum++) {
3244 if (results[k][testnum] > 10000 && !mr)
3245 printf(" %11.2fk", results[k][testnum] / 1e3);
3247 printf(mr ? ":%.2f" : " %11.2f ", results[k][testnum]);
3252 testnum = 1;
3256 if (testnum && !mr) {
3258 testnum = 0;
3270 testnum = 1;
3274 if (testnum && !mr) {
3276 testnum = 0;
3288 testnum = 1;
3292 if (testnum && !mr) {
3294 testnum = 0;
3308 testnum = 1;
3312 if (testnum && !mr) {
3314 testnum = 0;
3327 testnum = 1;
3331 if (testnum && !mr) {
3333 testnum = 0;