]> pilppa.com Git - linux-2.6-omap-h63xx.git/commit
crypto: lrw - Fix big endian support
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 17 Feb 2009 12:00:11 +0000 (20:00 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 17 Feb 2009 12:00:11 +0000 (20:00 +0800)
commit8eb2dfac41c71701bb741f496f0cb7b7e4a3c3f6
tree20b846256745f676a91d9bc97a03ed265b8c2b56
parentd2f8d7ee1a9b4650b4e43325b321801264f7c37a
crypto: lrw - Fix big endian support

It turns out that LRW has never worked properly on big endian.
This was never discussed because nobody actually used it that
way.  In fact, it was only discovered when Geert Uytterhoeven
loaded it through tcrypt which failed the test on it.

The fix is straightforward, on big endian the to find the nth
bit we should be grouping them by words instead of bytes.  So
setbit128_bbe should xor with 128 - BITS_PER_LONG instead of
128 - BITS_PER_BYTE == 0x78.

Tested-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/lrw.c