linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Iuliana Prodan <iuliana.prodan@nxp.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
	Horia Geanta <horia.geanta@nxp.com>,
	Aymen Sghaier <aymen.sghaier@nxp.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-imx <linux-imx@nxp.com>
Subject: [PATCH 2/4] crypto: export arc4 defines
Date: Fri,  8 Feb 2019 15:50:08 +0200	[thread overview]
Message-ID: <1549633810-10380-3-git-send-email-iuliana.prodan@nxp.com> (raw)
In-Reply-To: <1549633810-10380-1-git-send-email-iuliana.prodan@nxp.com>

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>
---
 crypto/arc4.c               |  5 +----
 drivers/crypto/bcm/cipher.h |  4 +---
 include/crypto/arc4.h       | 13 +++++++++++++
 3 files changed, 15 insertions(+), 7 deletions(-)
 create mode 100644 include/crypto/arc4.h

diff --git a/crypto/arc4.c b/crypto/arc4.c
index 652d243..6c93342 100644
--- a/crypto/arc4.c
+++ b/crypto/arc4.c
@@ -13,14 +13,11 @@
  */
 
 #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;
diff --git a/drivers/crypto/bcm/cipher.h b/drivers/crypto/bcm/cipher.h
index 763c425..f6da497 100644
--- a/drivers/crypto/bcm/cipher.h
+++ b/drivers/crypto/bcm/cipher.h
@@ -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
index 0000000..5b2c24a
--- /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 */
-- 
2.1.0


  parent reply	other threads:[~2019-02-08 13:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 13:50 [PATCH 0/4] crypto: caam - add ecb mode support Iuliana Prodan
2019-02-08 13:50 ` [PATCH 1/4] crypto: caam - use mapped_{src,dst}_nents for job descriptor Iuliana Prodan
2019-02-08 13:50 ` Iuliana Prodan [this message]
2019-02-08 13:50 ` [PATCH 3/4] crypto: caam - add ecb(*) support Iuliana Prodan
2019-02-08 13:50 ` [PATCH 4/4] crypto: caam - weak key checking for cbc des, 3des Iuliana Prodan
2019-02-09 21:52 ` [PATCH 0/4] crypto: caam - add ecb mode support Eric Biggers
2019-02-13 18:45   ` Horia Geanta
2019-02-13 18:51     ` Eric Biggers
2019-02-15  5:24       ` Herbert Xu
2019-02-15  5:54         ` Eric Biggers
2019-02-15  6:16           ` Herbert Xu
2019-02-14 20:57 ` Horia Geanta
2019-02-15  5:24 ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1549633810-10380-3-git-send-email-iuliana.prodan@nxp.com \
    --to=iuliana.prodan@nxp.com \
    --cc=aymen.sghaier@nxp.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=horia.geanta@nxp.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).