summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-07-20 00:16:45 +0200
committerRich Salz <rsalz@openssl.org>2016-08-01 09:32:03 -0400
commitc5baa26663e2f7cf46248291125b01c9e79cc7ac (patch)
treec0a44af4900ca6cf041a7d290094622523b9a339 /apps
parent19075d58a7e48f7e4d7a8d845e03fc2622ec5654 (diff)
ECDH test is only one operation to run
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1342)
Diffstat (limited to 'apps')
-rw-r--r--apps/speed.c26
1 files changed, 9 insertions, 17 deletions
diff --git a/apps/speed.c b/apps/speed.c
index a1fbc77886..85bb4dbc21 100644
--- a/apps/speed.c
+++ b/apps/speed.c
@@ -1042,7 +1042,8 @@ static void *(*kdf) (const void *in, size_t inlen, void *out,
size_t *xoutlen);
/* ******************************************************************** */
-static long ecdh_c[EC_NUM][2];
+static long ecdh_c[EC_NUM][1];
+
static int ECDH_compute_key_loop(void *args)
{
loopargs_t *tempargs = (loopargs_t *)args;
@@ -1772,7 +1773,7 @@ int speed_main(int argc, char **argv)
if ((dsa_doit[i] <= 1) && (dsa_c[i][0] == 0))
dsa_doit[i] = 0;
else {
- if (dsa_c[i] == 0) {
+ if (dsa_c[i] == 0) { /* Always false */
dsa_c[i][0] = 1;
dsa_c[i][1] = 1;
}
@@ -1789,7 +1790,7 @@ int speed_main(int argc, char **argv)
if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
ecdsa_doit[i] = 0;
else {
- if (ecdsa_c[i] == 0) {
+ if (ecdsa_c[i] == 0) { /* Always false */
ecdsa_c[i][0] = 1;
ecdsa_c[i][1] = 1;
}
@@ -1803,7 +1804,7 @@ int speed_main(int argc, char **argv)
if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
ecdsa_doit[i] = 0;
else {
- if (ecdsa_c[i] == 0) {
+ if (ecdsa_c[i] == 0) { /* Always false */
ecdsa_c[i][0] = 1;
ecdsa_c[i][1] = 1;
}
@@ -1817,7 +1818,7 @@ int speed_main(int argc, char **argv)
if ((ecdsa_doit[i] <= 1) && (ecdsa_c[i][0] == 0))
ecdsa_doit[i] = 0;
else {
- if (ecdsa_c[i] == 0) {
+ if (ecdsa_c[i] == 0) { /* Always false */
ecdsa_c[i][0] = 1;
ecdsa_c[i][1] = 1;
}
@@ -1825,44 +1826,35 @@ int speed_main(int argc, char **argv)
}
ecdh_c[R_EC_P160][0] = count / 1000;
- ecdh_c[R_EC_P160][1] = count / 1000;
for (i = R_EC_P192; i <= R_EC_P521; i++) {
ecdh_c[i][0] = ecdh_c[i - 1][0] / 2;
- ecdh_c[i][1] = ecdh_c[i - 1][1] / 2;
if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
ecdh_doit[i] = 0;
else {
- if (ecdh_c[i] == 0) {
+ if (ecdh_c[i] == 0) { /* always false */
ecdh_c[i][0] = 1;
- ecdh_c[i][1] = 1;
}
}
}
ecdh_c[R_EC_K163][0] = count / 1000;
- ecdh_c[R_EC_K163][1] = count / 1000;
for (i = R_EC_K233; i <= R_EC_K571; i++) {
ecdh_c[i][0] = ecdh_c[i - 1][0] / 2;
- ecdh_c[i][1] = ecdh_c[i - 1][1] / 2;
if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
ecdh_doit[i] = 0;
else {
- if (ecdh_c[i] == 0) {
+ if (ecdh_c[i] == 0) { /* always false */
ecdh_c[i][0] = 1;
- ecdh_c[i][1] = 1;
}
}
}
ecdh_c[R_EC_B163][0] = count / 1000;
- ecdh_c[R_EC_B163][1] = count / 1000;
for (i = R_EC_B233; i <= R_EC_B571; i++) {
ecdh_c[i][0] = ecdh_c[i - 1][0] / 2;
- ecdh_c[i][1] = ecdh_c[i - 1][1] / 2;
if ((ecdh_doit[i] <= 1) && (ecdh_c[i][0] == 0))
ecdh_doit[i] = 0;
else {
- if (ecdh_c[i] == 0) {
+ if (ecdh_c[i] == 0) { /* always false */
ecdh_c[i][0] = 1;
- ecdh_c[i][1] = 1;
}
}
}