From: Iuliana Prodan Date: Fri, 8 Feb 2019 13:50:08 +0000 (+0200) Subject: crypto: export arc4 defines X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=bd30cf533b77420b7c504c09cef5ba26b0c9dcb4;p=linux.git crypto: export arc4 defines Some arc4 cipher algorithm defines show up in two places: crypto/arc4.c and drivers/crypto/bcm/cipher.h. Let's export them in a common header and update their users. Signed-off-by: Iuliana Prodan Reviewed-by: Horia Geantă Signed-off-by: Herbert Xu --- diff --git a/crypto/arc4.c b/crypto/arc4.c index 652d24399afa6..6c93342e3405b 100644 --- a/crypto/arc4.c +++ b/crypto/arc4.c @@ -13,14 +13,11 @@ */ #include +#include #include #include #include -#define ARC4_MIN_KEY_SIZE 1 -#define ARC4_MAX_KEY_SIZE 256 -#define ARC4_BLOCK_SIZE 1 - struct arc4_ctx { u32 S[256]; u32 x, y; diff --git a/drivers/crypto/bcm/cipher.h b/drivers/crypto/bcm/cipher.h index 763c425c41cae..f6da497589547 100644 --- a/drivers/crypto/bcm/cipher.h +++ b/drivers/crypto/bcm/cipher.h @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -34,9 +35,6 @@ /* Driver supports up to MAX_SPUS SPU blocks */ #define MAX_SPUS 16 -#define ARC4_MIN_KEY_SIZE 1 -#define ARC4_MAX_KEY_SIZE 256 -#define ARC4_BLOCK_SIZE 1 #define ARC4_STATE_SIZE 4 #define CCM_AES_IV_SIZE 16 diff --git a/include/crypto/arc4.h b/include/crypto/arc4.h new file mode 100644 index 0000000000000..5b2c24ab0139c --- /dev/null +++ b/include/crypto/arc4.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Common values for ARC4 Cipher Algorithm + */ + +#ifndef _CRYPTO_ARC4_H +#define _CRYPTO_ARC4_H + +#define ARC4_MIN_KEY_SIZE 1 +#define ARC4_MAX_KEY_SIZE 256 +#define ARC4_BLOCK_SIZE 1 + +#endif /* _CRYPTO_ARC4_H */