summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFionnuala Gunter <fin@linux.vnet.ibm.com>2013-08-08 01:15:50 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2013-08-09 08:41:29 +0200
commitcc76daf793287b2c51b0b66153072b23cdb51c1c (patch)
tree3ce17ea23d8d01386149b9b7cc5a4a7ecaa99074
parenthwrng: omap - Add OMAP4 TRNG support (diff)
downloadlinux-cc76daf793287b2c51b0b66153072b23cdb51c1c.tar.xz
linux-cc76daf793287b2c51b0b66153072b23cdb51c1c.zip
crypto: nx - saves chaining value from co-processor
This patch fixes a bug that is triggered when cts(cbc(aes)) is used with nx-crypto driver on input larger than 32 bytes. The chaining value from co-processor was not being saved. This value is needed because it is used as the IV by cts(cbc(aes)). Signed-off-by: Fionnuala Gunter <fin@linux.vnet.ibm.com> Reviewed-by: Marcelo Cerri <mhcerri@linux.vnet.ibm.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r--drivers/crypto/nx/nx-aes-cbc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/crypto/nx/nx-aes-cbc.c b/drivers/crypto/nx/nx-aes-cbc.c
index 35d483f8db66..a2f99a910e4a 100644
--- a/drivers/crypto/nx/nx-aes-cbc.c
+++ b/drivers/crypto/nx/nx-aes-cbc.c
@@ -95,6 +95,7 @@ static int cbc_aes_nx_crypt(struct blkcipher_desc *desc,
if (rc)
goto out;
+ memcpy(desc->info, csbcpb->cpb.aes_cbc.cv, AES_BLOCK_SIZE);
atomic_inc(&(nx_ctx->stats->aes_ops));
atomic64_add(csbcpb->csb.processed_byte_count,
&(nx_ctx->stats->aes_bytes));