crypto: cast5/avx - fix storing of new IV in CBC encryption
authorJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Wed, 19 Sep 2012 11:24:57 +0000 (14:24 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 27 Sep 2012 07:50:40 +0000 (15:50 +0800)
cast5/avx incorrectly XORs new IV over old IV at end of CBC encryption
function when it should store. This causes CBC encryption to give
incorrect output on multi-page encryption requests.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/cast5_avx_glue.c

index 445aab0..e0ea14f 100644 (file)
@@ -165,7 +165,7 @@ static unsigned int __cbc_encrypt(struct blkcipher_desc *desc,
                nbytes -= bsize;
        } while (nbytes >= bsize);
 
-       *(u64 *)walk->iv ^= *iv;
+       *(u64 *)walk->iv = *iv;
        return nbytes;
 }