projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove ecdh.h header
[openssl.git]
/
apps
/
speed.c
diff --git
a/apps/speed.c
b/apps/speed.c
index 297ea521e3e8807bdb51a2c5a7bdb6ba72543c19..4c1ad845a3be9d23eea5c38d8d1701e5143c4adb 100644
(file)
--- a/
apps/speed.c
+++ b/
apps/speed.c
@@
-169,7
+169,6
@@
#endif
#ifndef OPENSSL_NO_EC
# include <openssl/ecdsa.h>
#endif
#ifndef OPENSSL_NO_EC
# include <openssl/ecdsa.h>
-# include <openssl/ecdh.h>
#endif
#include <openssl/modes.h>
#endif
#include <openssl/modes.h>
@@
-297,9
+296,9
@@
static double Time_F(int s)
schlock = 0;
thr = CreateThread(NULL, 4096, sleepy, NULL, 0, NULL);
if (thr == NULL) {
schlock = 0;
thr = CreateThread(NULL, 4096, sleepy, NULL, 0, NULL);
if (thr == NULL) {
- DWORD
ret
= GetLastError();
- BIO_printf(bio_err, "unable to CreateThread (%
d)", ret
);
- ExitProcess(
ret
);
+ DWORD
err
= GetLastError();
+ BIO_printf(bio_err, "unable to CreateThread (%
lu)", err
);
+ ExitProcess(
err
);
}
while (!schlock)
Sleep(0); /* scheduler spinlock */
}
while (!schlock)
Sleep(0); /* scheduler spinlock */
@@
-405,7
+404,7
@@
OPTIONS speed_options[] = {
#define D_IGE_192_AES 27
#define D_IGE_256_AES 28
#define D_GHASH 29
#define D_IGE_192_AES 27
#define D_IGE_256_AES 28
#define D_GHASH 29
-OPT_PAIR doit_choices[] = {
+
static
OPT_PAIR doit_choices[] = {
#ifndef OPENSSL_NO_MD2
{"md2", D_MD2},
#endif
#ifndef OPENSSL_NO_MD2
{"md2", D_MD2},
#endif
@@
-521,7
+520,7
@@
static OPT_PAIR rsa_choices[] = {
#define R_EC_B283 13
#define R_EC_B409 14
#define R_EC_B571 15
#define R_EC_B283 13
#define R_EC_B409 14
#define R_EC_B571 15
-#ifndef OPENSSL_NO_EC
A
+#ifndef OPENSSL_NO_EC
static OPT_PAIR ecdsa_choices[] = {
{"ecdsap160", R_EC_P160},
{"ecdsap192", R_EC_P192},
static OPT_PAIR ecdsa_choices[] = {
{"ecdsap160", R_EC_P160},
{"ecdsap192", R_EC_P192},
@@
-850,9
+849,6
@@
int speed_main(int argc, char **argv)
argc = opt_num_rest();
argv = opt_rest();
argc = opt_num_rest();
argv = opt_rest();
- if (!app_load_modules(NULL))
- goto end;
-
/* Remaining arguments are algorithms. */
for ( ; *argv; argv++) {
if (found(*argv, doit_choices, &i)) {
/* Remaining arguments are algorithms. */
for ( ; *argv; argv++) {
if (found(*argv, doit_choices, &i)) {
@@
-872,7
+868,7
@@
int speed_main(int argc, char **argv)
#ifndef OPENSSL_NO_RSA
# ifndef RSA_NULL
if (strcmp(*argv, "openssl") == 0) {
#ifndef OPENSSL_NO_RSA
# ifndef RSA_NULL
if (strcmp(*argv, "openssl") == 0) {
- RSA_set_default_method(RSA_PKCS1_
SSLeay
());
+ RSA_set_default_method(RSA_PKCS1_
OpenSSL
());
continue;
}
# endif
continue;
}
# endif
@@
-1301,24
+1297,28
@@
int speed_main(int argc, char **argv)
#if !defined(OPENSSL_NO_MD5)
if (doit[D_HMAC]) {
#if !defined(OPENSSL_NO_MD5)
if (doit[D_HMAC]) {
- HMAC_CTX
hctx
;
+ HMAC_CTX
*hctx = NULL
;
- HMAC_CTX_init(&hctx);
- HMAC_Init_ex(&hctx, (unsigned char *)"This is a key...",
+ hctx = HMAC_CTX_new();
+ if (hctx == NULL) {
+ BIO_printf(bio_err, "HMAC malloc failure, exiting...");
+ exit(1);
+ }
+ HMAC_Init_ex(hctx, (unsigned char *)"This is a key...",
16, EVP_md5(), NULL);
for (j = 0; j < SIZE_NUM; j++) {
print_message(names[D_HMAC], c[D_HMAC][j], lengths[j]);
Time_F(START);
for (count = 0, run = 1; COND(c[D_HMAC][j]); count++) {
16, EVP_md5(), NULL);
for (j = 0; j < SIZE_NUM; j++) {
print_message(names[D_HMAC], c[D_HMAC][j], lengths[j]);
Time_F(START);
for (count = 0, run = 1; COND(c[D_HMAC][j]); count++) {
- HMAC_Init_ex(
&
hctx, NULL, 0, NULL, NULL);
- HMAC_Update(
&
hctx, buf, lengths[j]);
- HMAC_Final(
&
hctx, &(hmac[0]), NULL);
+ HMAC_Init_ex(hctx, NULL, 0, NULL, NULL);
+ HMAC_Update(hctx, buf, lengths[j]);
+ HMAC_Final(hctx, &(hmac[0]), NULL);
}
d = Time_F(STOP);
print_result(D_HMAC, j, count, d);
}
}
d = Time_F(STOP);
print_result(D_HMAC, j, count, d);
}
- HMAC_CTX_
cleanup(&
hctx);
+ HMAC_CTX_
free(
hctx);
}
#endif
if (doit[D_SHA1]) {
}
#endif
if (doit[D_SHA1]) {
@@
-1690,7
+1690,7
@@
int speed_main(int argc, char **argv)
EVP_CIPHER_CTX_cleanup(&ctx);
}
if (evp_md) {
EVP_CIPHER_CTX_cleanup(&ctx);
}
if (evp_md) {
- names[D_EVP] = OBJ_nid2ln(
evp_md->type
);
+ names[D_EVP] = OBJ_nid2ln(
EVP_MD_type(evp_md)
);
print_message(names[D_EVP], save_count, lengths[j]);
Time_F(START);
print_message(names[D_EVP], save_count, lengths[j]);
Time_F(START);
@@
-2044,8
+2044,8
@@
int speed_main(int argc, char **argv)
show_res:
#endif
if (!mr) {
show_res:
#endif
if (!mr) {
- printf("%s\n",
SSLeay_version(SSLEAY
_VERSION));
- printf("%s\n",
SSLeay_version(SSLEAY
_BUILT_ON));
+ printf("%s\n",
OpenSSL_version(OPENSSL
_VERSION));
+ printf("%s\n",
OpenSSL_version(OPENSSL
_BUILT_ON));
printf("options:");
printf("%s ", BN_options());
#ifndef OPENSSL_NO_MD2
printf("options:");
printf("%s ", BN_options());
#ifndef OPENSSL_NO_MD2
@@
-2066,7
+2066,7
@@
int speed_main(int argc, char **argv)
#ifndef OPENSSL_NO_BF
printf("%s ", BF_options());
#endif
#ifndef OPENSSL_NO_BF
printf("%s ", BF_options());
#endif
- printf("\n%s\n",
SSLeay_version(SSLEAY
_CFLAGS));
+ printf("\n%s\n",
OpenSSL_version(OPENSSL
_CFLAGS));
}
if (pr_header) {
}
if (pr_header) {