linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] crypto: md5: add MD5 initial vectors
@ 2015-05-17 10:54 LABBE Corentin
  2015-05-17 10:54 ` [PATCH 2/6] crypto: md5: use md5 IV MD5_HX instead of their raw value LABBE Corentin
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: LABBE Corentin @ 2015-05-17 10:54 UTC (permalink / raw)
  To: herbert, davem, ralf, benh, paulus, mpe, aaro.koskinen
  Cc: linux-mips, linux-kernel, LABBE Corentin, linux-crypto,
	sparclinux, linuxppc-dev

This patch simply adds the MD5 IV in the md5 header.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 include/crypto/md5.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/crypto/md5.h b/include/crypto/md5.h
index 65f299b..146af82 100644
--- a/include/crypto/md5.h
+++ b/include/crypto/md5.h
@@ -8,6 +8,11 @@
 #define MD5_BLOCK_WORDS		16
 #define MD5_HASH_WORDS		4
 
+#define MD5_H0	0x67452301UL
+#define MD5_H1	0xefcdab89UL
+#define MD5_H2	0x98badcfeUL
+#define MD5_H3	0x10325476UL
+
 struct md5_state {
 	u32 hash[MD5_HASH_WORDS];
 	u32 block[MD5_BLOCK_WORDS];
-- 
2.3.6

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

* [PATCH 2/6] crypto: md5: use md5 IV MD5_HX instead of their raw value
  2015-05-17 10:54 [PATCH 1/6] crypto: md5: add MD5 initial vectors LABBE Corentin
@ 2015-05-17 10:54 ` LABBE Corentin
  2015-05-17 10:54 ` [PATCH 3/6] crypto: powerpc/md5: " LABBE Corentin
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: LABBE Corentin @ 2015-05-17 10:54 UTC (permalink / raw)
  To: herbert, davem, ralf, benh, paulus, mpe, aaro.koskinen
  Cc: linux-mips, linux-kernel, LABBE Corentin, linux-crypto,
	sparclinux, linuxppc-dev

Since MD5 IV are now available in crypto/md5.h, use them.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 crypto/md5.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/crypto/md5.c b/crypto/md5.c
index 36f5e5b..33d17e9 100644
--- a/crypto/md5.c
+++ b/crypto/md5.c
@@ -51,10 +51,10 @@ static int md5_init(struct shash_desc *desc)
 {
 	struct md5_state *mctx = shash_desc_ctx(desc);
 
-	mctx->hash[0] = 0x67452301;
-	mctx->hash[1] = 0xefcdab89;
-	mctx->hash[2] = 0x98badcfe;
-	mctx->hash[3] = 0x10325476;
+	mctx->hash[0] = MD5_H0;
+	mctx->hash[1] = MD5_H1;
+	mctx->hash[2] = MD5_H2;
+	mctx->hash[3] = MD5_H3;
 	mctx->byte_count = 0;
 
 	return 0;
-- 
2.3.6

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

* [PATCH 3/6] crypto: powerpc/md5: use md5 IV MD5_HX instead of their raw value
  2015-05-17 10:54 [PATCH 1/6] crypto: md5: add MD5 initial vectors LABBE Corentin
  2015-05-17 10:54 ` [PATCH 2/6] crypto: md5: use md5 IV MD5_HX instead of their raw value LABBE Corentin
@ 2015-05-17 10:54 ` LABBE Corentin
  2015-05-17 10:54 ` [PATCH 4/6] crypto: sparc/md5: " LABBE Corentin
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: LABBE Corentin @ 2015-05-17 10:54 UTC (permalink / raw)
  To: herbert, davem, ralf, benh, paulus, mpe, aaro.koskinen
  Cc: linux-mips, linux-kernel, LABBE Corentin, linux-crypto,
	sparclinux, linuxppc-dev

Since MD5 IV are now available in crypto/md5.h, use them.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 arch/powerpc/crypto/md5-glue.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/crypto/md5-glue.c b/arch/powerpc/crypto/md5-glue.c
index 452fb4d..9228967 100644
--- a/arch/powerpc/crypto/md5-glue.c
+++ b/arch/powerpc/crypto/md5-glue.c
@@ -37,10 +37,10 @@ static int ppc_md5_init(struct shash_desc *desc)
 {
 	struct md5_state *sctx = shash_desc_ctx(desc);
 
-	sctx->hash[0] = 0x67452301;
-	sctx->hash[1] = 0xefcdab89;
-	sctx->hash[2] = 0x98badcfe;
-	sctx->hash[3] =	0x10325476;
+	sctx->hash[0] = MD5_H0;
+	sctx->hash[1] = MD5_H1;
+	sctx->hash[2] = MD5_H2;
+	sctx->hash[3] =	MD5_H3;
 	sctx->byte_count = 0;
 
 	return 0;
-- 
2.3.6

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

* [PATCH 4/6] crypto: sparc/md5: use md5 IV MD5_HX instead of their raw value
  2015-05-17 10:54 [PATCH 1/6] crypto: md5: add MD5 initial vectors LABBE Corentin
  2015-05-17 10:54 ` [PATCH 2/6] crypto: md5: use md5 IV MD5_HX instead of their raw value LABBE Corentin
  2015-05-17 10:54 ` [PATCH 3/6] crypto: powerpc/md5: " LABBE Corentin
@ 2015-05-17 10:54 ` LABBE Corentin
  2015-05-17 10:54 ` [PATCH 5/6] crypto: n2: " LABBE Corentin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: LABBE Corentin @ 2015-05-17 10:54 UTC (permalink / raw)
  To: herbert, davem, ralf, benh, paulus, mpe, aaro.koskinen
  Cc: linux-mips, linux-kernel, LABBE Corentin, linux-crypto,
	sparclinux, linuxppc-dev

Since MD5 IV are now available in crypto/md5.h, use them.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 arch/sparc/crypto/md5_glue.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/sparc/crypto/md5_glue.c b/arch/sparc/crypto/md5_glue.c
index b688731..c9d2b92 100644
--- a/arch/sparc/crypto/md5_glue.c
+++ b/arch/sparc/crypto/md5_glue.c
@@ -33,10 +33,10 @@ static int md5_sparc64_init(struct shash_desc *desc)
 {
 	struct md5_state *mctx = shash_desc_ctx(desc);
 
-	mctx->hash[0] = cpu_to_le32(0x67452301);
-	mctx->hash[1] = cpu_to_le32(0xefcdab89);
-	mctx->hash[2] = cpu_to_le32(0x98badcfe);
-	mctx->hash[3] = cpu_to_le32(0x10325476);
+	mctx->hash[0] = cpu_to_le32(MD5_H0);
+	mctx->hash[1] = cpu_to_le32(MD5_H1);
+	mctx->hash[2] = cpu_to_le32(MD5_H2);
+	mctx->hash[3] = cpu_to_le32(MD5_H3);
 	mctx->byte_count = 0;
 
 	return 0;
-- 
2.3.6

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

* [PATCH 5/6] crypto: n2: use md5 IV MD5_HX instead of their raw value
  2015-05-17 10:54 [PATCH 1/6] crypto: md5: add MD5 initial vectors LABBE Corentin
                   ` (2 preceding siblings ...)
  2015-05-17 10:54 ` [PATCH 4/6] crypto: sparc/md5: " LABBE Corentin
@ 2015-05-17 10:54 ` LABBE Corentin
  2015-05-17 10:54 ` [PATCH 6/6] crypto: octeon: " LABBE Corentin
  2015-05-18  4:25 ` [PATCH 1/6] crypto: md5: add MD5 initial vectors Herbert Xu
  5 siblings, 0 replies; 7+ messages in thread
From: LABBE Corentin @ 2015-05-17 10:54 UTC (permalink / raw)
  To: herbert, davem, ralf, benh, paulus, mpe, aaro.koskinen
  Cc: linux-mips, linux-kernel, LABBE Corentin, linux-crypto,
	sparclinux, linuxppc-dev

Since MD5 IV are now available in crypto/md5.h, use them.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 drivers/crypto/n2_core.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c
index 10a9aef..2e8dab9 100644
--- a/drivers/crypto/n2_core.c
+++ b/drivers/crypto/n2_core.c
@@ -1281,10 +1281,10 @@ static const char md5_zero[MD5_DIGEST_SIZE] = {
 	0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e,
 };
 static const u32 md5_init[MD5_HASH_WORDS] = {
-	cpu_to_le32(0x67452301),
-	cpu_to_le32(0xefcdab89),
-	cpu_to_le32(0x98badcfe),
-	cpu_to_le32(0x10325476),
+	cpu_to_le32(MD5_H0),
+	cpu_to_le32(MD5_H1),
+	cpu_to_le32(MD5_H2),
+	cpu_to_le32(MD5_H3),
 };
 static const char sha1_zero[SHA1_DIGEST_SIZE] = {
 	0xda, 0x39, 0xa3, 0xee, 0x5e, 0x6b, 0x4b, 0x0d, 0x32,
-- 
2.3.6

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

* [PATCH 6/6] crypto: octeon: use md5 IV MD5_HX instead of their raw value
  2015-05-17 10:54 [PATCH 1/6] crypto: md5: add MD5 initial vectors LABBE Corentin
                   ` (3 preceding siblings ...)
  2015-05-17 10:54 ` [PATCH 5/6] crypto: n2: " LABBE Corentin
@ 2015-05-17 10:54 ` LABBE Corentin
  2015-05-18  4:25 ` [PATCH 1/6] crypto: md5: add MD5 initial vectors Herbert Xu
  5 siblings, 0 replies; 7+ messages in thread
From: LABBE Corentin @ 2015-05-17 10:54 UTC (permalink / raw)
  To: herbert, davem, ralf, benh, paulus, mpe, aaro.koskinen
  Cc: linux-mips, linux-kernel, LABBE Corentin, linux-crypto,
	sparclinux, linuxppc-dev

Since MD5 IV are now available in crypto/md5.h, use them.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
---
 arch/mips/cavium-octeon/crypto/octeon-md5.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/mips/cavium-octeon/crypto/octeon-md5.c b/arch/mips/cavium-octeon/crypto/octeon-md5.c
index 12dccdb..af4c712 100644
--- a/arch/mips/cavium-octeon/crypto/octeon-md5.c
+++ b/arch/mips/cavium-octeon/crypto/octeon-md5.c
@@ -69,10 +69,10 @@ static int octeon_md5_init(struct shash_desc *desc)
 {
 	struct md5_state *mctx = shash_desc_ctx(desc);
 
-	mctx->hash[0] = cpu_to_le32(0x67452301);
-	mctx->hash[1] = cpu_to_le32(0xefcdab89);
-	mctx->hash[2] = cpu_to_le32(0x98badcfe);
-	mctx->hash[3] = cpu_to_le32(0x10325476);
+	mctx->hash[0] = cpu_to_le32(MD5_H0);
+	mctx->hash[1] = cpu_to_le32(MD5_H1);
+	mctx->hash[2] = cpu_to_le32(MD5_H2);
+	mctx->hash[3] = cpu_to_le32(MD5_H3);
 	mctx->byte_count = 0;
 
 	return 0;
-- 
2.3.6

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

* Re: [PATCH 1/6] crypto: md5: add MD5 initial vectors
  2015-05-17 10:54 [PATCH 1/6] crypto: md5: add MD5 initial vectors LABBE Corentin
                   ` (4 preceding siblings ...)
  2015-05-17 10:54 ` [PATCH 6/6] crypto: octeon: " LABBE Corentin
@ 2015-05-18  4:25 ` Herbert Xu
  5 siblings, 0 replies; 7+ messages in thread
From: Herbert Xu @ 2015-05-18  4:25 UTC (permalink / raw)
  To: LABBE Corentin
  Cc: linux-mips, aaro.koskinen, linux-kernel, ralf, paulus,
	linux-crypto, sparclinux, linuxppc-dev, davem

On Sun, May 17, 2015 at 12:54:12PM +0200, LABBE Corentin wrote:
> This patch simply adds the MD5 IV in the md5 header.
> 
> Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>

All applied.  Thanks!
-- 
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] 7+ messages in thread

end of thread, other threads:[~2015-05-18  4:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-17 10:54 [PATCH 1/6] crypto: md5: add MD5 initial vectors LABBE Corentin
2015-05-17 10:54 ` [PATCH 2/6] crypto: md5: use md5 IV MD5_HX instead of their raw value LABBE Corentin
2015-05-17 10:54 ` [PATCH 3/6] crypto: powerpc/md5: " LABBE Corentin
2015-05-17 10:54 ` [PATCH 4/6] crypto: sparc/md5: " LABBE Corentin
2015-05-17 10:54 ` [PATCH 5/6] crypto: n2: " LABBE Corentin
2015-05-17 10:54 ` [PATCH 6/6] crypto: octeon: " LABBE Corentin
2015-05-18  4:25 ` [PATCH 1/6] crypto: md5: add MD5 initial vectors Herbert Xu

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).