Regen speed.c diff

This commit is contained in:
Theo Buehler 2023-05-21 12:18:07 -06:00
parent 4adafb2616
commit d5556b47c7

View File

@ -1,6 +1,6 @@
--- apps/openssl/speed.c.orig Tue Nov 22 17:32:11 2022 --- apps/openssl/speed.c.orig Sun May 21 12:13:46 2023
+++ apps/openssl/speed.c Tue Nov 22 18:33:13 2022 +++ apps/openssl/speed.c Sun May 21 12:15:49 2023
@@ -159,7 +159,16 @@ static void @@ -161,7 +161,16 @@ static void
pkey_print_message(const char *str, const char *str2, pkey_print_message(const char *str, const char *str2,
long num, int bits, int sec); long num, int bits, int sec);
static void print_result(int alg, int run_no, int count, double time_used); static void print_result(int alg, int run_no, int count, double time_used);
@ -17,7 +17,7 @@
#define ALGOR_NUM 32 #define ALGOR_NUM 32
#define SIZE_NUM 5 #define SIZE_NUM 5
@@ -466,8 +475,10 @@ speed_main(int argc, char **argv) @@ -431,8 +440,10 @@ speed_main(int argc, char **argv)
const EVP_CIPHER *evp_cipher = NULL; const EVP_CIPHER *evp_cipher = NULL;
const EVP_MD *evp_md = NULL; const EVP_MD *evp_md = NULL;
int decrypt = 0; int decrypt = 0;
@ -28,33 +28,33 @@
if (pledge("stdio proc", NULL) == -1) { if (pledge("stdio proc", NULL) == -1) {
perror("pledge"); perror("pledge");
@@ -542,6 +553,7 @@ speed_main(int argc, char **argv) @@ -506,6 +517,7 @@ speed_main(int argc, char **argv)
decrypt = 1;
j--; /* Otherwise, -decrypt gets confused with an j--; /* Otherwise, -decrypt gets confused with an
* algorithm. */ * algorithm. */
}
+#ifndef _WIN32 +#ifndef _WIN32
else if ((argc > 0) && (strcmp(*argv, "-multi") == 0)) { } else if (argc > 0 && strcmp(*argv, "-multi") == 0) {
argc--; argc--;
argv++; argv++;
@@ -557,6 +569,7 @@ speed_main(int argc, char **argv) @@ -520,6 +532,7 @@ speed_main(int argc, char **argv)
}
j--; /* Otherwise, -multi gets confused with an j--; /* Otherwise, -multi gets confused with an
* algorithm. */ * algorithm. */
}
+#endif +#endif
else if (argc > 0 && !strcmp(*argv, "-mr")) { } else if (argc > 0 && strcmp(*argv, "-unaligned") == 0) {
mr = 1; argc--;
j--; /* Otherwise, -mr gets confused with an argv++;
@@ -919,7 +932,9 @@ speed_main(int argc, char **argv) @@ -855,7 +868,9 @@ speed_main(int argc, char **argv)
BIO_printf(bio_err, "-evp e use EVP e.\n"); BIO_printf(bio_err, "-evp e use EVP e.\n");
BIO_printf(bio_err, "-decrypt time decryption instead of encryption (only EVP).\n"); BIO_printf(bio_err, "-decrypt time decryption instead of encryption (only EVP).\n");
BIO_printf(bio_err, "-mr produce machine readable output.\n"); BIO_printf(bio_err, "-mr produce machine readable output.\n");
+#ifndef _WIN32 +#ifndef _WIN32
BIO_printf(bio_err, "-multi n run n benchmarks in parallel.\n"); BIO_printf(bio_err, "-multi n run n benchmarks in parallel.\n");
+#endif +#endif
BIO_printf(bio_err, "-unaligned n use buffers with offset n from proper alignment.\n");
goto end; goto end;
} }
argc--; @@ -864,8 +879,10 @@ speed_main(int argc, char **argv)
@@ -927,8 +942,10 @@ speed_main(int argc, char **argv)
j++; j++;
} }
@ -65,7 +65,7 @@
if (j == 0) { if (j == 0) {
for (i = 0; i < ALGOR_NUM; i++) { for (i = 0; i < ALGOR_NUM; i++) {
@@ -1805,7 +1822,9 @@ speed_main(int argc, char **argv) @@ -1742,7 +1759,9 @@ speed_main(int argc, char **argv)
ecdh_doit[j] = 0; ecdh_doit[j] = 0;
} }
} }
@ -75,7 +75,7 @@
if (!mr) { if (!mr) {
fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION)); fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_VERSION));
fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_BUILT_ON)); fprintf(stdout, "%s\n", SSLeay_version(SSLEAY_BUILT_ON));
@@ -1978,11 +1997,15 @@ pkey_print_message(const char *str, const char *str2, @@ -1915,11 +1934,15 @@ pkey_print_message(const char *str, const char *str2,
static void static void
print_result(int alg, int run_no, int count, double time_used) print_result(int alg, int run_no, int count, double time_used)
{ {
@ -91,7 +91,7 @@
static char * static char *
sstrsep(char **string, const char *delim) sstrsep(char **string, const char *delim)
{ {
@@ -2189,4 +2212,5 @@ do_multi(int multi) @@ -2126,4 +2149,5 @@ do_multi(int multi)
free(fds); free(fds);
return 1; return 1;
} }