summaryrefslogtreecommitdiff
path: root/drivers/crypto/omap-des.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2019-11-05 17:00:53 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2019-12-11 11:36:57 +0300
commiteb5818aa08526b0004da82225b6915d787a4e4e1 (patch)
tree87fcc74f6d724684b6229d97ab2dcb93fbae7fde /drivers/crypto/omap-des.c
parente7508ef2a67416e7786d7325cffe381aded1e0b3 (diff)
downloadlinux-eb5818aa08526b0004da82225b6915d787a4e4e1.tar.xz
crypto: omap-des - add IV output handling
Currently omap-des driver does not copy end result IV out at all. This is evident with the additional checks done at the crypto test manager. Fix by copying out the IV values from HW. Signed-off-by: Tero Kristo <t-kristo@ti.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/omap-des.c')
-rw-r--r--drivers/crypto/omap-des.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/crypto/omap-des.c b/drivers/crypto/omap-des.c
index 4c4dbc2b377e..2e3ecb860e27 100644
--- a/drivers/crypto/omap-des.c
+++ b/drivers/crypto/omap-des.c
@@ -597,6 +597,7 @@ static int omap_des_crypt_req(struct crypto_engine *engine,
static void omap_des_done_task(unsigned long data)
{
struct omap_des_dev *dd = (struct omap_des_dev *)data;
+ int i;
pr_debug("enter done_task\n");
@@ -615,6 +616,11 @@ static void omap_des_done_task(unsigned long data)
omap_crypto_cleanup(&dd->out_sgl, dd->orig_out, 0, dd->total_save,
FLAGS_OUT_DATA_ST_SHIFT, dd->flags);
+ if ((dd->flags & FLAGS_CBC) && dd->req->iv)
+ for (i = 0; i < 2; i++)
+ ((u32 *)dd->req->iv)[i] =
+ omap_des_read(dd, DES_REG_IV(dd, i));
+
omap_des_finish_req(dd, 0);
pr_debug("exit\n");