126 Star 3 Fork 18

src-openEuler/libwd

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0047-uadk-v1-fix-for-sec-cipher-bd1-ci_gen-configuration.patch 1.27 KB
一键复制 编辑 原始数据 按行查看 历史
JangShui Yang 提交于 2024-04-07 18:05 . libwd: update the source code
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
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/libwd.git
git@gitee.com:src-openeuler/libwd.git
src-openeuler
libwd
libwd
master

搜索帮助