40 lines
1.3 KiB
Diff
40 lines
1.3 KiB
Diff
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
|
|
|