All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE
@ 2014-05-14  9:36 Marek Vasut
  2014-05-14  9:36 ` [PATCH 2/4] crypto: geode: Kill AES_IV_LENGTH Marek Vasut
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Marek Vasut @ 2014-05-14  9:36 UTC (permalink / raw)
  To: linux-crypto
  Cc: herbert, Marek Vasut, Benjamin Herrenschmidt, Dmitry Kasatkin,
	Eric Bénard, Jussi Kivilinna, Kent Yoder, Michal Ludvig,
	Varun Wadekar, Vladimir Zapolskiy, linux-geode

This is actually defined in include/crypto/aes.h , no need to have
a a different symbol for the same thing twice.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: Eric Bénard <eric@eukrea.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: Michal Ludvig <michal@logix.cz>
Cc: Varun Wadekar <vwadekar@nvidia.com>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: linux-geode@lists.infradead.org
---
 drivers/crypto/geode-aes.c | 18 +++++++++---------
 drivers/crypto/geode-aes.h |  1 -
 2 files changed, 9 insertions(+), 10 deletions(-)

NOTE: Geode guys, can you please test this change ?

diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 0c9ff49..32001d6b 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -226,7 +226,7 @@ geode_encrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 	op->dst = (void *) out;
 	op->mode = AES_MODE_ECB;
 	op->flags = 0;
-	op->len = AES_MIN_BLOCK_SIZE;
+	op->len = AES_BLOCK_SIZE;
 	op->dir = AES_DIR_ENCRYPT;
 
 	geode_aes_crypt(op);
@@ -247,7 +247,7 @@ geode_decrypt(struct crypto_tfm *tfm, u8 *out, const u8 *in)
 	op->dst = (void *) out;
 	op->mode = AES_MODE_ECB;
 	op->flags = 0;
-	op->len = AES_MIN_BLOCK_SIZE;
+	op->len = AES_BLOCK_SIZE;
 	op->dir = AES_DIR_DECRYPT;
 
 	geode_aes_crypt(op);
@@ -286,7 +286,7 @@ static struct crypto_alg geode_alg = {
 							CRYPTO_ALG_NEED_FALLBACK,
 	.cra_init			=	fallback_init_cip,
 	.cra_exit			=	fallback_exit_cip,
-	.cra_blocksize		=	AES_MIN_BLOCK_SIZE,
+	.cra_blocksize		=	AES_BLOCK_SIZE,
 	.cra_ctxsize		=	sizeof(struct geode_aes_op),
 	.cra_module			=	THIS_MODULE,
 	.cra_u				=	{
@@ -320,7 +320,7 @@ geode_cbc_decrypt(struct blkcipher_desc *desc,
 		op->src = walk.src.virt.addr,
 		op->dst = walk.dst.virt.addr;
 		op->mode = AES_MODE_CBC;
-		op->len = nbytes - (nbytes % AES_MIN_BLOCK_SIZE);
+		op->len = nbytes - (nbytes % AES_BLOCK_SIZE);
 		op->dir = AES_DIR_DECRYPT;
 
 		ret = geode_aes_crypt(op);
@@ -352,7 +352,7 @@ geode_cbc_encrypt(struct blkcipher_desc *desc,
 		op->src = walk.src.virt.addr,
 		op->dst = walk.dst.virt.addr;
 		op->mode = AES_MODE_CBC;
-		op->len = nbytes - (nbytes % AES_MIN_BLOCK_SIZE);
+		op->len = nbytes - (nbytes % AES_BLOCK_SIZE);
 		op->dir = AES_DIR_ENCRYPT;
 
 		ret = geode_aes_crypt(op);
@@ -396,7 +396,7 @@ static struct crypto_alg geode_cbc_alg = {
 						CRYPTO_ALG_NEED_FALLBACK,
 	.cra_init			=	fallback_init_blk,
 	.cra_exit			=	fallback_exit_blk,
-	.cra_blocksize		=	AES_MIN_BLOCK_SIZE,
+	.cra_blocksize		=	AES_BLOCK_SIZE,
 	.cra_ctxsize		=	sizeof(struct geode_aes_op),
 	.cra_alignmask		=	15,
 	.cra_type			=	&crypto_blkcipher_type,
@@ -432,7 +432,7 @@ geode_ecb_decrypt(struct blkcipher_desc *desc,
 		op->src = walk.src.virt.addr,
 		op->dst = walk.dst.virt.addr;
 		op->mode = AES_MODE_ECB;
-		op->len = nbytes - (nbytes % AES_MIN_BLOCK_SIZE);
+		op->len = nbytes - (nbytes % AES_BLOCK_SIZE);
 		op->dir = AES_DIR_DECRYPT;
 
 		ret = geode_aes_crypt(op);
@@ -462,7 +462,7 @@ geode_ecb_encrypt(struct blkcipher_desc *desc,
 		op->src = walk.src.virt.addr,
 		op->dst = walk.dst.virt.addr;
 		op->mode = AES_MODE_ECB;
-		op->len = nbytes - (nbytes % AES_MIN_BLOCK_SIZE);
+		op->len = nbytes - (nbytes % AES_BLOCK_SIZE);
 		op->dir = AES_DIR_ENCRYPT;
 
 		ret = geode_aes_crypt(op);
@@ -482,7 +482,7 @@ static struct crypto_alg geode_ecb_alg = {
 						CRYPTO_ALG_NEED_FALLBACK,
 	.cra_init			=	fallback_init_blk,
 	.cra_exit			=	fallback_exit_blk,
-	.cra_blocksize		=	AES_MIN_BLOCK_SIZE,
+	.cra_blocksize		=	AES_BLOCK_SIZE,
 	.cra_ctxsize		=	sizeof(struct geode_aes_op),
 	.cra_alignmask		=	15,
 	.cra_type			=	&crypto_blkcipher_type,
diff --git a/drivers/crypto/geode-aes.h b/drivers/crypto/geode-aes.h
index f1855b5..cedf2c5 100644
--- a/drivers/crypto/geode-aes.h
+++ b/drivers/crypto/geode-aes.h
@@ -12,7 +12,6 @@
 /* driver logic flags */
 #define AES_IV_LENGTH  16
 #define AES_KEY_LENGTH 16
-#define AES_MIN_BLOCK_SIZE 16
 
 #define AES_MODE_ECB 0
 #define AES_MODE_CBC 1
-- 
2.0.0.rc0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/4] crypto: geode: Kill AES_IV_LENGTH
  2014-05-14  9:36 [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Marek Vasut
@ 2014-05-14  9:36 ` Marek Vasut
  2014-05-14  9:36 ` [PATCH 3/4] crypto: geode: Consistently use AES_KEYSIZE_128 Marek Vasut
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2014-05-14  9:36 UTC (permalink / raw)
  To: linux-crypto
  Cc: herbert, Marek Vasut, Benjamin Herrenschmidt, Dmitry Kasatkin,
	Eric Bénard, Jussi Kivilinna, Kent Yoder, Michal Ludvig,
	Varun Wadekar, Vladimir Zapolskiy, linux-geode

The AES IV length is always 128bits, just use the define from aes.h

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: Eric Bénard <eric@eukrea.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: Michal Ludvig <michal@logix.cz>
Cc: Varun Wadekar <vwadekar@nvidia.com>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: linux-geode@lists.infradead.org
---
 drivers/crypto/geode-aes.c | 2 +-
 drivers/crypto/geode-aes.h | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

NOTE: Geode guys, can you please test this change ?

diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 32001d6b..69e1b02 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -408,7 +408,7 @@ static struct crypto_alg geode_cbc_alg = {
 			.setkey			=	geode_setkey_blk,
 			.encrypt		=	geode_cbc_encrypt,
 			.decrypt		=	geode_cbc_decrypt,
-			.ivsize			=	AES_IV_LENGTH,
+			.ivsize			=	AES_BLOCK_SIZE,
 		}
 	}
 };
diff --git a/drivers/crypto/geode-aes.h b/drivers/crypto/geode-aes.h
index cedf2c5..73e7b5f 100644
--- a/drivers/crypto/geode-aes.h
+++ b/drivers/crypto/geode-aes.h
@@ -10,7 +10,6 @@
 #define _GEODE_AES_H_
 
 /* driver logic flags */
-#define AES_IV_LENGTH  16
 #define AES_KEY_LENGTH 16
 
 #define AES_MODE_ECB 0
-- 
2.0.0.rc0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 3/4] crypto: geode: Consistently use AES_KEYSIZE_128
  2014-05-14  9:36 [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Marek Vasut
  2014-05-14  9:36 ` [PATCH 2/4] crypto: geode: Kill AES_IV_LENGTH Marek Vasut
@ 2014-05-14  9:36 ` Marek Vasut
  2014-05-14  9:36 ` [PATCH 4/4] crypto: geode: Weed out printk() from probe() Marek Vasut
  2014-05-22 13:08 ` [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2014-05-14  9:36 UTC (permalink / raw)
  To: linux-crypto
  Cc: herbert, Marek Vasut, Benjamin Herrenschmidt, Dmitry Kasatkin,
	Eric Bénard, Jussi Kivilinna, Kent Yoder, Michal Ludvig,
	Varun Wadekar, Vladimir Zapolskiy, linux-geode

Consistently use AES_KEYSIZE_128 instead of arbitrary defined value.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: Eric Bénard <eric@eukrea.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: Michal Ludvig <michal@logix.cz>
Cc: Varun Wadekar <vwadekar@nvidia.com>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: linux-geode@lists.infradead.org
---
 drivers/crypto/geode-aes.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

NOTE: Geode guys, can you please test this change ?

diff --git a/drivers/crypto/geode-aes.h b/drivers/crypto/geode-aes.h
index 73e7b5f..f442ca9 100644
--- a/drivers/crypto/geode-aes.h
+++ b/drivers/crypto/geode-aes.h
@@ -10,8 +10,6 @@
 #define _GEODE_AES_H_
 
 /* driver logic flags */
-#define AES_KEY_LENGTH 16
-
 #define AES_MODE_ECB 0
 #define AES_MODE_CBC 1
 
@@ -62,7 +60,7 @@ struct geode_aes_op {
 	u32 flags;
 	int len;
 
-	u8 key[AES_KEY_LENGTH];
+	u8 key[AES_KEYSIZE_128];
 	u8 *iv;
 
 	union {
-- 
2.0.0.rc0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 4/4] crypto: geode: Weed out printk() from probe()
  2014-05-14  9:36 [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Marek Vasut
  2014-05-14  9:36 ` [PATCH 2/4] crypto: geode: Kill AES_IV_LENGTH Marek Vasut
  2014-05-14  9:36 ` [PATCH 3/4] crypto: geode: Consistently use AES_KEYSIZE_128 Marek Vasut
@ 2014-05-14  9:36 ` Marek Vasut
  2014-05-22 13:08 ` [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2014-05-14  9:36 UTC (permalink / raw)
  To: linux-crypto
  Cc: herbert, Marek Vasut, Benjamin Herrenschmidt, Dmitry Kasatkin,
	Eric Bénard, Jussi Kivilinna, Kent Yoder, Michal Ludvig,
	Varun Wadekar, Vladimir Zapolskiy, linux-geode

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
Cc: Eric Bénard <eric@eukrea.com>
Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Cc: Kent Yoder <key@linux.vnet.ibm.com>
Cc: Michal Ludvig <michal@logix.cz>
Cc: Varun Wadekar <vwadekar@nvidia.com>
Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
Cc: linux-geode@lists.infradead.org
---
 drivers/crypto/geode-aes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

NOTE: Geode guys, can you please test this change ?

diff --git a/drivers/crypto/geode-aes.c b/drivers/crypto/geode-aes.c
index 69e1b02..8e482ce 100644
--- a/drivers/crypto/geode-aes.c
+++ b/drivers/crypto/geode-aes.c
@@ -547,7 +547,7 @@ static int geode_aes_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	if (ret)
 		goto eecb;
 
-	printk(KERN_NOTICE "geode-aes: GEODE AES engine enabled.\n");
+	dev_notice(&dev->dev, "GEODE AES engine enabled.\n");
 	return 0;
 
  eecb:
@@ -565,7 +565,7 @@ static int geode_aes_probe(struct pci_dev *dev, const struct pci_device_id *id)
  eenable:
 	pci_disable_device(dev);
 
-	printk(KERN_ERR "geode-aes:  GEODE AES initialization failed.\n");
+	dev_err(&dev->dev, "GEODE AES initialization failed.\n");
 	return ret;
 }
 
-- 
2.0.0.rc0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE
  2014-05-14  9:36 [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Marek Vasut
                   ` (2 preceding siblings ...)
  2014-05-14  9:36 ` [PATCH 4/4] crypto: geode: Weed out printk() from probe() Marek Vasut
@ 2014-05-22 13:08 ` Herbert Xu
  3 siblings, 0 replies; 5+ messages in thread
From: Herbert Xu @ 2014-05-22 13:08 UTC (permalink / raw)
  To: Marek Vasut
  Cc: linux-crypto, Benjamin Herrenschmidt, Dmitry Kasatkin,
	Eric Bénard, Jussi Kivilinna, Kent Yoder, Michal Ludvig,
	Varun Wadekar, Vladimir Zapolskiy, linux-geode

On Wed, May 14, 2014 at 11:36:38AM +0200, Marek Vasut wrote:
> This is actually defined in include/crypto/aes.h , no need to have
> a a different symbol for the same thing twice.
> 
> Signed-off-by: Marek Vasut <marex@denx.de>
> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> Cc: Dmitry Kasatkin <dmitry.kasatkin@nokia.com>
> Cc: Eric Bénard <eric@eukrea.com>
> Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
> Cc: Kent Yoder <key@linux.vnet.ibm.com>
> Cc: Michal Ludvig <michal@logix.cz>
> Cc: Varun Wadekar <vwadekar@nvidia.com>
> Cc: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>
> Cc: linux-geode@lists.infradead.org

All applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-22 13:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-14  9:36 [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Marek Vasut
2014-05-14  9:36 ` [PATCH 2/4] crypto: geode: Kill AES_IV_LENGTH Marek Vasut
2014-05-14  9:36 ` [PATCH 3/4] crypto: geode: Consistently use AES_KEYSIZE_128 Marek Vasut
2014-05-14  9:36 ` [PATCH 4/4] crypto: geode: Weed out printk() from probe() Marek Vasut
2014-05-22 13:08 ` [PATCH 1/4] crypto: geode: Kill AES_MIN_BLOCK_SIZE Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.