summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/speed.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin/openssl/speed.c')
-rw-r--r--src/usr.bin/openssl/speed.c35
1 files changed, 4 insertions, 31 deletions
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c
index a0fa9dcd8b..d9fe3309b7 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.13 2015/09/12 15:49:53 bcook Exp $ */ 1/* $OpenBSD: speed.c,v 1.14 2015/09/13 23:36:21 doug 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 *
@@ -124,9 +124,6 @@
124#ifndef OPENSSL_NO_IDEA 124#ifndef OPENSSL_NO_IDEA
125#include <openssl/idea.h> 125#include <openssl/idea.h>
126#endif 126#endif
127#ifndef OPENSSL_NO_MD4
128#include <openssl/md4.h>
129#endif
130#ifndef OPENSSL_NO_MD5 127#ifndef OPENSSL_NO_MD5
131#include <openssl/md5.h> 128#include <openssl/md5.h>
132#endif 129#endif
@@ -173,7 +170,8 @@ static int do_multi(int multi);
173#define MAX_ECDH_SIZE 256 170#define MAX_ECDH_SIZE 256
174 171
175static const char *names[ALGOR_NUM] = { 172static const char *names[ALGOR_NUM] = {
176 "md2", NULL /* was mdc2 */, "md4", "md5", "hmac(md5)", "sha1", "rmd160", 173 "md2", NULL /* was mdc2 */, NULL /* was md4 */, "md5", "hmac(md5)",
174 "sha1", "rmd160",
177 "rc4", "des cbc", "des ede3", "idea cbc", "seed cbc", 175 "rc4", "des cbc", "des ede3", "idea cbc", "seed cbc",
178 "rc2 cbc", "rc5-32/12 cbc", "blowfish cbc", "cast cbc", 176 "rc2 cbc", "rc5-32/12 cbc", "blowfish cbc", "cast cbc",
179 "aes-128 cbc", "aes-192 cbc", "aes-256 cbc", 177 "aes-128 cbc", "aes-192 cbc", "aes-256 cbc",
@@ -234,9 +232,6 @@ speed_main(int argc, char **argv)
234 long rsa_count; 232 long rsa_count;
235 unsigned rsa_num; 233 unsigned rsa_num;
236 unsigned char md[EVP_MAX_MD_SIZE]; 234 unsigned char md[EVP_MAX_MD_SIZE];
237#ifndef OPENSSL_NO_MD4
238 unsigned char md4[MD4_DIGEST_LENGTH];
239#endif
240#ifndef OPENSSL_NO_MD5 235#ifndef OPENSSL_NO_MD5
241 unsigned char md5[MD5_DIGEST_LENGTH]; 236 unsigned char md5[MD5_DIGEST_LENGTH];
242 unsigned char hmac[MD5_DIGEST_LENGTH]; 237 unsigned char hmac[MD5_DIGEST_LENGTH];
@@ -318,7 +313,6 @@ speed_main(int argc, char **argv)
318 CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3; 313 CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3;
319#endif 314#endif
320#define D_MD2 0 315#define D_MD2 0
321#define D_MD4 2
322#define D_MD5 3 316#define D_MD5 3
323#define D_HMAC 4 317#define D_HMAC 4
324#define D_SHA1 5 318#define D_SHA1 5
@@ -557,11 +551,6 @@ speed_main(int argc, char **argv)
557 j--; /* Otherwise, -mr gets confused with an 551 j--; /* Otherwise, -mr gets confused with an
558 * algorithm. */ 552 * algorithm. */
559 } else 553 } else
560#ifndef OPENSSL_NO_MD4
561 if (strcmp(*argv, "md4") == 0)
562 doit[D_MD4] = 1;
563 else
564#endif
565#ifndef OPENSSL_NO_MD5 554#ifndef OPENSSL_NO_MD5
566 if (strcmp(*argv, "md5") == 0) 555 if (strcmp(*argv, "md5") == 0)
567 doit[D_MD5] = 1; 556 doit[D_MD5] = 1;
@@ -812,9 +801,6 @@ speed_main(int argc, char **argv)
812 BIO_printf(bio_err, "Error: bad option or value\n"); 801 BIO_printf(bio_err, "Error: bad option or value\n");
813 BIO_printf(bio_err, "\n"); 802 BIO_printf(bio_err, "\n");
814 BIO_printf(bio_err, "Available values:\n"); 803 BIO_printf(bio_err, "Available values:\n");
815#ifndef OPENSSL_NO_MD4
816 BIO_printf(bio_err, "md4 ");
817#endif
818#ifndef OPENSSL_NO_MD5 804#ifndef OPENSSL_NO_MD5
819 BIO_printf(bio_err, "md5 "); 805 BIO_printf(bio_err, "md5 ");
820#ifndef OPENSSL_NO_HMAC 806#ifndef OPENSSL_NO_HMAC
@@ -837,7 +823,7 @@ speed_main(int argc, char **argv)
837 BIO_printf(bio_err, "rmd160"); 823 BIO_printf(bio_err, "rmd160");
838#endif 824#endif
839#if !defined(OPENSSL_NO_MD2) || \ 825#if !defined(OPENSSL_NO_MD2) || \
840 !defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \ 826 !defined(OPENSSL_NO_MD5) || \
841 !defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) || \ 827 !defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) || \
842 !defined(OPENSSL_NO_WHIRLPOOL) 828 !defined(OPENSSL_NO_WHIRLPOOL)
843 BIO_printf(bio_err, "\n"); 829 BIO_printf(bio_err, "\n");
@@ -996,19 +982,6 @@ speed_main(int argc, char **argv)
996#define COUNT(d) (count) 982#define COUNT(d) (count)
997 signal(SIGALRM, sig_done); 983 signal(SIGALRM, sig_done);
998 984
999#ifndef OPENSSL_NO_MD4
1000 if (doit[D_MD4]) {
1001 for (j = 0; j < SIZE_NUM; j++) {
1002 print_message(names[D_MD4], c[D_MD4][j], lengths[j]);
1003 Time_F(START);
1004 for (count = 0, run = 1; COND(c[D_MD4][j]); count++)
1005 EVP_Digest(&(buf[0]), (unsigned long) lengths[j], &(md4[0]), NULL, EVP_md4(), NULL);
1006 d = Time_F(STOP);
1007 print_result(D_MD4, j, count, d);
1008 }
1009 }
1010#endif
1011
1012#ifndef OPENSSL_NO_MD5 985#ifndef OPENSSL_NO_MD5
1013 if (doit[D_MD5]) { 986 if (doit[D_MD5]) {
1014 for (j = 0; j < SIZE_NUM; j++) { 987 for (j = 0; j < SIZE_NUM; j++) {