
From: Hao Fang <fanghao11@huawei.com> The judement is incorrect. As a result, the x448 and x25519 alg process is intercepted. So just remove it. Signed-off-by: Hao Fang <fanghao11@huawei.com> Signed-off-by: Qi Tao <taoqi10@huawei.com> --- uadk_tool/benchmark/hpre_uadk_benchmark.c | 32 ++++++++++------------- uadk_tool/benchmark/hpre_wd_benchmark.c | 32 ++++++++++------------- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/uadk_tool/benchmark/hpre_uadk_benchmark.c b/uadk_tool/benchmark/hpre_uadk_benchmark.c index 44d513da..da212b4b 100644 --- a/uadk_tool/benchmark/hpre_uadk_benchmark.c +++ b/uadk_tool/benchmark/hpre_uadk_benchmark.c @@ -2269,22 +2269,20 @@ static void *ecc_uadk_sync_run(void *arg) u32 count = 0; int ret; - memset(&sess_setup, 0, sizeof(sess_setup)); - memset(¶m, 0, sizeof(param)); - memset(&req, 0, sizeof(req)); + memset(&sess_setup, 0, sizeof(sess_setup)); + memset(¶m, 0, sizeof(param)); + memset(&req, 0, sizeof(req)); - memset(&setup, 0, sizeof(setup)); + memset(&setup, 0, sizeof(setup)); if (pdata->algtype == ECDH_256R1) cid = ECC_CURVE_SECP256R1; else cid = ECC_CURVE_SECP256K1; - if (subtype != X448_TYPE && subtype != X25519_TYPE) { - ret = get_ecc_curve(&setup, cid); - if (ret) - return NULL; - } + ret = get_ecc_curve(&setup, cid); + if (ret) + return NULL; sess_setup.key_bits = pdata->keybits; if (subtype == ECDH_TYPE || subtype == ECDSA_TYPE) { @@ -2434,22 +2432,20 @@ static void *ecc_uadk_async_run(void *arg) u32 count = 0; int i, ret; - memset(&sess_setup, 0, sizeof(sess_setup)); - memset(¶m, 0, sizeof(param)); - memset(&req, 0, sizeof(req)); + memset(&sess_setup, 0, sizeof(sess_setup)); + memset(¶m, 0, sizeof(param)); + memset(&req, 0, sizeof(req)); - memset(&setup, 0, sizeof(setup)); + memset(&setup, 0, sizeof(setup)); if (pdata->algtype == ECDH_256R1) cid = ECC_CURVE_SECP256R1; else cid = ECC_CURVE_SECP256K1; - if (subtype != X448_TYPE && subtype != X25519_TYPE) { - ret = get_ecc_curve(&setup, cid); - if (ret) - return NULL; - } + ret = get_ecc_curve(&setup, cid); + if (ret) + return NULL; sess_setup.key_bits = pdata->keybits; if (subtype == ECDH_TYPE || subtype == ECDSA_TYPE) { diff --git a/uadk_tool/benchmark/hpre_wd_benchmark.c b/uadk_tool/benchmark/hpre_wd_benchmark.c index 0196e62a..40f7f0b4 100644 --- a/uadk_tool/benchmark/hpre_wd_benchmark.c +++ b/uadk_tool/benchmark/hpre_wd_benchmark.c @@ -2107,19 +2107,17 @@ static void *ecc_wd_sync_run(void *arg) u32 count = 0; int ret; - memset(&ctx_setup, 0, sizeof(ctx_setup)); - memset(¶m, 0, sizeof(param)); - memset(&opdata, 0, sizeof(opdata)); + memset(&ctx_setup, 0, sizeof(ctx_setup)); + memset(¶m, 0, sizeof(param)); + memset(&opdata, 0, sizeof(opdata)); pool = g_thread_queue.bd_res[pdata->td_id].pool; queue = g_thread_queue.bd_res[pdata->td_id].queue; - memset(&setup, 0, sizeof(setup)); - if (subtype != X448_TYPE && subtype != X25519_TYPE) { - ret = get_ecc_curve(&setup, cid); - if (ret) - return NULL; - } + memset(&setup, 0, sizeof(setup)); + ret = get_ecc_curve(&setup, cid); + if (ret) + return NULL; ctx_setup.br.alloc = (void *)wd_alloc_blk; ctx_setup.br.free = (void *)wd_free_blk; @@ -2265,19 +2263,17 @@ static void *ecc_wd_async_run(void *arg) u32 count = 0; int i, ret; - memset(&ctx_setup, 0, sizeof(ctx_setup)); - memset(¶m, 0, sizeof(param)); - memset(&opdata, 0, sizeof(opdata)); + memset(&ctx_setup, 0, sizeof(ctx_setup)); + memset(¶m, 0, sizeof(param)); + memset(&opdata, 0, sizeof(opdata)); pool = g_thread_queue.bd_res[pdata->td_id].pool; queue = g_thread_queue.bd_res[pdata->td_id].queue; - memset(&setup, 0, sizeof(setup)); - if (subtype != X448_TYPE && subtype != X25519_TYPE) { - ret = get_ecc_curve(&setup, cid); - if (ret) - return NULL; - } + memset(&setup, 0, sizeof(setup)); + ret = get_ecc_curve(&setup, cid); + if (ret) + return NULL; ctx_setup.cb = (void *)ecc_async_cb; ctx_setup.br.alloc = (void *)wd_alloc_blk; -- 2.33.0