OSDN Git Service

crypto: export arc4 defines
authorIuliana Prodan <iuliana.prodan@nxp.com>
Fri, 8 Feb 2019 13:50:08 +0000 (15:50 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 15 Feb 2019 05:21:55 +0000 (13:21 +0800)
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 <iuliana.prodan@nxp.com>
Reviewed-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/arc4.c
drivers/crypto/bcm/cipher.h
include/crypto/arc4.h [new file with mode: 0644]

index 652d243..6c93342 100644 (file)
  */
 
 #include <crypto/algapi.h>
+#include <crypto/arc4.h>
 #include <crypto/internal/skcipher.h>
 #include <linux/init.h>
 #include <linux/module.h>
 
-#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;
index 763c425..f6da497 100644 (file)
@@ -23,6 +23,7 @@
 #include <crypto/aes.h>
 #include <crypto/internal/hash.h>
 #include <crypto/aead.h>
+#include <crypto/arc4.h>
 #include <crypto/gcm.h>
 #include <crypto/sha.h>
 #include <crypto/sha3.h>
@@ -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 (file)
index 0000000..5b2c24a
--- /dev/null
@@ -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 */