summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/arch/aarch64/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/alpha/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/amd64/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/arm/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/hppa/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/i386/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/m88k/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/mips64/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/powerpc/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/powerpc64/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/riscv64/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/sh/opensslconf.h7
-rw-r--r--src/lib/libcrypto/arch/sparc64/opensslconf.h7
-rw-r--r--src/lib/libcrypto/rc4/rc4.c44
14 files changed, 19 insertions, 116 deletions
diff --git a/src/lib/libcrypto/arch/aarch64/opensslconf.h b/src/lib/libcrypto/arch/aarch64/opensslconf.h
index fed209a008..e6e294a962 100644
--- a/src/lib/libcrypto/arch/aarch64/opensslconf.h
+++ b/src/lib/libcrypto/arch/aarch64/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#undef RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/alpha/opensslconf.h b/src/lib/libcrypto/arch/alpha/opensslconf.h
index 1dbd8f22fa..1c033369ea 100644
--- a/src/lib/libcrypto/arch/alpha/opensslconf.h
+++ b/src/lib/libcrypto/arch/alpha/opensslconf.h
@@ -63,13 +63,6 @@
63#undef THIRTY_TWO_BIT 63#undef THIRTY_TWO_BIT
64#endif 64#endif
65 65
66#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
67#define CONFIG_HEADER_RC4_LOCL_H
68/* if this is defined data[i] is used instead of *data, this is a %20
69 * speedup on x86 */
70#undef RC4_INDEX
71#endif
72
73#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 66#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
74#define CONFIG_HEADER_BF_LOCL_H 67#define CONFIG_HEADER_BF_LOCL_H
75#define BF_PTR 68#define BF_PTR
diff --git a/src/lib/libcrypto/arch/amd64/opensslconf.h b/src/lib/libcrypto/arch/amd64/opensslconf.h
index 7615744a6b..4187a44c86 100644
--- a/src/lib/libcrypto/arch/amd64/opensslconf.h
+++ b/src/lib/libcrypto/arch/amd64/opensslconf.h
@@ -60,13 +60,6 @@
60#undef THIRTY_TWO_BIT 60#undef THIRTY_TWO_BIT
61#endif 61#endif
62 62
63#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
64#define CONFIG_HEADER_RC4_LOCL_H
65/* if this is defined data[i] is used instead of *data, this is a %20
66 * speedup on x86 */
67#undef RC4_INDEX
68#endif
69
70#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 63#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
71#define CONFIG_HEADER_BF_LOCL_H 64#define CONFIG_HEADER_BF_LOCL_H
72#undef BF_PTR 65#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/arm/opensslconf.h b/src/lib/libcrypto/arch/arm/opensslconf.h
index 3413abb672..98dcfee3a1 100644
--- a/src/lib/libcrypto/arch/arm/opensslconf.h
+++ b/src/lib/libcrypto/arch/arm/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#define RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/hppa/opensslconf.h b/src/lib/libcrypto/arch/hppa/opensslconf.h
index 3413abb672..98dcfee3a1 100644
--- a/src/lib/libcrypto/arch/hppa/opensslconf.h
+++ b/src/lib/libcrypto/arch/hppa/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#define RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/i386/opensslconf.h b/src/lib/libcrypto/arch/i386/opensslconf.h
index ac1ea99cc9..1ea367102b 100644
--- a/src/lib/libcrypto/arch/i386/opensslconf.h
+++ b/src/lib/libcrypto/arch/i386/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#define RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/m88k/opensslconf.h b/src/lib/libcrypto/arch/m88k/opensslconf.h
index 3413abb672..98dcfee3a1 100644
--- a/src/lib/libcrypto/arch/m88k/opensslconf.h
+++ b/src/lib/libcrypto/arch/m88k/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#define RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/mips64/opensslconf.h b/src/lib/libcrypto/arch/mips64/opensslconf.h
index e5b1b51ec5..ec35dc9946 100644
--- a/src/lib/libcrypto/arch/mips64/opensslconf.h
+++ b/src/lib/libcrypto/arch/mips64/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#undef RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#define BF_PTR 70#define BF_PTR
diff --git a/src/lib/libcrypto/arch/powerpc/opensslconf.h b/src/lib/libcrypto/arch/powerpc/opensslconf.h
index 3413abb672..98dcfee3a1 100644
--- a/src/lib/libcrypto/arch/powerpc/opensslconf.h
+++ b/src/lib/libcrypto/arch/powerpc/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#define RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/powerpc64/opensslconf.h b/src/lib/libcrypto/arch/powerpc64/opensslconf.h
index 7615744a6b..4187a44c86 100644
--- a/src/lib/libcrypto/arch/powerpc64/opensslconf.h
+++ b/src/lib/libcrypto/arch/powerpc64/opensslconf.h
@@ -60,13 +60,6 @@
60#undef THIRTY_TWO_BIT 60#undef THIRTY_TWO_BIT
61#endif 61#endif
62 62
63#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
64#define CONFIG_HEADER_RC4_LOCL_H
65/* if this is defined data[i] is used instead of *data, this is a %20
66 * speedup on x86 */
67#undef RC4_INDEX
68#endif
69
70#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 63#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
71#define CONFIG_HEADER_BF_LOCL_H 64#define CONFIG_HEADER_BF_LOCL_H
72#undef BF_PTR 65#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/riscv64/opensslconf.h b/src/lib/libcrypto/arch/riscv64/opensslconf.h
index fed209a008..e6e294a962 100644
--- a/src/lib/libcrypto/arch/riscv64/opensslconf.h
+++ b/src/lib/libcrypto/arch/riscv64/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#undef RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/sh/opensslconf.h b/src/lib/libcrypto/arch/sh/opensslconf.h
index 3413abb672..98dcfee3a1 100644
--- a/src/lib/libcrypto/arch/sh/opensslconf.h
+++ b/src/lib/libcrypto/arch/sh/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#define RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#undef BF_PTR 70#undef BF_PTR
diff --git a/src/lib/libcrypto/arch/sparc64/opensslconf.h b/src/lib/libcrypto/arch/sparc64/opensslconf.h
index e5b1b51ec5..ec35dc9946 100644
--- a/src/lib/libcrypto/arch/sparc64/opensslconf.h
+++ b/src/lib/libcrypto/arch/sparc64/opensslconf.h
@@ -65,13 +65,6 @@
65#undef EIGHT_BIT 65#undef EIGHT_BIT
66#endif 66#endif
67 67
68#if defined(HEADER_RC4_LOCL_H) && !defined(CONFIG_HEADER_RC4_LOCL_H)
69#define CONFIG_HEADER_RC4_LOCL_H
70/* if this is defined data[i] is used instead of *data, this is a %20
71 * speedup on x86 */
72#undef RC4_INDEX
73#endif
74
75#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H) 68#if defined(HEADER_BF_LOCL_H) && !defined(CONFIG_HEADER_BF_LOCL_H)
76#define CONFIG_HEADER_BF_LOCL_H 69#define CONFIG_HEADER_BF_LOCL_H
77#define BF_PTR 70#define BF_PTR
diff --git a/src/lib/libcrypto/rc4/rc4.c b/src/lib/libcrypto/rc4/rc4.c
index 930d0d9bb3..56ed43cba7 100644
--- a/src/lib/libcrypto/rc4/rc4.c
+++ b/src/lib/libcrypto/rc4/rc4.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rc4.c,v 1.12 2024/08/11 13:02:39 jsing Exp $ */ 1/* $OpenBSD: rc4.c,v 1.13 2025/01/27 14:02:32 jsing 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 *
@@ -196,7 +196,7 @@ rc4_internal(RC4_KEY *key, size_t len, const unsigned char *indata,
196#endif 196#endif
197 } 197 }
198#endif 198#endif
199#define LOOP(in,out) \ 199#define RC4_LOOP(in,out) \
200 x=((x+1)&0xff); \ 200 x=((x+1)&0xff); \
201 tx=d[x]; \ 201 tx=d[x]; \
202 y=(tx+y)&0xff; \ 202 y=(tx+y)&0xff; \
@@ -204,27 +204,21 @@ rc4_internal(RC4_KEY *key, size_t len, const unsigned char *indata,
204 d[y]=tx; \ 204 d[y]=tx; \
205 (out) = d[(tx+ty)&0xff]^ (in); 205 (out) = d[(tx+ty)&0xff]^ (in);
206 206
207#ifndef RC4_INDEX
208#define RC4_LOOP(a,b,i) LOOP(*((a)++),*((b)++))
209#else
210#define RC4_LOOP(a,b,i) LOOP(a[i],b[i])
211#endif
212
213 i = len >> 3; 207 i = len >> 3;
214 if (i) { 208 if (i) {
215 for (;;) { 209 for (;;) {
216 RC4_LOOP(indata, outdata, 0); 210 RC4_LOOP(indata[0], outdata[0]);
217 RC4_LOOP(indata, outdata, 1); 211 RC4_LOOP(indata[1], outdata[1]);
218 RC4_LOOP(indata, outdata, 2); 212 RC4_LOOP(indata[2], outdata[2]);
219 RC4_LOOP(indata, outdata, 3); 213 RC4_LOOP(indata[3], outdata[3]);
220 RC4_LOOP(indata, outdata, 4); 214 RC4_LOOP(indata[4], outdata[4]);
221 RC4_LOOP(indata, outdata, 5); 215 RC4_LOOP(indata[5], outdata[5]);
222 RC4_LOOP(indata, outdata, 6); 216 RC4_LOOP(indata[6], outdata[6]);
223 RC4_LOOP(indata, outdata, 7); 217 RC4_LOOP(indata[7], outdata[7]);
224#ifdef RC4_INDEX 218
225 indata += 8; 219 indata += 8;
226 outdata += 8; 220 outdata += 8;
227#endif 221
228 if (--i == 0) 222 if (--i == 0)
229 break; 223 break;
230 } 224 }
@@ -232,25 +226,25 @@ rc4_internal(RC4_KEY *key, size_t len, const unsigned char *indata,
232 i = len&0x07; 226 i = len&0x07;
233 if (i) { 227 if (i) {
234 for (;;) { 228 for (;;) {
235 RC4_LOOP(indata, outdata, 0); 229 RC4_LOOP(indata[0], outdata[0]);
236 if (--i == 0) 230 if (--i == 0)
237 break; 231 break;
238 RC4_LOOP(indata, outdata, 1); 232 RC4_LOOP(indata[1], outdata[1]);
239 if (--i == 0) 233 if (--i == 0)
240 break; 234 break;
241 RC4_LOOP(indata, outdata, 2); 235 RC4_LOOP(indata[2], outdata[2]);
242 if (--i == 0) 236 if (--i == 0)
243 break; 237 break;
244 RC4_LOOP(indata, outdata, 3); 238 RC4_LOOP(indata[3], outdata[3]);
245 if (--i == 0) 239 if (--i == 0)
246 break; 240 break;
247 RC4_LOOP(indata, outdata, 4); 241 RC4_LOOP(indata[4], outdata[4]);
248 if (--i == 0) 242 if (--i == 0)
249 break; 243 break;
250 RC4_LOOP(indata, outdata, 5); 244 RC4_LOOP(indata[5], outdata[5]);
251 if (--i == 0) 245 if (--i == 0)
252 break; 246 break;
253 RC4_LOOP(indata, outdata, 6); 247 RC4_LOOP(indata[6], outdata[6]);
254 if (--i == 0) 248 if (--i == 0)
255 break; 249 break;
256 } 250 }