lkml.org 
[lkml]   [2004]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [PATCH] crypto/sha256.c crypto/sha512.c
On Wed, 28 Jan 2004, Jean-Luc Cooke wrote:

> Pardon my ignorance, but does silence mean "yes"?

No, but the patch looks fine to me and passes the test vectors.

Dave, I've included it below.


- James
--
James Morris
<jmorris@redhat.com>

diff -Naur linux-2.6.1/crypto/sha256.c linux-2.6.1-patched/crypto/sha256.c
--- linux-2.6.1/crypto/sha256.c 2004-01-09 01:59:26.000000000 -0500
+++ linux-2.6.1-patched/crypto/sha256.c 2004-01-27 14:22:00.000000000 -0500
@@ -34,12 +34,12 @@

static inline u32 Ch(u32 x, u32 y, u32 z)
{
- return ((x & y) ^ (~x & z));
+ return z ^ (x & (y ^ z));
}

static inline u32 Maj(u32 x, u32 y, u32 z)
{
- return ((x & y) ^ (x & z) ^ (y & z));
+ return (x & y) | (z & (x | y));
}

static inline u32 RORu32(u32 x, u32 y)
diff -Naur linux-2.6.1/crypto/sha512.c linux-2.6.1-patched/crypto/sha512.c
--- linux-2.6.1/crypto/sha512.c 2004-01-09 02:00:03.000000000 -0500
+++ linux-2.6.1-patched/crypto/sha512.c 2004-01-27 14:22:26.000000000 -0500
@@ -34,12 +34,12 @@

static inline u64 Ch(u64 x, u64 y, u64 z)
{
- return ((x & y) ^ (~x & z));
+ return z ^ (x & (y ^ z));
}

static inline u64 Maj(u64 x, u64 y, u64 z)
{
- return ((x & y) ^ (x & z) ^ (y & z));
+ return (x & y) | (z & (x | y));
}

static inline u64 RORu64(u64 x, u64 y)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:00    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site