Projects
Eulaceura:Factory
uadk_engine
_service:obs_scm:0005-cipher-cleanup-repeated-f...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0005-cipher-cleanup-repeated-function-invoking.patch of Package uadk_engine
From 1cfb48c6d086fc82ea6b72bd9b8cb3c5cacac2b8 Mon Sep 17 00:00:00 2001 From: Zhiqi Song <songzhiqi1@huawei.com> Date: Fri, 29 Mar 2024 10:13:23 +0800 Subject: [PATCH 5/7] cipher: cleanup repeated function invoking Cleanup repeated function invoking of EVP_CIPHER_CTX_nid(). Signed-off-by: Zhiqi Song <songzhiqi1@huawei.com> Signed-off-by: JiangShui Yang <yangjiangshui@h-partners.com> --- src/uadk_cipher.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/uadk_cipher.c b/src/uadk_cipher.c index 7b4ebd8..b506c22 100644 --- a/src/uadk_cipher.c +++ b/src/uadk_cipher.c @@ -39,6 +39,7 @@ #define IV_LEN 16 #define ENV_ENABLED 1 #define MAX_KEY_LEN 64 +#define SMALL_PACKET_OFFLOAD_THRESHOLD_DEFAULT 192 struct cipher_engine { struct wd_ctx_config ctx_cfg; @@ -75,8 +76,6 @@ struct cipher_info { __u32 out_bytes; }; -#define SMALL_PACKET_OFFLOAD_THRESHOLD_DEFAULT 192 - static EVP_CIPHER *uadk_aes_128_cbc; static EVP_CIPHER *uadk_aes_192_cbc; static EVP_CIPHER *uadk_aes_256_cbc; @@ -189,9 +188,9 @@ static int uadk_e_cipher_sw_init(EVP_CIPHER_CTX *ctx, const unsigned char *key, return 0; } - sw_cipher = sec_ciphers_get_cipher_sw_impl(EVP_CIPHER_CTX_nid(ctx)); + nid = EVP_CIPHER_CTX_nid(ctx); + sw_cipher = sec_ciphers_get_cipher_sw_impl(nid); if (unlikely(sw_cipher == NULL)) { - nid = EVP_CIPHER_CTX_nid(ctx); fprintf(stderr, "get openssl software cipher failed, nid = %d.\n", nid); return 0; } -- 2.25.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2