代码拉取完成,页面将自动刷新
From cb909f390823ec007cfe62aae9cf0dc750c0de2b Mon Sep 17 00:00:00 2001
From: Zhangfei Gao <zhangfei.gao@linaro.org>
Date: Wed, 24 Jan 2024 04:06:04 +0000
Subject: [PATCH 5/8] v1: fix build error
Fix build errors, like
"'struct wcrypto_rsa_prikey1' not at the end of a struct or class",
"__TEST_WD_MEM_H not match" etc.
Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: 15859157387 <977713017@qq.com>
---
v1/test/hisi_zip_test_sgl/zip_alg_sgl.h | 2 +-
v1/test/test_mm/test_wd_mem.c | 5 -----
v1/test/test_mm/test_wd_mem.h | 2 +-
v1/wd_rsa.c | 18 ++++++++++--------
4 files changed, 12 insertions(+), 15 deletions(-)
diff --git a/v1/test/hisi_zip_test_sgl/zip_alg_sgl.h b/v1/test/hisi_zip_test_sgl/zip_alg_sgl.h
index 0baa35b..1e35069 100644
--- a/v1/test/hisi_zip_test_sgl/zip_alg_sgl.h
+++ b/v1/test/hisi_zip_test_sgl/zip_alg_sgl.h
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#ifndef __WD_ZIP_ALG_SGL__H__
+#ifndef __WD_ZIP_ALG_SGL_H__
#define __WD_ZIP_ALG_SGL_H__
#include <stdio.h>
diff --git a/v1/test/test_mm/test_wd_mem.c b/v1/test/test_mm/test_wd_mem.c
index ba873f9..09824b9 100644
--- a/v1/test/test_mm/test_wd_mem.c
+++ b/v1/test/test_mm/test_wd_mem.c
@@ -75,11 +75,6 @@ static inline unsigned long long va_to_pa(struct wd_queue *q, void *va)
return (unsigned long long)wd_iova_map(q, va, 0);
}
-static inline void *pa_to_va(struct wd_queue *q, unsigned long long pa)
-{
- return wd_dma_to_va(q, (void *)pa);
-}
-
struct mmt_queue_mempool *mmt_test_mempool_create(struct wd_queue *q,
unsigned int block_size, unsigned int block_num)
{
diff --git a/v1/test/test_mm/test_wd_mem.h b/v1/test/test_mm/test_wd_mem.h
index 8a7f561..0962b44 100644
--- a/v1/test/test_mm/test_wd_mem.h
+++ b/v1/test/test_mm/test_wd_mem.h
@@ -15,7 +15,7 @@
*/
#ifndef __TEST_WD_MEM_H
-#define ___TEST_WD_MEM_H
+#define __TEST_WD_MEM_H
#include <stdio.h>
#include <string.h>
diff --git a/v1/wd_rsa.c b/v1/wd_rsa.c
index bda8d31..2c8692b 100644
--- a/v1/wd_rsa.c
+++ b/v1/wd_rsa.c
@@ -105,8 +105,10 @@ struct wcrypto_rsa_prikey2 {
};
struct wcrypto_rsa_prikey {
- struct wcrypto_rsa_prikey1 pkey1;
- struct wcrypto_rsa_prikey2 pkey2;
+ union {
+ struct wcrypto_rsa_prikey1 pkey1;
+ struct wcrypto_rsa_prikey2 pkey2;
+ } pkey;
};
/* RSA CRT private key parameter types */
@@ -444,7 +446,7 @@ static int create_ctx_key(struct wcrypto_rsa_ctx_setup *setup,
WD_ERR("alloc prikey2 fail!\n");
return -WD_ENOMEM;
}
- pkey2 = &ctx->prikey->pkey2;
+ pkey2 = &ctx->prikey->pkey.pkey2;
memset(ctx->prikey, 0, len);
init_pkey2(pkey2, ctx->key_size);
} else {
@@ -459,7 +461,7 @@ static int create_ctx_key(struct wcrypto_rsa_ctx_setup *setup,
WD_ERR("alloc prikey1 fail!\n");
return -WD_ENOMEM;
}
- pkey1 = &ctx->prikey->pkey1;
+ pkey1 = &ctx->prikey->pkey.pkey1;
memset(ctx->prikey, 0, len);
init_pkey1(pkey1, ctx->key_size);
}
@@ -716,7 +718,7 @@ int wcrypto_set_rsa_prikey_params(void *ctx, struct wd_dtb *d, struct wd_dtb *n)
WD_ERR("ctx err in set rsa private key1!\n");
return -WD_EINVAL;
}
- pkey1 = &c->prikey->pkey1;
+ pkey1 = &c->prikey->pkey.pkey1;
if (d) {
if (d->dsize > pkey1->key_size || !d->data) {
WD_ERR("d err in set rsa private key1!\n");
@@ -750,7 +752,7 @@ void wcrypto_get_rsa_prikey_params(struct wcrypto_rsa_prikey *pvk, struct wd_dtb
return;
}
- pkey1 = &pvk->pkey1;
+ pkey1 = &pvk->pkey.pkey1;
if (d)
*d = &pkey1->d;
@@ -825,7 +827,7 @@ int wcrypto_set_rsa_crt_prikey_params(void *ctx, struct wd_dtb *dq,
return ret;
}
- pkey2 = &c->prikey->pkey2;
+ pkey2 = &c->prikey->pkey.pkey2;
ret = rsa_prikey2_param_set(pkey2, dq, WD_CRT_PRIKEY_DQ);
if (ret) {
WD_ERR("dq err in set rsa private key2!\n");
@@ -871,7 +873,7 @@ void wcrypto_get_rsa_crt_prikey_params(struct wcrypto_rsa_prikey *pvk,
return;
}
- pkey2 = &pvk->pkey2;
+ pkey2 = &pvk->pkey.pkey2;
if (dq)
*dq = &pkey2->dq;
--
2.25.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。