diff options
| author | kenjiro <> | 2025-12-11 11:01:04 +0000 |
|---|---|---|
| committer | kenjiro <> | 2025-12-11 11:01:04 +0000 |
| commit | 3842e6324fbd7c6b73d77e4ae884e3ef9d099f2e (patch) | |
| tree | 9ba6802bce19e5c4680282a757533b2738c62e5b /src/usr.bin/openssl/speed.c | |
| parent | 2a9ce651b1c5e84f70570a283e2a5ccd1e14eb25 (diff) | |
| download | openbsd-3842e6324fbd7c6b73d77e4ae884e3ef9d099f2e.tar.gz openbsd-3842e6324fbd7c6b73d77e4ae884e3ef9d099f2e.tar.bz2 openbsd-3842e6324fbd7c6b73d77e4ae884e3ef9d099f2e.zip | |
speed: remove unused counters and dead parameters
In the speed implementation, a number of unused variables and
parameters (save_count, c[][], rsa_c, dsa_c, ecdsa_c, ecdh_c, and
the num argument of print_message()/pkey_print_message()) were
still left behind.
These values are no longer referenced and cannot affect the
time-based benchmark logic, so remove them.
Functional behaviour of speed remains unchanged.
ok tb@
Diffstat (limited to 'src/usr.bin/openssl/speed.c')
| -rw-r--r-- | src/usr.bin/openssl/speed.c | 169 |
1 files changed, 77 insertions, 92 deletions
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c index 3e9b4faa9d..7ea6a0cb94 100644 --- a/src/usr.bin/openssl/speed.c +++ b/src/usr.bin/openssl/speed.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: speed.c,v 1.46 2025/05/25 05:05:30 joshua Exp $ */ | 1 | /* $OpenBSD: speed.c,v 1.47 2025/12/11 11:01:04 kenjiro Exp $ */ |
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * | 4 | * |
| @@ -149,10 +149,10 @@ volatile sig_atomic_t run; | |||
| 149 | static int mr = 0; | 149 | static int mr = 0; |
| 150 | static int usertime = 1; | 150 | static int usertime = 1; |
| 151 | 151 | ||
| 152 | static void print_message(const char *s, long num, int length); | 152 | static void print_message(const char *s, int length); |
| 153 | static void | 153 | static void |
| 154 | pkey_print_message(const char *str, const char *str2, | 154 | pkey_print_message(const char *str, const char *str2, |
| 155 | long num, int bits, int sec); | 155 | int bits, int sec); |
| 156 | static void print_result(int alg, int run_no, int count, double time_used); | 156 | static void print_result(int alg, int run_no, int count, double time_used); |
| 157 | static int do_multi(int multi); | 157 | static int do_multi(int multi); |
| 158 | 158 | ||
| @@ -947,7 +947,7 @@ speed_main(int argc, char **argv) | |||
| 947 | unsigned char *buf = NULL, *buf2 = NULL; | 947 | unsigned char *buf = NULL, *buf2 = NULL; |
| 948 | size_t unaligned = 0; | 948 | size_t unaligned = 0; |
| 949 | int mret = 1; | 949 | int mret = 1; |
| 950 | long count = 0, save_count = 0; | 950 | long count = 0; |
| 951 | int i, j, k; | 951 | int i, j, k; |
| 952 | long rsa_count; | 952 | long rsa_count; |
| 953 | unsigned rsa_num; | 953 | unsigned rsa_num; |
| @@ -1016,7 +1016,6 @@ speed_main(int argc, char **argv) | |||
| 1016 | #define D_AES_256_GCM 29 | 1016 | #define D_AES_256_GCM 29 |
| 1017 | #define D_CHACHA20_POLY1305 30 | 1017 | #define D_CHACHA20_POLY1305 30 |
| 1018 | double d = 0.0; | 1018 | double d = 0.0; |
| 1019 | long c[ALGOR_NUM][SIZE_NUM]; | ||
| 1020 | #define R_DSA_512 0 | 1019 | #define R_DSA_512 0 |
| 1021 | #define R_DSA_1024 1 | 1020 | #define R_DSA_1024 1 |
| 1022 | #define R_DSA_2048 2 | 1021 | #define R_DSA_2048 2 |
| @@ -1031,7 +1030,6 @@ speed_main(int argc, char **argv) | |||
| 1031 | #define R_EC_P521 3 | 1030 | #define R_EC_P521 3 |
| 1032 | 1031 | ||
| 1033 | RSA *rsa_key[RSA_NUM]; | 1032 | RSA *rsa_key[RSA_NUM]; |
| 1034 | long rsa_c[RSA_NUM][2]; | ||
| 1035 | static unsigned int rsa_bits[RSA_NUM] = {512, 1024, 2048, 4096}; | 1033 | static unsigned int rsa_bits[RSA_NUM] = {512, 1024, 2048, 4096}; |
| 1036 | static const unsigned char *rsa_data[RSA_NUM] = | 1034 | static const unsigned char *rsa_data[RSA_NUM] = |
| 1037 | {test512, test1024, test2048, test4096}; | 1035 | {test512, test1024, test2048, test4096}; |
| @@ -1039,7 +1037,6 @@ speed_main(int argc, char **argv) | |||
| 1039 | sizeof(test512), sizeof(test1024), | 1037 | sizeof(test512), sizeof(test1024), |
| 1040 | sizeof(test2048), sizeof(test4096)}; | 1038 | sizeof(test2048), sizeof(test4096)}; |
| 1041 | DSA *dsa_key[DSA_NUM]; | 1039 | DSA *dsa_key[DSA_NUM]; |
| 1042 | long dsa_c[DSA_NUM][2]; | ||
| 1043 | static unsigned int dsa_bits[DSA_NUM] = {512, 1024, 2048}; | 1040 | static unsigned int dsa_bits[DSA_NUM] = {512, 1024, 2048}; |
| 1044 | #ifndef OPENSSL_NO_EC | 1041 | #ifndef OPENSSL_NO_EC |
| 1045 | /* | 1042 | /* |
| @@ -1069,14 +1066,12 @@ speed_main(int argc, char **argv) | |||
| 1069 | unsigned char ecdsasig[256]; | 1066 | unsigned char ecdsasig[256]; |
| 1070 | unsigned int ecdsasiglen; | 1067 | unsigned int ecdsasiglen; |
| 1071 | EC_KEY *ecdsa[EC_NUM]; | 1068 | EC_KEY *ecdsa[EC_NUM]; |
| 1072 | long ecdsa_c[EC_NUM][2]; | ||
| 1073 | 1069 | ||
| 1074 | EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM]; | 1070 | EC_KEY *ecdh_a[EC_NUM], *ecdh_b[EC_NUM]; |
| 1075 | unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE]; | 1071 | unsigned char secret_a[MAX_ECDH_SIZE], secret_b[MAX_ECDH_SIZE]; |
| 1076 | int secret_size_a, secret_size_b; | 1072 | int secret_size_a, secret_size_b; |
| 1077 | int ecdh_checks = 0; | 1073 | int ecdh_checks = 0; |
| 1078 | int secret_idx = 0; | 1074 | int secret_idx = 0; |
| 1079 | long ecdh_c[EC_NUM][2]; | ||
| 1080 | 1075 | ||
| 1081 | int rsa_doit[RSA_NUM]; | 1076 | int rsa_doit[RSA_NUM]; |
| 1082 | int dsa_doit[DSA_NUM]; | 1077 | int dsa_doit[DSA_NUM]; |
| @@ -1119,7 +1114,6 @@ speed_main(int argc, char **argv) | |||
| 1119 | BIO_printf(bio_err, "out of memory\n"); | 1114 | BIO_printf(bio_err, "out of memory\n"); |
| 1120 | goto end; | 1115 | goto end; |
| 1121 | } | 1116 | } |
| 1122 | memset(c, 0, sizeof(c)); | ||
| 1123 | memset(DES_iv, 0, sizeof(DES_iv)); | 1117 | memset(DES_iv, 0, sizeof(DES_iv)); |
| 1124 | memset(iv, 0, sizeof(iv)); | 1118 | memset(iv, 0, sizeof(iv)); |
| 1125 | 1119 | ||
| @@ -1569,8 +1563,7 @@ speed_main(int argc, char **argv) | |||
| 1569 | #ifndef OPENSSL_NO_CAST | 1563 | #ifndef OPENSSL_NO_CAST |
| 1570 | CAST_set_key(&cast_ks, 16, key16); | 1564 | CAST_set_key(&cast_ks, 16, key16); |
| 1571 | #endif | 1565 | #endif |
| 1572 | memset(rsa_c, 0, sizeof(rsa_c)); | 1566 | #define COND (run && count<0x7fffffff) |
| 1573 | #define COND(c) (run && count<0x7fffffff) | ||
| 1574 | #define COUNT(d) (count) | 1567 | #define COUNT(d) (count) |
| 1575 | 1568 | ||
| 1576 | memset(&sa, 0, sizeof(sa)); | 1569 | memset(&sa, 0, sizeof(sa)); |
| @@ -1582,9 +1575,9 @@ speed_main(int argc, char **argv) | |||
| 1582 | #ifndef OPENSSL_NO_MD4 | 1575 | #ifndef OPENSSL_NO_MD4 |
| 1583 | if (doit[D_MD4]) { | 1576 | if (doit[D_MD4]) { |
| 1584 | for (j = 0; j < SIZE_NUM; j++) { | 1577 | for (j = 0; j < SIZE_NUM; j++) { |
| 1585 | print_message(names[D_MD4], c[D_MD4][j], lengths[j]); | 1578 | print_message(names[D_MD4], lengths[j]); |
| 1586 | time_f(START); | 1579 | time_f(START); |
| 1587 | for (count = 0, run = 1; COND(c[D_MD4][j]); count++) | 1580 | for (count = 0, run = 1; COND; count++) |
| 1588 | EVP_Digest(&(buf[0]), (unsigned long) lengths[j], md, NULL, EVP_md4(), NULL); | 1581 | EVP_Digest(&(buf[0]), (unsigned long) lengths[j], md, NULL, EVP_md4(), NULL); |
| 1589 | d = time_f(STOP); | 1582 | d = time_f(STOP); |
| 1590 | print_result(D_MD4, j, count, d); | 1583 | print_result(D_MD4, j, count, d); |
| @@ -1595,9 +1588,9 @@ speed_main(int argc, char **argv) | |||
| 1595 | #ifndef OPENSSL_NO_MD5 | 1588 | #ifndef OPENSSL_NO_MD5 |
| 1596 | if (doit[D_MD5]) { | 1589 | if (doit[D_MD5]) { |
| 1597 | for (j = 0; j < SIZE_NUM; j++) { | 1590 | for (j = 0; j < SIZE_NUM; j++) { |
| 1598 | print_message(names[D_MD5], c[D_MD5][j], lengths[j]); | 1591 | print_message(names[D_MD5], lengths[j]); |
| 1599 | time_f(START); | 1592 | time_f(START); |
| 1600 | for (count = 0, run = 1; COND(c[D_MD5][j]); count++) | 1593 | for (count = 0, run = 1; COND; count++) |
| 1601 | EVP_Digest(&(buf[0]), (unsigned long) lengths[j], md, NULL, EVP_get_digestbyname("md5"), NULL); | 1594 | EVP_Digest(&(buf[0]), (unsigned long) lengths[j], md, NULL, EVP_get_digestbyname("md5"), NULL); |
| 1602 | d = time_f(STOP); | 1595 | d = time_f(STOP); |
| 1603 | print_result(D_MD5, j, count, d); | 1596 | print_result(D_MD5, j, count, d); |
| @@ -1618,9 +1611,9 @@ speed_main(int argc, char **argv) | |||
| 1618 | 16, EVP_md5(), NULL); | 1611 | 16, EVP_md5(), NULL); |
| 1619 | 1612 | ||
| 1620 | for (j = 0; j < SIZE_NUM; j++) { | 1613 | for (j = 0; j < SIZE_NUM; j++) { |
| 1621 | print_message(names[D_HMAC], c[D_HMAC][j], lengths[j]); | 1614 | print_message(names[D_HMAC], lengths[j]); |
| 1622 | time_f(START); | 1615 | time_f(START); |
| 1623 | for (count = 0, run = 1; COND(c[D_HMAC][j]); count++) { | 1616 | for (count = 0, run = 1; COND; count++) { |
| 1624 | if (!HMAC_Init_ex(hctx, NULL, 0, NULL, NULL)) { | 1617 | if (!HMAC_Init_ex(hctx, NULL, 0, NULL, NULL)) { |
| 1625 | HMAC_CTX_free(hctx); | 1618 | HMAC_CTX_free(hctx); |
| 1626 | goto end; | 1619 | goto end; |
| @@ -1643,9 +1636,9 @@ speed_main(int argc, char **argv) | |||
| 1643 | #ifndef OPENSSL_NO_SHA | 1636 | #ifndef OPENSSL_NO_SHA |
| 1644 | if (doit[D_SHA1]) { | 1637 | if (doit[D_SHA1]) { |
| 1645 | for (j = 0; j < SIZE_NUM; j++) { | 1638 | for (j = 0; j < SIZE_NUM; j++) { |
| 1646 | print_message(names[D_SHA1], c[D_SHA1][j], lengths[j]); | 1639 | print_message(names[D_SHA1], lengths[j]); |
| 1647 | time_f(START); | 1640 | time_f(START); |
| 1648 | for (count = 0, run = 1; COND(c[D_SHA1][j]); count++) | 1641 | for (count = 0, run = 1; COND; count++) |
| 1649 | EVP_Digest(buf, (unsigned long) lengths[j], md, NULL, EVP_sha1(), NULL); | 1642 | EVP_Digest(buf, (unsigned long) lengths[j], md, NULL, EVP_sha1(), NULL); |
| 1650 | d = time_f(STOP); | 1643 | d = time_f(STOP); |
| 1651 | print_result(D_SHA1, j, count, d); | 1644 | print_result(D_SHA1, j, count, d); |
| @@ -1654,9 +1647,9 @@ speed_main(int argc, char **argv) | |||
| 1654 | #ifndef OPENSSL_NO_SHA256 | 1647 | #ifndef OPENSSL_NO_SHA256 |
| 1655 | if (doit[D_SHA256]) { | 1648 | if (doit[D_SHA256]) { |
| 1656 | for (j = 0; j < SIZE_NUM; j++) { | 1649 | for (j = 0; j < SIZE_NUM; j++) { |
| 1657 | print_message(names[D_SHA256], c[D_SHA256][j], lengths[j]); | 1650 | print_message(names[D_SHA256], lengths[j]); |
| 1658 | time_f(START); | 1651 | time_f(START); |
| 1659 | for (count = 0, run = 1; COND(c[D_SHA256][j]); count++) | 1652 | for (count = 0, run = 1; COND; count++) |
| 1660 | SHA256(buf, lengths[j], md); | 1653 | SHA256(buf, lengths[j], md); |
| 1661 | d = time_f(STOP); | 1654 | d = time_f(STOP); |
| 1662 | print_result(D_SHA256, j, count, d); | 1655 | print_result(D_SHA256, j, count, d); |
| @@ -1667,9 +1660,9 @@ speed_main(int argc, char **argv) | |||
| 1667 | #ifndef OPENSSL_NO_SHA512 | 1660 | #ifndef OPENSSL_NO_SHA512 |
| 1668 | if (doit[D_SHA512]) { | 1661 | if (doit[D_SHA512]) { |
| 1669 | for (j = 0; j < SIZE_NUM; j++) { | 1662 | for (j = 0; j < SIZE_NUM; j++) { |
| 1670 | print_message(names[D_SHA512], c[D_SHA512][j], lengths[j]); | 1663 | print_message(names[D_SHA512], lengths[j]); |
| 1671 | time_f(START); | 1664 | time_f(START); |
| 1672 | for (count = 0, run = 1; COND(c[D_SHA512][j]); count++) | 1665 | for (count = 0, run = 1; COND; count++) |
| 1673 | SHA512(buf, lengths[j], md); | 1666 | SHA512(buf, lengths[j], md); |
| 1674 | d = time_f(STOP); | 1667 | d = time_f(STOP); |
| 1675 | print_result(D_SHA512, j, count, d); | 1668 | print_result(D_SHA512, j, count, d); |
| @@ -1681,9 +1674,9 @@ speed_main(int argc, char **argv) | |||
| 1681 | #ifndef OPENSSL_NO_RIPEMD | 1674 | #ifndef OPENSSL_NO_RIPEMD |
| 1682 | if (doit[D_RMD160]) { | 1675 | if (doit[D_RMD160]) { |
| 1683 | for (j = 0; j < SIZE_NUM; j++) { | 1676 | for (j = 0; j < SIZE_NUM; j++) { |
| 1684 | print_message(names[D_RMD160], c[D_RMD160][j], lengths[j]); | 1677 | print_message(names[D_RMD160], lengths[j]); |
| 1685 | time_f(START); | 1678 | time_f(START); |
| 1686 | for (count = 0, run = 1; COND(c[D_RMD160][j]); count++) | 1679 | for (count = 0, run = 1; COND; count++) |
| 1687 | EVP_Digest(buf, (unsigned long) lengths[j], md, NULL, EVP_ripemd160(), NULL); | 1680 | EVP_Digest(buf, (unsigned long) lengths[j], md, NULL, EVP_ripemd160(), NULL); |
| 1688 | d = time_f(STOP); | 1681 | d = time_f(STOP); |
| 1689 | print_result(D_RMD160, j, count, d); | 1682 | print_result(D_RMD160, j, count, d); |
| @@ -1693,9 +1686,9 @@ speed_main(int argc, char **argv) | |||
| 1693 | #ifndef OPENSSL_NO_RC4 | 1686 | #ifndef OPENSSL_NO_RC4 |
| 1694 | if (doit[D_RC4]) { | 1687 | if (doit[D_RC4]) { |
| 1695 | for (j = 0; j < SIZE_NUM; j++) { | 1688 | for (j = 0; j < SIZE_NUM; j++) { |
| 1696 | print_message(names[D_RC4], c[D_RC4][j], lengths[j]); | 1689 | print_message(names[D_RC4], lengths[j]); |
| 1697 | time_f(START); | 1690 | time_f(START); |
| 1698 | for (count = 0, run = 1; COND(c[D_RC4][j]); count++) | 1691 | for (count = 0, run = 1; COND; count++) |
| 1699 | RC4(&rc4_ks, (unsigned int) lengths[j], | 1692 | RC4(&rc4_ks, (unsigned int) lengths[j], |
| 1700 | buf, buf); | 1693 | buf, buf); |
| 1701 | d = time_f(STOP); | 1694 | d = time_f(STOP); |
| @@ -1706,9 +1699,9 @@ speed_main(int argc, char **argv) | |||
| 1706 | #ifndef OPENSSL_NO_DES | 1699 | #ifndef OPENSSL_NO_DES |
| 1707 | if (doit[D_CBC_DES]) { | 1700 | if (doit[D_CBC_DES]) { |
| 1708 | for (j = 0; j < SIZE_NUM; j++) { | 1701 | for (j = 0; j < SIZE_NUM; j++) { |
| 1709 | print_message(names[D_CBC_DES], c[D_CBC_DES][j], lengths[j]); | 1702 | print_message(names[D_CBC_DES], lengths[j]); |
| 1710 | time_f(START); | 1703 | time_f(START); |
| 1711 | for (count = 0, run = 1; COND(c[D_CBC_DES][j]); count++) | 1704 | for (count = 0, run = 1; COND; count++) |
| 1712 | DES_ncbc_encrypt(buf, buf, lengths[j], &sch, | 1705 | DES_ncbc_encrypt(buf, buf, lengths[j], &sch, |
| 1713 | &DES_iv, DES_ENCRYPT); | 1706 | &DES_iv, DES_ENCRYPT); |
| 1714 | d = time_f(STOP); | 1707 | d = time_f(STOP); |
| @@ -1717,9 +1710,9 @@ speed_main(int argc, char **argv) | |||
| 1717 | } | 1710 | } |
| 1718 | if (doit[D_EDE3_DES]) { | 1711 | if (doit[D_EDE3_DES]) { |
| 1719 | for (j = 0; j < SIZE_NUM; j++) { | 1712 | for (j = 0; j < SIZE_NUM; j++) { |
| 1720 | print_message(names[D_EDE3_DES], c[D_EDE3_DES][j], lengths[j]); | 1713 | print_message(names[D_EDE3_DES], lengths[j]); |
| 1721 | time_f(START); | 1714 | time_f(START); |
| 1722 | for (count = 0, run = 1; COND(c[D_EDE3_DES][j]); count++) | 1715 | for (count = 0, run = 1; COND; count++) |
| 1723 | DES_ede3_cbc_encrypt(buf, buf, lengths[j], | 1716 | DES_ede3_cbc_encrypt(buf, buf, lengths[j], |
| 1724 | &sch, &sch2, &sch3, | 1717 | &sch, &sch2, &sch3, |
| 1725 | &DES_iv, DES_ENCRYPT); | 1718 | &DES_iv, DES_ENCRYPT); |
| @@ -1731,9 +1724,9 @@ speed_main(int argc, char **argv) | |||
| 1731 | #ifndef OPENSSL_NO_AES | 1724 | #ifndef OPENSSL_NO_AES |
| 1732 | if (doit[D_CBC_128_AES]) { | 1725 | if (doit[D_CBC_128_AES]) { |
| 1733 | for (j = 0; j < SIZE_NUM; j++) { | 1726 | for (j = 0; j < SIZE_NUM; j++) { |
| 1734 | print_message(names[D_CBC_128_AES], c[D_CBC_128_AES][j], lengths[j]); | 1727 | print_message(names[D_CBC_128_AES], lengths[j]); |
| 1735 | time_f(START); | 1728 | time_f(START); |
| 1736 | for (count = 0, run = 1; COND(c[D_CBC_128_AES][j]); count++) | 1729 | for (count = 0, run = 1; COND; count++) |
| 1737 | AES_cbc_encrypt(buf, buf, | 1730 | AES_cbc_encrypt(buf, buf, |
| 1738 | (unsigned long) lengths[j], &aes_ks1, | 1731 | (unsigned long) lengths[j], &aes_ks1, |
| 1739 | iv, AES_ENCRYPT); | 1732 | iv, AES_ENCRYPT); |
| @@ -1743,9 +1736,9 @@ speed_main(int argc, char **argv) | |||
| 1743 | } | 1736 | } |
| 1744 | if (doit[D_CBC_192_AES]) { | 1737 | if (doit[D_CBC_192_AES]) { |
| 1745 | for (j = 0; j < SIZE_NUM; j++) { | 1738 | for (j = 0; j < SIZE_NUM; j++) { |
| 1746 | print_message(names[D_CBC_192_AES], c[D_CBC_192_AES][j], lengths[j]); | 1739 | print_message(names[D_CBC_192_AES], lengths[j]); |
| 1747 | time_f(START); | 1740 | time_f(START); |
| 1748 | for (count = 0, run = 1; COND(c[D_CBC_192_AES][j]); count++) | 1741 | for (count = 0, run = 1; COND; count++) |
| 1749 | AES_cbc_encrypt(buf, buf, | 1742 | AES_cbc_encrypt(buf, buf, |
| 1750 | (unsigned long) lengths[j], &aes_ks2, | 1743 | (unsigned long) lengths[j], &aes_ks2, |
| 1751 | iv, AES_ENCRYPT); | 1744 | iv, AES_ENCRYPT); |
| @@ -1755,9 +1748,9 @@ speed_main(int argc, char **argv) | |||
| 1755 | } | 1748 | } |
| 1756 | if (doit[D_CBC_256_AES]) { | 1749 | if (doit[D_CBC_256_AES]) { |
| 1757 | for (j = 0; j < SIZE_NUM; j++) { | 1750 | for (j = 0; j < SIZE_NUM; j++) { |
| 1758 | print_message(names[D_CBC_256_AES], c[D_CBC_256_AES][j], lengths[j]); | 1751 | print_message(names[D_CBC_256_AES], lengths[j]); |
| 1759 | time_f(START); | 1752 | time_f(START); |
| 1760 | for (count = 0, run = 1; COND(c[D_CBC_256_AES][j]); count++) | 1753 | for (count = 0, run = 1; COND; count++) |
| 1761 | AES_cbc_encrypt(buf, buf, | 1754 | AES_cbc_encrypt(buf, buf, |
| 1762 | (unsigned long) lengths[j], &aes_ks3, | 1755 | (unsigned long) lengths[j], &aes_ks3, |
| 1763 | iv, AES_ENCRYPT); | 1756 | iv, AES_ENCRYPT); |
| @@ -1767,9 +1760,9 @@ speed_main(int argc, char **argv) | |||
| 1767 | } | 1760 | } |
| 1768 | if (doit[D_IGE_128_AES]) { | 1761 | if (doit[D_IGE_128_AES]) { |
| 1769 | for (j = 0; j < SIZE_NUM; j++) { | 1762 | for (j = 0; j < SIZE_NUM; j++) { |
| 1770 | print_message(names[D_IGE_128_AES], c[D_IGE_128_AES][j], lengths[j]); | 1763 | print_message(names[D_IGE_128_AES], lengths[j]); |
| 1771 | time_f(START); | 1764 | time_f(START); |
| 1772 | for (count = 0, run = 1; COND(c[D_IGE_128_AES][j]); count++) | 1765 | for (count = 0, run = 1; COND; count++) |
| 1773 | AES_ige_encrypt(buf, buf2, | 1766 | AES_ige_encrypt(buf, buf2, |
| 1774 | (unsigned long) lengths[j], &aes_ks1, | 1767 | (unsigned long) lengths[j], &aes_ks1, |
| 1775 | iv, AES_ENCRYPT); | 1768 | iv, AES_ENCRYPT); |
| @@ -1779,9 +1772,9 @@ speed_main(int argc, char **argv) | |||
| 1779 | } | 1772 | } |
| 1780 | if (doit[D_IGE_192_AES]) { | 1773 | if (doit[D_IGE_192_AES]) { |
| 1781 | for (j = 0; j < SIZE_NUM; j++) { | 1774 | for (j = 0; j < SIZE_NUM; j++) { |
| 1782 | print_message(names[D_IGE_192_AES], c[D_IGE_192_AES][j], lengths[j]); | 1775 | print_message(names[D_IGE_192_AES], lengths[j]); |
| 1783 | time_f(START); | 1776 | time_f(START); |
| 1784 | for (count = 0, run = 1; COND(c[D_IGE_192_AES][j]); count++) | 1777 | for (count = 0, run = 1; COND; count++) |
| 1785 | AES_ige_encrypt(buf, buf2, | 1778 | AES_ige_encrypt(buf, buf2, |
| 1786 | (unsigned long) lengths[j], &aes_ks2, | 1779 | (unsigned long) lengths[j], &aes_ks2, |
| 1787 | iv, AES_ENCRYPT); | 1780 | iv, AES_ENCRYPT); |
| @@ -1791,9 +1784,9 @@ speed_main(int argc, char **argv) | |||
| 1791 | } | 1784 | } |
| 1792 | if (doit[D_IGE_256_AES]) { | 1785 | if (doit[D_IGE_256_AES]) { |
| 1793 | for (j = 0; j < SIZE_NUM; j++) { | 1786 | for (j = 0; j < SIZE_NUM; j++) { |
| 1794 | print_message(names[D_IGE_256_AES], c[D_IGE_256_AES][j], lengths[j]); | 1787 | print_message(names[D_IGE_256_AES], lengths[j]); |
| 1795 | time_f(START); | 1788 | time_f(START); |
| 1796 | for (count = 0, run = 1; COND(c[D_IGE_256_AES][j]); count++) | 1789 | for (count = 0, run = 1; COND; count++) |
| 1797 | AES_ige_encrypt(buf, buf2, | 1790 | AES_ige_encrypt(buf, buf2, |
| 1798 | (unsigned long) lengths[j], &aes_ks3, | 1791 | (unsigned long) lengths[j], &aes_ks3, |
| 1799 | iv, AES_ENCRYPT); | 1792 | iv, AES_ENCRYPT); |
| @@ -1806,9 +1799,9 @@ speed_main(int argc, char **argv) | |||
| 1806 | CRYPTO_gcm128_setiv(ctx, (unsigned char *) "0123456789ab", 12); | 1799 | CRYPTO_gcm128_setiv(ctx, (unsigned char *) "0123456789ab", 12); |
| 1807 | 1800 | ||
| 1808 | for (j = 0; j < SIZE_NUM; j++) { | 1801 | for (j = 0; j < SIZE_NUM; j++) { |
| 1809 | print_message(names[D_GHASH], c[D_GHASH][j], lengths[j]); | 1802 | print_message(names[D_GHASH], lengths[j]); |
| 1810 | time_f(START); | 1803 | time_f(START); |
| 1811 | for (count = 0, run = 1; COND(c[D_GHASH][j]); count++) | 1804 | for (count = 0, run = 1; COND; count++) |
| 1812 | CRYPTO_gcm128_aad(ctx, buf, lengths[j]); | 1805 | CRYPTO_gcm128_aad(ctx, buf, lengths[j]); |
| 1813 | d = time_f(STOP); | 1806 | d = time_f(STOP); |
| 1814 | print_result(D_GHASH, j, count, d); | 1807 | print_result(D_GHASH, j, count, d); |
| @@ -1832,9 +1825,9 @@ speed_main(int argc, char **argv) | |||
| 1832 | nonce_len = EVP_AEAD_nonce_length(aead); | 1825 | nonce_len = EVP_AEAD_nonce_length(aead); |
| 1833 | 1826 | ||
| 1834 | for (j = 0; j < SIZE_NUM; j++) { | 1827 | for (j = 0; j < SIZE_NUM; j++) { |
| 1835 | print_message(names[D_AES_128_GCM],c[D_AES_128_GCM][j],lengths[j]); | 1828 | print_message(names[D_AES_128_GCM], lengths[j]); |
| 1836 | time_f(START); | 1829 | time_f(START); |
| 1837 | for (count = 0, run = 1; COND(c[D_AES_128_GCM][j]); count++) | 1830 | for (count = 0, run = 1; COND; count++) |
| 1838 | EVP_AEAD_CTX_seal(ctx, buf, &buf_len, BUFSIZE, nonce, | 1831 | EVP_AEAD_CTX_seal(ctx, buf, &buf_len, BUFSIZE, nonce, |
| 1839 | nonce_len, buf, lengths[j], NULL, 0); | 1832 | nonce_len, buf, lengths[j], NULL, 0); |
| 1840 | d = time_f(STOP); | 1833 | d = time_f(STOP); |
| @@ -1860,9 +1853,9 @@ speed_main(int argc, char **argv) | |||
| 1860 | nonce_len = EVP_AEAD_nonce_length(aead); | 1853 | nonce_len = EVP_AEAD_nonce_length(aead); |
| 1861 | 1854 | ||
| 1862 | for (j = 0; j < SIZE_NUM; j++) { | 1855 | for (j = 0; j < SIZE_NUM; j++) { |
| 1863 | print_message(names[D_AES_256_GCM],c[D_AES_256_GCM][j],lengths[j]); | 1856 | print_message(names[D_AES_256_GCM], lengths[j]); |
| 1864 | time_f(START); | 1857 | time_f(START); |
| 1865 | for (count = 0, run = 1; COND(c[D_AES_256_GCM][j]); count++) | 1858 | for (count = 0, run = 1; COND; count++) |
| 1866 | EVP_AEAD_CTX_seal(ctx, buf, &buf_len, BUFSIZE, nonce, | 1859 | EVP_AEAD_CTX_seal(ctx, buf, &buf_len, BUFSIZE, nonce, |
| 1867 | nonce_len, buf, lengths[j], NULL, 0); | 1860 | nonce_len, buf, lengths[j], NULL, 0); |
| 1868 | d = time_f(STOP); | 1861 | d = time_f(STOP); |
| @@ -1889,10 +1882,9 @@ speed_main(int argc, char **argv) | |||
| 1889 | nonce_len = EVP_AEAD_nonce_length(aead); | 1882 | nonce_len = EVP_AEAD_nonce_length(aead); |
| 1890 | 1883 | ||
| 1891 | for (j = 0; j < SIZE_NUM; j++) { | 1884 | for (j = 0; j < SIZE_NUM; j++) { |
| 1892 | print_message(names[D_CHACHA20_POLY1305], | 1885 | print_message(names[D_CHACHA20_POLY1305], lengths[j]); |
| 1893 | c[D_CHACHA20_POLY1305][j], lengths[j]); | ||
| 1894 | time_f(START); | 1886 | time_f(START); |
| 1895 | for (count = 0, run = 1; COND(c[D_CHACHA20_POLY1305][j]); count++) | 1887 | for (count = 0, run = 1; COND; count++) |
| 1896 | EVP_AEAD_CTX_seal(ctx, buf, &buf_len, BUFSIZE, nonce, | 1888 | EVP_AEAD_CTX_seal(ctx, buf, &buf_len, BUFSIZE, nonce, |
| 1897 | nonce_len, buf, lengths[j], NULL, 0); | 1889 | nonce_len, buf, lengths[j], NULL, 0); |
| 1898 | d = time_f(STOP); | 1890 | d = time_f(STOP); |
| @@ -1904,9 +1896,9 @@ speed_main(int argc, char **argv) | |||
| 1904 | #ifndef OPENSSL_NO_CAMELLIA | 1896 | #ifndef OPENSSL_NO_CAMELLIA |
| 1905 | if (doit[D_CBC_128_CML]) { | 1897 | if (doit[D_CBC_128_CML]) { |
| 1906 | for (j = 0; j < SIZE_NUM; j++) { | 1898 | for (j = 0; j < SIZE_NUM; j++) { |
| 1907 | print_message(names[D_CBC_128_CML], c[D_CBC_128_CML][j], lengths[j]); | 1899 | print_message(names[D_CBC_128_CML], lengths[j]); |
| 1908 | time_f(START); | 1900 | time_f(START); |
| 1909 | for (count = 0, run = 1; COND(c[D_CBC_128_CML][j]); count++) | 1901 | for (count = 0, run = 1; COND; count++) |
| 1910 | Camellia_cbc_encrypt(buf, buf, | 1902 | Camellia_cbc_encrypt(buf, buf, |
| 1911 | (unsigned long) lengths[j], &camellia_ks1, | 1903 | (unsigned long) lengths[j], &camellia_ks1, |
| 1912 | iv, CAMELLIA_ENCRYPT); | 1904 | iv, CAMELLIA_ENCRYPT); |
| @@ -1916,9 +1908,9 @@ speed_main(int argc, char **argv) | |||
| 1916 | } | 1908 | } |
| 1917 | if (doit[D_CBC_192_CML]) { | 1909 | if (doit[D_CBC_192_CML]) { |
| 1918 | for (j = 0; j < SIZE_NUM; j++) { | 1910 | for (j = 0; j < SIZE_NUM; j++) { |
| 1919 | print_message(names[D_CBC_192_CML], c[D_CBC_192_CML][j], lengths[j]); | 1911 | print_message(names[D_CBC_192_CML], lengths[j]); |
| 1920 | time_f(START); | 1912 | time_f(START); |
| 1921 | for (count = 0, run = 1; COND(c[D_CBC_192_CML][j]); count++) | 1913 | for (count = 0, run = 1; COND; count++) |
| 1922 | Camellia_cbc_encrypt(buf, buf, | 1914 | Camellia_cbc_encrypt(buf, buf, |
| 1923 | (unsigned long) lengths[j], &camellia_ks2, | 1915 | (unsigned long) lengths[j], &camellia_ks2, |
| 1924 | iv, CAMELLIA_ENCRYPT); | 1916 | iv, CAMELLIA_ENCRYPT); |
| @@ -1928,9 +1920,9 @@ speed_main(int argc, char **argv) | |||
| 1928 | } | 1920 | } |
| 1929 | if (doit[D_CBC_256_CML]) { | 1921 | if (doit[D_CBC_256_CML]) { |
| 1930 | for (j = 0; j < SIZE_NUM; j++) { | 1922 | for (j = 0; j < SIZE_NUM; j++) { |
| 1931 | print_message(names[D_CBC_256_CML], c[D_CBC_256_CML][j], lengths[j]); | 1923 | print_message(names[D_CBC_256_CML], lengths[j]); |
| 1932 | time_f(START); | 1924 | time_f(START); |
| 1933 | for (count = 0, run = 1; COND(c[D_CBC_256_CML][j]); count++) | 1925 | for (count = 0, run = 1; COND; count++) |
| 1934 | Camellia_cbc_encrypt(buf, buf, | 1926 | Camellia_cbc_encrypt(buf, buf, |
| 1935 | (unsigned long) lengths[j], &camellia_ks3, | 1927 | (unsigned long) lengths[j], &camellia_ks3, |
| 1936 | iv, CAMELLIA_ENCRYPT); | 1928 | iv, CAMELLIA_ENCRYPT); |
| @@ -1942,9 +1934,9 @@ speed_main(int argc, char **argv) | |||
| 1942 | #ifndef OPENSSL_NO_IDEA | 1934 | #ifndef OPENSSL_NO_IDEA |
| 1943 | if (doit[D_CBC_IDEA]) { | 1935 | if (doit[D_CBC_IDEA]) { |
| 1944 | for (j = 0; j < SIZE_NUM; j++) { | 1936 | for (j = 0; j < SIZE_NUM; j++) { |
| 1945 | print_message(names[D_CBC_IDEA], c[D_CBC_IDEA][j], lengths[j]); | 1937 | print_message(names[D_CBC_IDEA], lengths[j]); |
| 1946 | time_f(START); | 1938 | time_f(START); |
| 1947 | for (count = 0, run = 1; COND(c[D_CBC_IDEA][j]); count++) | 1939 | for (count = 0, run = 1; COND; count++) |
| 1948 | idea_cbc_encrypt(buf, buf, | 1940 | idea_cbc_encrypt(buf, buf, |
| 1949 | (unsigned long) lengths[j], &idea_ks, | 1941 | (unsigned long) lengths[j], &idea_ks, |
| 1950 | iv, IDEA_ENCRYPT); | 1942 | iv, IDEA_ENCRYPT); |
| @@ -1956,9 +1948,9 @@ speed_main(int argc, char **argv) | |||
| 1956 | #ifndef OPENSSL_NO_RC2 | 1948 | #ifndef OPENSSL_NO_RC2 |
| 1957 | if (doit[D_CBC_RC2]) { | 1949 | if (doit[D_CBC_RC2]) { |
| 1958 | for (j = 0; j < SIZE_NUM; j++) { | 1950 | for (j = 0; j < SIZE_NUM; j++) { |
| 1959 | print_message(names[D_CBC_RC2], c[D_CBC_RC2][j], lengths[j]); | 1951 | print_message(names[D_CBC_RC2], lengths[j]); |
| 1960 | time_f(START); | 1952 | time_f(START); |
| 1961 | for (count = 0, run = 1; COND(c[D_CBC_RC2][j]); count++) | 1953 | for (count = 0, run = 1; COND; count++) |
| 1962 | RC2_cbc_encrypt(buf, buf, | 1954 | RC2_cbc_encrypt(buf, buf, |
| 1963 | (unsigned long) lengths[j], &rc2_ks, | 1955 | (unsigned long) lengths[j], &rc2_ks, |
| 1964 | iv, RC2_ENCRYPT); | 1956 | iv, RC2_ENCRYPT); |
| @@ -1970,9 +1962,9 @@ speed_main(int argc, char **argv) | |||
| 1970 | #ifndef OPENSSL_NO_BF | 1962 | #ifndef OPENSSL_NO_BF |
| 1971 | if (doit[D_CBC_BF]) { | 1963 | if (doit[D_CBC_BF]) { |
| 1972 | for (j = 0; j < SIZE_NUM; j++) { | 1964 | for (j = 0; j < SIZE_NUM; j++) { |
| 1973 | print_message(names[D_CBC_BF], c[D_CBC_BF][j], lengths[j]); | 1965 | print_message(names[D_CBC_BF], lengths[j]); |
| 1974 | time_f(START); | 1966 | time_f(START); |
| 1975 | for (count = 0, run = 1; COND(c[D_CBC_BF][j]); count++) | 1967 | for (count = 0, run = 1; COND; count++) |
| 1976 | BF_cbc_encrypt(buf, buf, | 1968 | BF_cbc_encrypt(buf, buf, |
| 1977 | (unsigned long) lengths[j], &bf_ks, | 1969 | (unsigned long) lengths[j], &bf_ks, |
| 1978 | iv, BF_ENCRYPT); | 1970 | iv, BF_ENCRYPT); |
| @@ -1984,9 +1976,9 @@ speed_main(int argc, char **argv) | |||
| 1984 | #ifndef OPENSSL_NO_CAST | 1976 | #ifndef OPENSSL_NO_CAST |
| 1985 | if (doit[D_CBC_CAST]) { | 1977 | if (doit[D_CBC_CAST]) { |
| 1986 | for (j = 0; j < SIZE_NUM; j++) { | 1978 | for (j = 0; j < SIZE_NUM; j++) { |
| 1987 | print_message(names[D_CBC_CAST], c[D_CBC_CAST][j], lengths[j]); | 1979 | print_message(names[D_CBC_CAST], lengths[j]); |
| 1988 | time_f(START); | 1980 | time_f(START); |
| 1989 | for (count = 0, run = 1; COND(c[D_CBC_CAST][j]); count++) | 1981 | for (count = 0, run = 1; COND; count++) |
| 1990 | CAST_cbc_encrypt(buf, buf, | 1982 | CAST_cbc_encrypt(buf, buf, |
| 1991 | (unsigned long) lengths[j], &cast_ks, | 1983 | (unsigned long) lengths[j], &cast_ks, |
| 1992 | iv, CAST_ENCRYPT); | 1984 | iv, CAST_ENCRYPT); |
| @@ -2009,8 +2001,7 @@ speed_main(int argc, char **argv) | |||
| 2009 | * optimization here! names[D_EVP] somehow | 2001 | * optimization here! names[D_EVP] somehow |
| 2010 | * becomes NULL | 2002 | * becomes NULL |
| 2011 | */ | 2003 | */ |
| 2012 | print_message(names[D_EVP], save_count, | 2004 | print_message(names[D_EVP], lengths[j]); |
| 2013 | lengths[j]); | ||
| 2014 | 2005 | ||
| 2015 | if ((ctx = EVP_CIPHER_CTX_new()) == NULL) { | 2006 | if ((ctx = EVP_CIPHER_CTX_new()) == NULL) { |
| 2016 | BIO_printf(bio_err, "Failed to " | 2007 | BIO_printf(bio_err, "Failed to " |
| @@ -2025,10 +2016,10 @@ speed_main(int argc, char **argv) | |||
| 2025 | 2016 | ||
| 2026 | time_f(START); | 2017 | time_f(START); |
| 2027 | if (decrypt) | 2018 | if (decrypt) |
| 2028 | for (count = 0, run = 1; COND(save_count * 4 * lengths[0] / lengths[j]); count++) | 2019 | for (count = 0, run = 1; COND; count++) |
| 2029 | EVP_DecryptUpdate(ctx, buf, &outl, buf, lengths[j]); | 2020 | EVP_DecryptUpdate(ctx, buf, &outl, buf, lengths[j]); |
| 2030 | else | 2021 | else |
| 2031 | for (count = 0, run = 1; COND(save_count * 4 * lengths[0] / lengths[j]); count++) | 2022 | for (count = 0, run = 1; COND; count++) |
| 2032 | EVP_EncryptUpdate(ctx, buf, &outl, buf, lengths[j]); | 2023 | EVP_EncryptUpdate(ctx, buf, &outl, buf, lengths[j]); |
| 2033 | if (decrypt) | 2024 | if (decrypt) |
| 2034 | EVP_DecryptFinal_ex(ctx, buf, &outl); | 2025 | EVP_DecryptFinal_ex(ctx, buf, &outl); |
| @@ -2039,11 +2030,10 @@ speed_main(int argc, char **argv) | |||
| 2039 | } | 2030 | } |
| 2040 | if (evp_md) { | 2031 | if (evp_md) { |
| 2041 | names[D_EVP] = OBJ_nid2ln(EVP_MD_type(evp_md)); | 2032 | names[D_EVP] = OBJ_nid2ln(EVP_MD_type(evp_md)); |
| 2042 | print_message(names[D_EVP], save_count, | 2033 | print_message(names[D_EVP], lengths[j]); |
| 2043 | lengths[j]); | ||
| 2044 | 2034 | ||
| 2045 | time_f(START); | 2035 | time_f(START); |
| 2046 | for (count = 0, run = 1; COND(save_count * 4 * lengths[0] / lengths[j]); count++) | 2036 | for (count = 0, run = 1; COND; count++) |
| 2047 | EVP_Digest(buf, lengths[j], &(md[0]), NULL, evp_md, NULL); | 2037 | EVP_Digest(buf, lengths[j], &(md[0]), NULL, evp_md, NULL); |
| 2048 | 2038 | ||
| 2049 | d = time_f(STOP); | 2039 | d = time_f(STOP); |
| @@ -2063,11 +2053,11 @@ speed_main(int argc, char **argv) | |||
| 2063 | rsa_count = 1; | 2053 | rsa_count = 1; |
| 2064 | } else { | 2054 | } else { |
| 2065 | pkey_print_message("private", "rsa", | 2055 | pkey_print_message("private", "rsa", |
| 2066 | rsa_c[j][0], rsa_bits[j], | 2056 | rsa_bits[j], |
| 2067 | RSA_SECONDS); | 2057 | RSA_SECONDS); |
| 2068 | /* RSA_blinding_on(rsa_key[j],NULL); */ | 2058 | /* RSA_blinding_on(rsa_key[j],NULL); */ |
| 2069 | time_f(START); | 2059 | time_f(START); |
| 2070 | for (count = 0, run = 1; COND(rsa_c[j][0]); count++) { | 2060 | for (count = 0, run = 1; COND; count++) { |
| 2071 | ret = RSA_sign(NID_md5_sha1, buf, 36, buf2, | 2061 | ret = RSA_sign(NID_md5_sha1, buf, 36, buf2, |
| 2072 | &rsa_num, rsa_key[j]); | 2062 | &rsa_num, rsa_key[j]); |
| 2073 | if (ret == 0) { | 2063 | if (ret == 0) { |
| @@ -2093,10 +2083,10 @@ speed_main(int argc, char **argv) | |||
| 2093 | rsa_doit[j] = 0; | 2083 | rsa_doit[j] = 0; |
| 2094 | } else { | 2084 | } else { |
| 2095 | pkey_print_message("public", "rsa", | 2085 | pkey_print_message("public", "rsa", |
| 2096 | rsa_c[j][1], rsa_bits[j], | 2086 | rsa_bits[j], |
| 2097 | RSA_SECONDS); | 2087 | RSA_SECONDS); |
| 2098 | time_f(START); | 2088 | time_f(START); |
| 2099 | for (count = 0, run = 1; COND(rsa_c[j][1]); count++) { | 2089 | for (count = 0, run = 1; COND; count++) { |
| 2100 | ret = RSA_verify(NID_md5_sha1, buf, 36, buf2, | 2090 | ret = RSA_verify(NID_md5_sha1, buf, 36, buf2, |
| 2101 | rsa_num, rsa_key[j]); | 2091 | rsa_num, rsa_key[j]); |
| 2102 | if (ret <= 0) { | 2092 | if (ret <= 0) { |
| @@ -2138,10 +2128,10 @@ speed_main(int argc, char **argv) | |||
| 2138 | rsa_count = 1; | 2128 | rsa_count = 1; |
| 2139 | } else { | 2129 | } else { |
| 2140 | pkey_print_message("sign", "dsa", | 2130 | pkey_print_message("sign", "dsa", |
| 2141 | dsa_c[j][0], dsa_bits[j], | 2131 | dsa_bits[j], |
| 2142 | DSA_SECONDS); | 2132 | DSA_SECONDS); |
| 2143 | time_f(START); | 2133 | time_f(START); |
| 2144 | for (count = 0, run = 1; COND(dsa_c[j][0]); count++) { | 2134 | for (count = 0, run = 1; COND; count++) { |
| 2145 | ret = DSA_sign(EVP_PKEY_DSA, buf, 20, buf2, | 2135 | ret = DSA_sign(EVP_PKEY_DSA, buf, 20, buf2, |
| 2146 | &kk, dsa_key[j]); | 2136 | &kk, dsa_key[j]); |
| 2147 | if (ret == 0) { | 2137 | if (ret == 0) { |
| @@ -2168,10 +2158,10 @@ speed_main(int argc, char **argv) | |||
| 2168 | dsa_doit[j] = 0; | 2158 | dsa_doit[j] = 0; |
| 2169 | } else { | 2159 | } else { |
| 2170 | pkey_print_message("verify", "dsa", | 2160 | pkey_print_message("verify", "dsa", |
| 2171 | dsa_c[j][1], dsa_bits[j], | 2161 | dsa_bits[j], |
| 2172 | DSA_SECONDS); | 2162 | DSA_SECONDS); |
| 2173 | time_f(START); | 2163 | time_f(START); |
| 2174 | for (count = 0, run = 1; COND(dsa_c[j][1]); count++) { | 2164 | for (count = 0, run = 1; COND; count++) { |
| 2175 | ret = DSA_verify(EVP_PKEY_DSA, buf, 20, buf2, | 2165 | ret = DSA_verify(EVP_PKEY_DSA, buf, 20, buf2, |
| 2176 | kk, dsa_key[j]); | 2166 | kk, dsa_key[j]); |
| 2177 | if (ret <= 0) { | 2167 | if (ret <= 0) { |
| @@ -2219,13 +2209,11 @@ speed_main(int argc, char **argv) | |||
| 2219 | rsa_count = 1; | 2209 | rsa_count = 1; |
| 2220 | } else { | 2210 | } else { |
| 2221 | pkey_print_message("sign", "ecdsa", | 2211 | pkey_print_message("sign", "ecdsa", |
| 2222 | ecdsa_c[j][0], | ||
| 2223 | test_curves_bits[j], | 2212 | test_curves_bits[j], |
| 2224 | ECDSA_SECONDS); | 2213 | ECDSA_SECONDS); |
| 2225 | 2214 | ||
| 2226 | time_f(START); | 2215 | time_f(START); |
| 2227 | for (count = 0, run = 1; COND(ecdsa_c[j][0]); | 2216 | for (count = 0, run = 1; COND; count++) { |
| 2228 | count++) { | ||
| 2229 | ret = ECDSA_sign(0, buf, 20, | 2217 | ret = ECDSA_sign(0, buf, 20, |
| 2230 | ecdsasig, &ecdsasiglen, | 2218 | ecdsasig, &ecdsasiglen, |
| 2231 | ecdsa[j]); | 2219 | ecdsa[j]); |
| @@ -2254,11 +2242,10 @@ speed_main(int argc, char **argv) | |||
| 2254 | ecdsa_doit[j] = 0; | 2242 | ecdsa_doit[j] = 0; |
| 2255 | } else { | 2243 | } else { |
| 2256 | pkey_print_message("verify", "ecdsa", | 2244 | pkey_print_message("verify", "ecdsa", |
| 2257 | ecdsa_c[j][1], | ||
| 2258 | test_curves_bits[j], | 2245 | test_curves_bits[j], |
| 2259 | ECDSA_SECONDS); | 2246 | ECDSA_SECONDS); |
| 2260 | time_f(START); | 2247 | time_f(START); |
| 2261 | for (count = 0, run = 1; COND(ecdsa_c[j][1]); count++) { | 2248 | for (count = 0, run = 1; COND; count++) { |
| 2262 | ret = ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]); | 2249 | ret = ECDSA_verify(0, buf, 20, ecdsasig, ecdsasiglen, ecdsa[j]); |
| 2263 | if (ret != 1) { | 2250 | if (ret != 1) { |
| 2264 | BIO_printf(bio_err, "ECDSA verify failure\n"); | 2251 | BIO_printf(bio_err, "ECDSA verify failure\n"); |
| @@ -2341,12 +2328,10 @@ speed_main(int argc, char **argv) | |||
| 2341 | rsa_count = 1; | 2328 | rsa_count = 1; |
| 2342 | } else { | 2329 | } else { |
| 2343 | pkey_print_message("", "ecdh", | 2330 | pkey_print_message("", "ecdh", |
| 2344 | ecdh_c[j][0], | ||
| 2345 | test_curves_bits[j], | 2331 | test_curves_bits[j], |
| 2346 | ECDH_SECONDS); | 2332 | ECDH_SECONDS); |
| 2347 | time_f(START); | 2333 | time_f(START); |
| 2348 | for (count = 0, run = 1; | 2334 | for (count = 0, run = 1; COND; count++) { |
| 2349 | COND(ecdh_c[j][0]); count++) { | ||
| 2350 | ECDH_compute_key(secret_a, | 2335 | ECDH_compute_key(secret_a, |
| 2351 | outlen, | 2336 | outlen, |
| 2352 | EC_KEY_get0_public_key(ecdh_b[j]), | 2337 | EC_KEY_get0_public_key(ecdh_b[j]), |
| @@ -2505,7 +2490,7 @@ show_res: | |||
| 2505 | } | 2490 | } |
| 2506 | 2491 | ||
| 2507 | static void | 2492 | static void |
| 2508 | print_message(const char *s, long num, int length) | 2493 | print_message(const char *s, int length) |
| 2509 | { | 2494 | { |
| 2510 | BIO_printf(bio_err, mr ? "+DT:%s:%d:%d\n" | 2495 | BIO_printf(bio_err, mr ? "+DT:%s:%d:%d\n" |
| 2511 | : "Doing %s for %ds on %d size blocks: ", s, SECONDS, length); | 2496 | : "Doing %s for %ds on %d size blocks: ", s, SECONDS, length); |
| @@ -2514,7 +2499,7 @@ print_message(const char *s, long num, int length) | |||
| 2514 | } | 2499 | } |
| 2515 | 2500 | ||
| 2516 | static void | 2501 | static void |
| 2517 | pkey_print_message(const char *str, const char *str2, long num, | 2502 | pkey_print_message(const char *str, const char *str2, |
| 2518 | int bits, int tm) | 2503 | int bits, int tm) |
| 2519 | { | 2504 | { |
| 2520 | BIO_printf(bio_err, mr ? "+DTP:%d:%s:%s:%d\n" | 2505 | BIO_printf(bio_err, mr ? "+DTP:%d:%s:%s:%d\n" |
