18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0+ */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Common values for ARC4 Cipher Algorithm 48c2ecf20Sopenharmony_ci */ 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_ci#ifndef _CRYPTO_ARC4_H 78c2ecf20Sopenharmony_ci#define _CRYPTO_ARC4_H 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#include <linux/types.h> 108c2ecf20Sopenharmony_ci 118c2ecf20Sopenharmony_ci#define ARC4_MIN_KEY_SIZE 1 128c2ecf20Sopenharmony_ci#define ARC4_MAX_KEY_SIZE 256 138c2ecf20Sopenharmony_ci#define ARC4_BLOCK_SIZE 1 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_cistruct arc4_ctx { 168c2ecf20Sopenharmony_ci u32 S[256]; 178c2ecf20Sopenharmony_ci u32 x, y; 188c2ecf20Sopenharmony_ci}; 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciint arc4_setkey(struct arc4_ctx *ctx, const u8 *in_key, unsigned int key_len); 218c2ecf20Sopenharmony_civoid arc4_crypt(struct arc4_ctx *ctx, u8 *out, const u8 *in, unsigned int len); 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci#endif /* _CRYPTO_ARC4_H */ 24