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.c58
1 files changed, 25 insertions, 33 deletions
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c
index cde8f05db7..0254c03062 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.42 2025/05/24 02:03:02 joshua Exp $ */ 1/* $OpenBSD: speed.c,v 1.43 2025/05/24 08:04:21 joshua 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 *
@@ -895,6 +895,28 @@ static const unsigned char test4096[] = {
895 0xaf, 0xf8, 0x2a, 0x91, 0x9d, 0x50, 0x44, 0x21, 0x17, 895 0xaf, 0xf8, 0x2a, 0x91, 0x9d, 0x50, 0x44, 0x21, 0x17,
896}; 896};
897 897
898static const unsigned char key16[] = {
899 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
900 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
901};
902static const unsigned char key24[] = {
903 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
904 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
905 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34,
906};
907static const unsigned char key32[] = {
908 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
909 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
910 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34,
911 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56,
912};
913
914#ifndef OPENSSL_NO_AES
915#define MAX_BLOCK_SIZE 128
916#else
917#define MAX_BLOCK_SIZE 64
918#endif
919
898static void 920static void
899sig_done(int sig) 921sig_done(int sig)
900{ 922{
@@ -958,36 +980,6 @@ speed_main(int argc, char **argv)
958#ifndef OPENSSL_NO_CAST 980#ifndef OPENSSL_NO_CAST
959 CAST_KEY cast_ks; 981 CAST_KEY cast_ks;
960#endif 982#endif
961 static const unsigned char key16[16] =
962 {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
963 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12};
964#ifndef OPENSSL_NO_AES
965 static const unsigned char key24[24] =
966 {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
967 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
968 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34};
969 static const unsigned char key32[32] =
970 {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
971 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
972 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34,
973 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56};
974#endif
975#ifndef OPENSSL_NO_CAMELLIA
976 static const unsigned char ckey24[24] =
977 {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
978 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
979 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34};
980 static const unsigned char ckey32[32] =
981 {0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0,
982 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12,
983 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34,
984 0x78, 0x9a, 0xbc, 0xde, 0xf0, 0x12, 0x34, 0x56};
985#endif
986#ifndef OPENSSL_NO_AES
987#define MAX_BLOCK_SIZE 128
988#else
989#define MAX_BLOCK_SIZE 64
990#endif
991 unsigned char DES_iv[8]; 983 unsigned char DES_iv[8];
992 unsigned char iv[2 * MAX_BLOCK_SIZE / 8]; 984 unsigned char iv[2 * MAX_BLOCK_SIZE / 8];
993#ifndef OPENSSL_NO_DES 985#ifndef OPENSSL_NO_DES
@@ -1581,8 +1573,8 @@ speed_main(int argc, char **argv)
1581#endif 1573#endif
1582#ifndef OPENSSL_NO_CAMELLIA 1574#ifndef OPENSSL_NO_CAMELLIA
1583 Camellia_set_key(key16, 128, &camellia_ks1); 1575 Camellia_set_key(key16, 128, &camellia_ks1);
1584 Camellia_set_key(ckey24, 192, &camellia_ks2); 1576 Camellia_set_key(key24, 192, &camellia_ks2);
1585 Camellia_set_key(ckey32, 256, &camellia_ks3); 1577 Camellia_set_key(key32, 256, &camellia_ks3);
1586#endif 1578#endif
1587#ifndef OPENSSL_NO_IDEA 1579#ifndef OPENSSL_NO_IDEA
1588 idea_set_encrypt_key(key16, &idea_ks); 1580 idea_set_encrypt_key(key16, &idea_ks);