From: Jussi Kivilinna Date: Wed, 19 Sep 2012 11:24:57 +0000 (+0300) Subject: crypto: cast5/avx - fix storing of new IV in CBC encryption X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=200429cc63399e99dd2abcdca5088559a911ef2b;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git crypto: cast5/avx - fix storing of new IV in CBC encryption 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 Signed-off-by: Herbert Xu --- diff --git a/arch/x86/crypto/cast5_avx_glue.c b/arch/x86/crypto/cast5_avx_glue.c index 445aab06387b..e0ea14f9547f 100644 --- a/arch/x86/crypto/cast5_avx_glue.c +++ b/arch/x86/crypto/cast5_avx_glue.c @@ -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; }