tegra-se: Set IV in UIV slot
Konduri Praveen [Wed, 31 May 2017 05:58:20 +0000 (10:58 +0530)]
Set IV in UIV slot so that when an IV is not set,
Engine will use updated IV from UIV which is
calculated from previous AES operation.

Bug 200225148

Change-Id: I16133f87a37fccf6645e7e99b4a37ebbe4e145d0
Signed-off-by: Konduri Praveen <kondurip@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1492705
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>

drivers/crypto/tegra-se.c

index 9598224..27552b1 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Support for Tegra Security Engine hardware crypto algorithms.
  *
- * Copyright (c) 2011-2015, NVIDIA Corporation. All Rights Reserved.
+ * Copyright (c) 2011-2017, NVIDIA Corporation. All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -998,7 +998,7 @@ static void tegra_se_process_new_req(struct crypto_async_request *async_req)
                        tegra_se_write_key_table(req->info,
                                TEGRA_SE_AES_IV_SIZE,
                                aes_ctx->slot->slot_num,
-                               SE_KEY_TABLE_TYPE_ORGIV);
+                               SE_KEY_TABLE_TYPE_UPDTDIV);
                }
        }
        tegra_se_setup_ablk_req(se_dev, req);
@@ -1009,7 +1009,7 @@ static void tegra_se_process_new_req(struct crypto_async_request *async_req)
                                req_ctx->encrypt, aes_ctx->keylen);
                tegra_se_config_crypto(se_dev, req_ctx->op_mode,
                        req_ctx->encrypt, aes_ctx->slot->slot_num,
-                       req->info ? true : false);
+                       false);
        }
 
        ret = tegra_se_start_operation(se_dev, req->nbytes, false);