Global variable 'sm2_order' only used in function 'sm2_update_sess' should be declared in function scope.
Signed-off-by: Zhiqi Song songzhiqi1@huawei.com --- src/uadk_sm2.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/uadk_sm2.c b/src/uadk_sm2.c index 8c75611..75d2b11 100644 --- a/src/uadk_sm2.c +++ b/src/uadk_sm2.c @@ -115,12 +115,6 @@ typedef int (*PFUNC_DEC)(EVP_PKEY_CTX *ctx, const unsigned char *in, size_t inlen);
-const unsigned char sm2_order[] = { - 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,\ - 0xff, 0xff, 0xff, 0xff, 0x72, 0x03, 0xdf, 0x6b, 0x21, 0xc6, 0x05, 0x2b,\ - 0x53, 0xbb, 0xf4, 0x09, 0x39, 0xd5, 0x41, 0x23 -}; - static int get_hash_type(int nid_hash) { switch (nid_hash) { @@ -166,6 +160,12 @@ static int compute_hash(const char *in, size_t in_len,
static int sm2_update_sess(struct sm2_ctx *smctx) { + const unsigned char sm2_order[] = { + 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x72, 0x03, 0xdf, 0x6b, 0x21, 0xc6, 0x05, 0x2b, + 0x53, 0xbb, 0xf4, 0x09, 0x39, 0xd5, 0x41, 0x23 + }; int nid_hash = smctx->ctx.md ? EVP_MD_type(smctx->ctx.md) : NID_sm3; struct wd_ecc_sess_setup setup; handle_t sess;