代码拉取完成,页面将自动刷新
From f59a72aefeb714c95bddca71431e95746094d6f7 Mon Sep 17 00:00:00 2001
From: Wenkai Lin <linwenkai6@hisilicon.com>
Date: Fri, 29 Mar 2024 16:56:43 +0800
Subject: [PATCH 47/52] uadk/v1: fix for sec cipher bd1 ci_gen configuration
In storage scenarios, the XTS mode is used for encrypting and decrypting
data on and off disks. According to the definition of this mode, the input
parameter to genarate IV is the LBA, so update SEC bd1 xts mode CI_GEN
from 0 to 3, which means use LBA mode.
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
Signed-off-by: Qi Tao <taoqi10@huawei.com>
---
v1/drv/hisi_sec_udrv.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/v1/drv/hisi_sec_udrv.c b/v1/drv/hisi_sec_udrv.c
index c0bd73d..d4e090a 100644
--- a/v1/drv/hisi_sec_udrv.c
+++ b/v1/drv/hisi_sec_udrv.c
@@ -312,11 +312,10 @@ static int fill_cipher_bd1_type(struct wcrypto_cipher_msg *msg,
fill_bd_addr_type(msg->data_fmt, sqe);
- /*
- * BD1 cipher only provides ci_gen=0 for compatibility, so user
- * should prepare iv[gran_num] and iv_bytes is sum of all grans
- */
- sqe->type1.ci_gen = CI_GEN_BY_ADDR;
+ if (msg->mode == WCRYPTO_CIPHER_XTS)
+ sqe->type1.ci_gen = CI_GEN_BY_LBA;
+ else
+ sqe->type1.ci_gen = CI_GEN_BY_ADDR;
return WD_SUCCESS;
}
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。