Hi:

[CRYPTO] crc32c: Fixed reversed endian annotation

The input rather than the internal state is supposed to be little-endian.

Signed-off-by: Herbert Xu <[EMAIL PROTECTED]>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/crypto/crc32c.c b/crypto/crc32c.c
--- a/crypto/crc32c.c
+++ b/crypto/crc32c.c
@@ -22,8 +22,8 @@
 #define CHKSUM_DIGEST_SIZE     4
 
 struct chksum_ctx {
-       __le32 crc;
-       __le32 key;
+       u32 crc;
+       u32 key;
 };
 
 /*
@@ -52,7 +52,7 @@ static int chksum_setkey(struct crypto_t
                tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
                return -EINVAL;
        }
-       mctx->key = cpu_to_le32(*(u32 *)key);
+       mctx->key = le32_to_cpu(*(__le32 *)key);
        return 0;
 }
 
@@ -61,14 +61,14 @@ static void chksum_update(struct crypto_
 {
        struct chksum_ctx *mctx = crypto_tfm_ctx(tfm);
 
-       mctx->crc = (__le32)crc32c((u32)mctx->crc, data, length);
+       mctx->crc = crc32c(mctx->crc, data, length);
 }
 
 static void chksum_final(struct crypto_tfm *tfm, u8 *out)
 {
        struct chksum_ctx *mctx = crypto_tfm_ctx(tfm);
        
-       *(u32 *)out = ~le32_to_cpu(mctx->crc);
+       *(__le32 *)out = ~cpu_to_le32(mctx->crc);
 }
 
 static int crc32c_cra_init(struct crypto_tfm *tfm)
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to