summaryrefslogtreecommitdiff
path: root/drivers/crypto/ccp/ccp-ops.c
diff options
context:
space:
mode:
authorGary R Hook <gary.hook@amd.com>2017-02-08 22:07:06 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2017-02-15 08:20:19 +0300
commitf7cc02b3c3a33a10dd5bb9e5dfd22e47e09503a2 (patch)
tree2e401428d09921330d1540a33289d54e4848f2a4 /drivers/crypto/ccp/ccp-ops.c
parent9d12ba86f818aa9cfe9f01b750336aa441f2ffa2 (diff)
downloadlinux-f7cc02b3c3a33a10dd5bb9e5dfd22e47e09503a2.tar.xz
crypto: ccp - Set the AES size field for all modes
Ensure that the size field is correctly populated for all AES modes. Signed-off-by: Gary R Hook <gary.hook@amd.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/ccp/ccp-ops.c')
-rw-r--r--drivers/crypto/ccp/ccp-ops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index 50fae4442801..6878160234b5 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -692,6 +692,14 @@ static int ccp_run_aes_cmd(struct ccp_cmd_queue *cmd_q, struct ccp_cmd *cmd)
goto e_ctx;
}
}
+ switch (aes->mode) {
+ case CCP_AES_MODE_CFB: /* CFB128 only */
+ case CCP_AES_MODE_CTR:
+ op.u.aes.size = AES_BLOCK_SIZE * BITS_PER_BYTE - 1;
+ break;
+ default:
+ op.u.aes.size = 0;
+ }
/* Prepare the input and output data workareas. For in-place
* operations we need to set the dma direction to BIDIRECTIONAL