summaryrefslogtreecommitdiff
path: root/src/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin')
-rw-r--r--src/usr.bin/openssl/speed.c108
1 files changed, 59 insertions, 49 deletions
diff --git a/src/usr.bin/openssl/speed.c b/src/usr.bin/openssl/speed.c
index 7ea6a0cb94..24b4582804 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.47 2025/12/11 11:01:04 kenjiro Exp $ */ 1/* $OpenBSD: speed.c,v 1.48 2025/12/11 11:28:34 kenjiro 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 *
@@ -156,13 +156,66 @@ pkey_print_message(const char *str, const char *str2,
156static void print_result(int alg, int run_no, int count, double time_used); 156static void print_result(int alg, int run_no, int count, double time_used);
157static int do_multi(int multi); 157static int do_multi(int multi);
158 158
159#define ALGOR_NUM 31
160#define SIZE_NUM 5 159#define SIZE_NUM 5
161#define RSA_NUM 4 160#define MAX_ECDH_SIZE 256
162#define DSA_NUM 3 161
162enum {
163 D_MD2,
164 D_MD4,
165 D_MD5,
166 D_HMAC,
167 D_SHA1,
168 D_RMD160,
169 D_RC4,
170 D_CBC_DES,
171 D_EDE3_DES,
172 D_CBC_IDEA,
173 D_CBC_SEED,
174 D_CBC_RC2,
175 D_CBC_RC5,
176 D_CBC_BF,
177 D_CBC_CAST,
178 D_CBC_128_AES,
179 D_CBC_192_AES,
180 D_CBC_256_AES,
181 D_CBC_128_CML,
182 D_CBC_192_CML,
183 D_CBC_256_CML,
184 D_EVP,
185 D_SHA256,
186 D_SHA512,
187 D_IGE_128_AES,
188 D_IGE_192_AES,
189 D_IGE_256_AES,
190 D_GHASH,
191 D_AES_128_GCM,
192 D_AES_256_GCM,
193 D_CHACHA20_POLY1305,
194 ALGOR_NUM,
195};
196
197enum {
198 R_DSA_512,
199 R_DSA_1024,
200 R_DSA_2048,
201 DSA_NUM,
202};
163 203
164#define EC_NUM 4 204enum {
165#define MAX_ECDH_SIZE 256 205 R_RSA_512,
206 R_RSA_1024,
207 R_RSA_2048,
208 R_RSA_4096,
209 RSA_NUM,
210};
211
212enum {
213 R_EC_P224,
214 R_EC_P256,
215 R_EC_P384,
216 R_EC_P521,
217 EC_NUM,
218};
166 219
167static const char *names[ALGOR_NUM] = { 220static const char *names[ALGOR_NUM] = {
168 "md2", "md4", "md5", "hmac(md5)", "sha1", "rmd160", 221 "md2", "md4", "md5", "hmac(md5)", "sha1", "rmd160",
@@ -984,50 +1037,7 @@ speed_main(int argc, char **argv)
984#ifndef OPENSSL_NO_CAMELLIA 1037#ifndef OPENSSL_NO_CAMELLIA
985 CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3; 1038 CAMELLIA_KEY camellia_ks1, camellia_ks2, camellia_ks3;
986#endif 1039#endif
987#define D_MD2 0
988#define D_MD4 1
989#define D_MD5 2
990#define D_HMAC 3
991#define D_SHA1 4
992#define D_RMD160 5
993#define D_RC4 6
994#define D_CBC_DES 7
995#define D_EDE3_DES 8
996#define D_CBC_IDEA 9
997#define D_CBC_SEED 10
998#define D_CBC_RC2 11
999#define D_CBC_RC5 12
1000#define D_CBC_BF 13
1001#define D_CBC_CAST 14
1002#define D_CBC_128_AES 15
1003#define D_CBC_192_AES 16
1004#define D_CBC_256_AES 17
1005#define D_CBC_128_CML 18
1006#define D_CBC_192_CML 19
1007#define D_CBC_256_CML 20
1008#define D_EVP 21
1009#define D_SHA256 22
1010#define D_SHA512 23
1011#define D_IGE_128_AES 24
1012#define D_IGE_192_AES 25
1013#define D_IGE_256_AES 26
1014#define D_GHASH 27
1015#define D_AES_128_GCM 28
1016#define D_AES_256_GCM 29
1017#define D_CHACHA20_POLY1305 30
1018 double d = 0.0; 1040 double d = 0.0;
1019#define R_DSA_512 0
1020#define R_DSA_1024 1
1021#define R_DSA_2048 2
1022#define R_RSA_512 0
1023#define R_RSA_1024 1
1024#define R_RSA_2048 2
1025#define R_RSA_4096 3
1026
1027#define R_EC_P224 0
1028#define R_EC_P256 1
1029#define R_EC_P384 2
1030#define R_EC_P521 3
1031 1041
1032 RSA *rsa_key[RSA_NUM]; 1042 RSA *rsa_key[RSA_NUM];
1033 static unsigned int rsa_bits[RSA_NUM] = {512, 1024, 2048, 4096}; 1043 static unsigned int rsa_bits[RSA_NUM] = {512, 1024, 2048, 4096};