X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=crypto%2Flrw.c;h=358f80be2bf97d128ebd648887325a01ea051a70;hb=9a38e989b8ce04923f919fc2a8a24eb07fb484e2;hp=9d52e580d10a4d34b5117f801f98cf6bd4249b5c;hpb=0afc2edfada50980bec999f94dcea26ebad3dda6;p=linux-2.6-omap-h63xx.git diff --git a/crypto/lrw.c b/crypto/lrw.c index 9d52e580d10..358f80be2bf 100644 --- a/crypto/lrw.c +++ b/crypto/lrw.c @@ -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, @@ -91,8 +97,9 @@ struct sinfo { static inline void inc(be128 *iv) { - if (!(iv->b = cpu_to_be64(be64_to_cpu(iv->b) + 1))) - iv->a = cpu_to_be64(be64_to_cpu(iv->a) + 1); + be64_add_cpu(&iv->b, 1); + if (!iv->b) + be64_add_cpu(&iv->a, 1); } static inline void lrw_round(struct sinfo *s, void *dst, const void *src)