version 1.14, 2015/09/13 23:36:21 |
version 1.15, 2015/09/14 01:45:03 |
|
|
#ifndef OPENSSL_NO_IDEA |
#ifndef OPENSSL_NO_IDEA |
#include <openssl/idea.h> |
#include <openssl/idea.h> |
#endif |
#endif |
|
#ifndef OPENSSL_NO_MD4 |
|
#include <openssl/md4.h> |
|
#endif |
#ifndef OPENSSL_NO_MD5 |
#ifndef OPENSSL_NO_MD5 |
#include <openssl/md5.h> |
#include <openssl/md5.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", NULL /* was mdc2 */, NULL /* was md4 */, "md5", "hmac(md5)", |
"md2", NULL /* was mdc2 */, "md4", "md5", "hmac(md5)", "sha1", "rmd160", |
"sha1", "rmd160", |
|
"rc4", "des cbc", "des ede3", "idea cbc", "seed cbc", |
"rc4", "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_MD4 |
|
unsigned char md4[MD4_DIGEST_LENGTH]; |
|
#endif |
#ifndef OPENSSL_NO_MD5 |
#ifndef OPENSSL_NO_MD5 |
unsigned char md5[MD5_DIGEST_LENGTH]; |
unsigned char md5[MD5_DIGEST_LENGTH]; |
unsigned char hmac[MD5_DIGEST_LENGTH]; |
unsigned char hmac[MD5_DIGEST_LENGTH]; |
|
|
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_MD4 2 |
#define D_MD5 3 |
#define D_MD5 3 |
#define D_HMAC 4 |
#define D_HMAC 4 |
#define D_SHA1 5 |
#define D_SHA1 5 |
|
|
j--; /* Otherwise, -mr gets confused with an |
j--; /* Otherwise, -mr gets confused with an |
* algorithm. */ |
* algorithm. */ |
} else |
} else |
|
#ifndef OPENSSL_NO_MD4 |
|
if (strcmp(*argv, "md4") == 0) |
|
doit[D_MD4] = 1; |
|
else |
|
#endif |
#ifndef OPENSSL_NO_MD5 |
#ifndef OPENSSL_NO_MD5 |
if (strcmp(*argv, "md5") == 0) |
if (strcmp(*argv, "md5") == 0) |
doit[D_MD5] = 1; |
doit[D_MD5] = 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_MD4 |
|
BIO_printf(bio_err, "md4 "); |
|
#endif |
#ifndef OPENSSL_NO_MD5 |
#ifndef OPENSSL_NO_MD5 |
BIO_printf(bio_err, "md5 "); |
BIO_printf(bio_err, "md5 "); |
#ifndef OPENSSL_NO_HMAC |
#ifndef OPENSSL_NO_HMAC |
|
|
BIO_printf(bio_err, "rmd160"); |
BIO_printf(bio_err, "rmd160"); |
#endif |
#endif |
#if !defined(OPENSSL_NO_MD2) || \ |
#if !defined(OPENSSL_NO_MD2) || \ |
!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) |
BIO_printf(bio_err, "\n"); |
BIO_printf(bio_err, "\n"); |
|
|
#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_MD4 |
|
if (doit[D_MD4]) { |
|
for (j = 0; j < SIZE_NUM; j++) { |
|
print_message(names[D_MD4], c[D_MD4][j], lengths[j]); |
|
Time_F(START); |
|
for (count = 0, run = 1; COND(c[D_MD4][j]); count++) |
|
EVP_Digest(&(buf[0]), (unsigned long) lengths[j], &(md4[0]), NULL, EVP_md4(), NULL); |
|
d = Time_F(STOP); |
|
print_result(D_MD4, j, count, d); |
|
} |
|
} |
|
#endif |
|
|
#ifndef OPENSSL_NO_MD5 |
#ifndef OPENSSL_NO_MD5 |
if (doit[D_MD5]) { |
if (doit[D_MD5]) { |