Source
6
6
* Jon Oberheide <jon@oberheide.org>
7
7
*
8
8
* This program is free software; you can redistribute it and/or modify
9
9
* it under the terms of the GNU General Public License as published by
10
10
* the Free Software Foundation; either version 2 of the License, or
11
11
* (at your option) any later version.
12
12
*
13
13
*/
14
14
15
15
#include <crypto/algapi.h>
16
+
#include <crypto/arc4.h>
16
17
#include <crypto/internal/skcipher.h>
17
18
#include <linux/init.h>
18
19
#include <linux/module.h>
19
20
20
-
#define ARC4_MIN_KEY_SIZE 1
21
-
#define ARC4_MAX_KEY_SIZE 256
22
-
#define ARC4_BLOCK_SIZE 1
23
-
24
21
struct arc4_ctx {
25
22
u32 S[256];
26
23
u32 x, y;
27
24
};
28
25
29
26
static int arc4_set_key(struct crypto_tfm *tfm, const u8 *in_key,
30
27
unsigned int key_len)
31
28
{
32
29
struct arc4_ctx *ctx = crypto_tfm_ctx(tfm);
33
30
int i, j = 0, k = 0;