Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 17 Feb 2009 22:22:59 +0000 (14:22 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 17 Feb 2009 22:22:59 +0000 (14:22 -0800)
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: lrw - Fix big endian support

crypto/lrw.c

index 8ef664e3bcd9a90c93a5436e551549e72df1ff82..358f80be2bf97d128ebd648887325a01ea051a70 100644 (file)
@@ -45,7 +45,13 @@ struct priv {
 
 static inline void setbit128_bbe(void *b, int bit)
 {
-       __set_bit(bit ^ 0x78, b);
+       __set_bit(bit ^ (0x80 -
+#ifdef __BIG_ENDIAN
+                        BITS_PER_LONG
+#else
+                        BITS_PER_BYTE
+#endif
+                       ), b);
 }
 
 static int setkey(struct crypto_tfm *parent, const u8 *key,