Skip to contentSkip to conversation

crypto: cast5/avx - fix storing of new IV in CBC encryption

PATCH In review Jussi Kivilinna 2 participants 2 messages Sep 19, 2012 – Sep 27, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/crypto/cast5_avx_glue.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/crypto/cast5_avx_glue.c +1 -1
index 445aab0..e0ea14f 100644
@@ -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;
 }
 
maintainer
#1 lore raw
Quoted 5 lines · Jussi Kivilinna

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.

Patch applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt