blob: f3c22fe01704c05061f5dce640a6abc264bfd4f3 [file] [log] [blame]
Iuliana Prodanbd30cf52019-02-08 15:50:08 +02001/* SPDX-License-Identifier: GPL-2.0+ */
2/*
3 * Common values for ARC4 Cipher Algorithm
4 */
5
6#ifndef _CRYPTO_ARC4_H
7#define _CRYPTO_ARC4_H
8
Ard Biesheuveldc51f252019-06-12 18:19:53 +02009#include <linux/types.h>
10
Iuliana Prodanbd30cf52019-02-08 15:50:08 +020011#define ARC4_MIN_KEY_SIZE 1
12#define ARC4_MAX_KEY_SIZE 256
13#define ARC4_BLOCK_SIZE 1
14
Ard Biesheuveldc51f252019-06-12 18:19:53 +020015struct arc4_ctx {
16 u32 S[256];
17 u32 x, y;
18};
19
20int arc4_setkey(struct arc4_ctx *ctx, const u8 *in_key, unsigned int key_len);
21void arc4_crypt(struct arc4_ctx *ctx, u8 *out, const u8 *in, unsigned int len);
22
Iuliana Prodanbd30cf52019-02-08 15:50:08 +020023#endif /* _CRYPTO_ARC4_H */