]>
git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/rc4/rc4_skey.c
e2325e918b58eb36b3612d46562c530e8601d602
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include <openssl/rc4.h>
12 #include <openssl/opensslv.h>
14 const char *RC4_options(void)
16 if (sizeof(RC4_INT
) == 1)
23 * RC4 as implemented from a posting from
24 * Newsgroups: sci.crypt
25 * Subject: RC4 Algorithm revealed.
26 * Message-ID: <sternCvKL4B.Hyy@netcom.com>
27 * Date: Wed, 14 Sep 1994 06:35:31 GMT
30 void RC4_set_key(RC4_KEY
*key
, int len
, const unsigned char *data
)
33 register int id1
, id2
;
42 #define SK_LOOP(d,n) { \
44 id2 = (data[id1] + tmp + id2) & 0xff; \
45 if (++id1 == len) id1=0; \
49 for (i
= 0; i
< 256; i
++)
51 for (i
= 0; i
< 256; i
+= 4) {