libwd/0108-uadk-ecc-fix-local-variable-referenced-in-macro.patch
Yang Shen ec2f993b84 libwd: backport for uadk from 2.3.31 to 2.3.36
Update some patch for uadk from mainline.
To get more information, please visit the homepage:
https://github.comp/Linaro/uadk

Signed-off-by: Yang Shen <shenyang39@huawei.com>
2022-07-28 15:32:23 +08:00

32 lines
1022 B
Diff

From 91d11133e1f6d79e38da014123ddd0b0dc132be6 Mon Sep 17 00:00:00 2001
From: Wenkai Lin <linwenkai6@hisilicon.com>
Date: Sun, 24 Apr 2022 09:54:24 +0800
Subject: [PATCH 119/183] uadk: ecc: fix local variable referenced in macro
REGULAR_LEN is is calculated by multiplying the key length
by the constant parameter num, use CURVE_PARAM_NUM is better.
Signed-off-by: Wenkai Lin <linwenkai6@hisilicon.com>
---
v1/wd_ecc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/v1/wd_ecc.c b/v1/wd_ecc.c
index 2358243..e2837bd 100644
--- a/v1/wd_ecc.c
+++ b/v1/wd_ecc.c
@@ -1822,9 +1822,8 @@ static int sm2_compute_za_hash(__u8 *za, __u32 *len, struct wd_dtb *id,
id_bytes = id->dsize;
}
-#define REGULAR_LENS (6 * key_size) /* a b xG yG xA yA */
/* ZA = h(ENTL || ID || a || b || xG || yG || xA || yA) */
- lens = sizeof(__u16) + id_bytes + REGULAR_LENS;
+ lens = sizeof(__u16) + id_bytes + CURVE_PARAM_NUM * key_size;
p_in = malloc(lens);
if (unlikely(!p_in))
return -WD_ENOMEM;
--
2.27.0