Re: [PATCH] to fix vmac test fails on s390

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Wang, Shane | 2010-02-21 13:32:49 [+0800]:

>--- a/crypto/vmac.c	Thu Feb 11 00:45:57 2010 -0800
>+++ b/crypto/vmac.c	Sun Feb 21 02:23:01 2010 -0800
>@@ -42,6 +42,8 @@ const u64 m63   = UINT64_C(0x7ffffffffff
> const u64 m63   = UINT64_C(0x7fffffffffffffff);  /* 63-bit mask       */
> const u64 m64   = UINT64_C(0xffffffffffffffff);  /* 64-bit mask       */
> const u64 mpoly = UINT64_C(0x1fffffff1fffffff);  /* Poly key mask     */
>+
>+#define pe64_to_cpup le64_to_cpup		/* Prefer little endian */

Does it mean that I can switch it to be64_to_cpup ?

>@@ -575,6 +572,10 @@ static int vmac_final(struct shash_desc 
> 	u8 nonce[16] = {};
> 
> 	mac = vmac(NULL, 0, nonce, NULL, ctx);
>+
>+	/* set output invariant considering endianness */
>+	mac = le64_to_cpup(&mac);
So this is the fix. It would look better if you would include this
swap into vmac() itself. I'm not sure but this is probably causing a
dereference which could be avoided.
sparse should catch conversion bugs like this one if you were using
types likes __be64.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux