From f4de51503059f72c489c06d1b8822d3043761fd7 Mon Sep 17 00:00:00 2001 From: NongGuangXin <614837785@qq.com> Date: Sat, 21 Aug 2021 14:47:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9ASM3=20sm3=5Fcompute?= =?UTF-8?q?=5Fid=5Fdigest=20=E6=80=BB=E6=98=AF=E8=BF=9B=E5=85=A5=E9=BB=98?= =?UTF-8?q?=E8=AE=A4ID=E5=88=86=E6=94=AF=E3=80=82=20(#1126)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 修复:SM3 sm3_compute_id_digest 总是进入默认ID分支。 修复:SM3 sm3_compute_id_digest 总是进入默认ID分支。 * 修改代码格式 --- crypto/sm3/sm3.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/sm3/sm3.c b/crypto/sm3/sm3.c index 0ac8eda1..3b77c312 100755 --- a/crypto/sm3/sm3.c +++ b/crypto/sm3/sm3.c @@ -117,7 +117,7 @@ void sm3_compute_id_digest(unsigned char z[32], const char *id, 0x00, 0x00, 0x00, 0x00, 0x06, 0x90, }; - if (!id || strcmp(id, "1234567812345678")) { + if (!id || (strcmp(id, "1234567812345678") == 0)) { unsigned int digest[8] = { 0xadadedb5U, 0x0446043fU, 0x08a87aceU, 0xe86d2243U, 0x8e232383U, 0xbfc81fe2U, 0xcf9117c8U, 0x4707011dU,