version 1.5, 2015/02/08 10:22:45 |
version 1.6, 2015/06/20 01:07:25 |
|
|
#ifndef OPENSSL_NO_IDEA |
#ifndef OPENSSL_NO_IDEA |
#include <openssl/idea.h> |
#include <openssl/idea.h> |
#endif |
#endif |
#ifndef OPENSSL_NO_MDC2 |
|
#include <openssl/mdc2.h> |
|
#endif |
|
#ifndef OPENSSL_NO_MD4 |
#ifndef OPENSSL_NO_MD4 |
#include <openssl/md4.h> |
#include <openssl/md4.h> |
#endif |
#endif |
|
|
#define MAX_ECDH_SIZE 256 |
#define MAX_ECDH_SIZE 256 |
|
|
static const char *names[ALGOR_NUM] = { |
static const char *names[ALGOR_NUM] = { |
"md2", "mdc2", "md4", "md5", "hmac(md5)", "sha1", "rmd160", "rc4", |
"md2", "md4", "md5", "hmac(md5)", "sha1", "rmd160", "rc4", |
"des cbc", "des ede3", "idea cbc", "seed cbc", |
"des cbc", "des ede3", "idea cbc", "seed cbc", |
"rc2 cbc", "rc5-32/12 cbc", "blowfish cbc", "cast cbc", |
"rc2 cbc", "rc5-32/12 cbc", "blowfish cbc", "cast cbc", |
"aes-128 cbc", "aes-192 cbc", "aes-256 cbc", |
"aes-128 cbc", "aes-192 cbc", "aes-256 cbc", |
|
|
long rsa_count; |
long rsa_count; |
unsigned rsa_num; |
unsigned rsa_num; |
unsigned char md[EVP_MAX_MD_SIZE]; |
unsigned char md[EVP_MAX_MD_SIZE]; |
#ifndef OPENSSL_NO_MDC2 |
|
unsigned char mdc2[MDC2_DIGEST_LENGTH]; |
|
#endif |
|
#ifndef OPENSSL_NO_MD4 |
#ifndef OPENSSL_NO_MD4 |
unsigned char md4[MD4_DIGEST_LENGTH]; |
unsigned char md4[MD4_DIGEST_LENGTH]; |
#endif |
#endif |
|
|
CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3; |
CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3; |
#endif |
#endif |
#define D_MD2 0 |
#define D_MD2 0 |
#define D_MDC2 1 |
|
#define D_MD4 2 |
#define D_MD4 2 |
#define D_MD5 3 |
#define D_MD5 3 |
#define D_HMAC 4 |
#define D_HMAC 4 |
|
|
j--; /* Otherwise, -mr gets confused with an |
j--; /* Otherwise, -mr gets confused with an |
* algorithm. */ |
* algorithm. */ |
} else |
} else |
#ifndef OPENSSL_NO_MDC2 |
|
if (strcmp(*argv, "mdc2") == 0) |
|
doit[D_MDC2] = 1; |
|
else |
|
#endif |
|
#ifndef OPENSSL_NO_MD4 |
#ifndef OPENSSL_NO_MD4 |
if (strcmp(*argv, "md4") == 0) |
if (strcmp(*argv, "md4") == 0) |
doit[D_MD4] = 1; |
doit[D_MD4] = 1; |
|
|
BIO_printf(bio_err, "Error: bad option or value\n"); |
BIO_printf(bio_err, "Error: bad option or value\n"); |
BIO_printf(bio_err, "\n"); |
BIO_printf(bio_err, "\n"); |
BIO_printf(bio_err, "Available values:\n"); |
BIO_printf(bio_err, "Available values:\n"); |
#ifndef OPENSSL_NO_MDC2 |
|
BIO_printf(bio_err, "mdc2 "); |
|
#endif |
|
#ifndef OPENSSL_NO_MD4 |
#ifndef OPENSSL_NO_MD4 |
BIO_printf(bio_err, "md4 "); |
BIO_printf(bio_err, "md4 "); |
#endif |
#endif |
|
|
#ifndef OPENSSL_NO_RIPEMD160 |
#ifndef OPENSSL_NO_RIPEMD160 |
BIO_printf(bio_err, "rmd160"); |
BIO_printf(bio_err, "rmd160"); |
#endif |
#endif |
#if !defined(OPENSSL_NO_MD2) || !defined(OPENSSL_NO_MDC2) || \ |
#if !defined(OPENSSL_NO_MD2) || \ |
!defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \ |
!defined(OPENSSL_NO_MD4) || !defined(OPENSSL_NO_MD5) || \ |
!defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) || \ |
!defined(OPENSSL_NO_SHA1) || !defined(OPENSSL_NO_RIPEMD160) || \ |
!defined(OPENSSL_NO_WHIRLPOOL) |
!defined(OPENSSL_NO_WHIRLPOOL) |
|
|
#define COND(c) (run && count<0x7fffffff) |
#define COND(c) (run && count<0x7fffffff) |
#define COUNT(d) (count) |
#define COUNT(d) (count) |
signal(SIGALRM, sig_done); |
signal(SIGALRM, sig_done); |
|
|
#ifndef OPENSSL_NO_MDC2 |
|
if (doit[D_MDC2]) { |
|
for (j = 0; j < SIZE_NUM; j++) { |
|
print_message(names[D_MDC2], c[D_MDC2][j], lengths[j]); |
|
Time_F(START); |
|
for (count = 0, run = 1; COND(c[D_MDC2][j]); count++) |
|
EVP_Digest(buf, (unsigned long) lengths[j], &(mdc2[0]), NULL, EVP_mdc2(), NULL); |
|
d = Time_F(STOP); |
|
print_result(D_MDC2, j, count, d); |
|
} |
|
} |
|
#endif |
|
|
|
#ifndef OPENSSL_NO_MD4 |
#ifndef OPENSSL_NO_MD4 |
if (doit[D_MD4]) { |
if (doit[D_MD4]) { |