summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/rc4/rc4.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/rc4/rc4.c')
-rw-r--r--src/lib/libcrypto/rc4/rc4.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/lib/libcrypto/rc4/rc4.c b/src/lib/libcrypto/rc4/rc4.c
index bbf7c3ae4e..8ff8191a51 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.8 2024/03/27 12:54:42 jsing Exp $ */ 1/* $OpenBSD: rc4.c,v 1.9 2024/03/28 01:49:29 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 *
@@ -68,8 +68,13 @@
68 * Date: Wed, 14 Sep 1994 06:35:31 GMT 68 * Date: Wed, 14 Sep 1994 06:35:31 GMT
69 */ 69 */
70 70
71void 71#ifdef HAVE_RC4_INTERNAL
72RC4(RC4_KEY *key, size_t len, const unsigned char *indata, 72void rc4_internal(RC4_KEY *key, size_t len, const unsigned char *indata,
73 unsigned char *outdata);
74
75#else
76static void
77rc4_internal(RC4_KEY *key, size_t len, const unsigned char *indata,
73 unsigned char *outdata) 78 unsigned char *outdata)
74{ 79{
75 RC4_INT *d; 80 RC4_INT *d;
@@ -251,9 +256,14 @@ RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
251 key->x = x; 256 key->x = x;
252 key->y = y; 257 key->y = y;
253} 258}
259#endif
254 260
255void 261#ifdef HAVE_RC4_SET_KEY_INTERNAL
256RC4_set_key(RC4_KEY *key, int len, const unsigned char *data) 262void rc4_set_key_internal(RC4_KEY *key, int len, const unsigned char *data);
263
264#else
265static void
266rc4_set_key_internal(RC4_KEY *key, int len, const unsigned char *data)
257{ 267{
258 RC4_INT tmp; 268 RC4_INT tmp;
259 int id1, id2; 269 int id1, id2;
@@ -281,3 +291,17 @@ RC4_set_key(RC4_KEY *key, int len, const unsigned char *data)
281 SK_LOOP(d, i + 3); 291 SK_LOOP(d, i + 3);
282 } 292 }
283} 293}
294#endif
295
296void
297RC4(RC4_KEY *key, size_t len, const unsigned char *indata,
298 unsigned char *outdata)
299{
300 rc4_internal(key, len, indata, outdata);
301}
302
303void
304RC4_set_key(RC4_KEY *key, int len, const unsigned char *data)
305{
306 rc4_set_key_internal(key, len, data);
307}