From nobody Sat Nov 23 18:22:29 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1730188292; cv=none; d=zohomail.com; s=zohoarc; b=ItH1joOZgVtWj4LJZ+SywxbiG9c6E9v3c/RJ61xZI2+AB7Ur6d5j+HdRLXRba3z56rRk5nIFouHSpguI5jxdC8xg/G+uX4LXva/wA+m+FVQRBtZImWY3dITkc2nirm1vnikk+VTpJPMFdMQjh/XSVTqEYtd4S664OS+N2n2PShI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1730188292; h=Content-Type:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=qVLbWbPIqHf+ZZsIgP9gSm843+63gJc4LCL7vT2xgEY=; b=F1lzFeAX/qHwaEQ1ZOqbSg8hKuV7AG28I46YcaTSO624xnFeyAei1f6qvSr2C/ZvBLbTRCneBpkn9JafXi7BInXcUgeH35KKf4S7Nz6ZJE2fWhetcVm2IS6cjEZ0X7EOkMyYNBWZMjy54/f2HTD4IzuVcoad5lUpiVr3/wS1DxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173018829267128.69132151498809; Tue, 29 Oct 2024 00:51:32 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1t5h08-0004oi-DA; Tue, 29 Oct 2024 03:50:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1t5h06-0004oU-Fh for qemu-devel@nongnu.org; Tue, 29 Oct 2024 03:50:50 -0400 Received: from mail-qv1-xf2a.google.com ([2607:f8b0:4864:20::f2a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1t5h02-0002IY-71 for qemu-devel@nongnu.org; Tue, 29 Oct 2024 03:50:49 -0400 Received: by mail-qv1-xf2a.google.com with SMTP id 6a1803df08f44-6cbf347dc66so33263326d6.3 for ; Tue, 29 Oct 2024 00:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730188244; x=1730793044; darn=nongnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=qVLbWbPIqHf+ZZsIgP9gSm843+63gJc4LCL7vT2xgEY=; b=coaoufJ5+xaT8yQ8YVCa6wAgHjLboTLr/7fnLrdFp8VIb5r23LYRVblru6ixVXjWrU IhWTr/wBYEotwu4eBH1IA1PmkzrsuU5JroW2o61dhe3Fe2S1A9Svq6vboTbtMl59pzat xblMFuG2qxUuEUpJtyDSphU1qDOoL9NheDzm5yfK/wqiGSwE3WDzcqNH+FDNnf7dDLEQ CJgGDVF0gmVh3dxX8J6AUN3w/QP2avAMmSSeGQIjzYNsYYopd8Lruez0MOim7Hm49yL/ 9tkJgf7NYPPgoHf4jpt30YcLBGWiQBtOS+OLlW1S0NjuWIMHgfZzxNTFAJ0I3VMFThbE /qCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730188244; x=1730793044; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=qVLbWbPIqHf+ZZsIgP9gSm843+63gJc4LCL7vT2xgEY=; b=k/KYE3tiuTprujOHx45k7RrFuu1wTr6gbEt0FRKUjaQkOS6xk3zrHnFHCMR/hfDjGT 2Ve5El3k0by0YYDk/NqT080II+P3Uq5brNDRARK+AvU7kkrHd8RXVFd8z5qAeom5TNYk wchcVnNJ5eo+Q7RBoaCrCvfH/smr5NHU2vF8SOexVeygpKUmxmMJWW0lA5yuhB6KaE+q omwVld0WutD4Vs9/vAL6E4j189C0EDWv2SpnNpx78g5+P4TevvS49RmoxsbJIr53E5AB CmX8fgrXKaaZZw6t47McYZ8f6jpc8WBOsvxfUKuiWeGS4f7qhv1jFe5eUrych3rzUGkt WbGg== X-Gm-Message-State: AOJu0YxbZ0DYfbZap6EvDbc2js732ZCjkXWByhWXne2W7ANtMXkjtXc2 iCd+9tZbMpuGg18SksCGzFtNIJgLJT5nJwPr0kifQY1VFYaDu1bMpsDopKJ67Q0xriOpMeDpiGa emanXK9MRf/aNm+PRzxo1Kyyylc1fBcZT X-Google-Smtp-Source: AGHT+IGg3O4b5Vr42iFXe/Ni2+zEuysk3WZ+uzefp6C5Tin19OseS6JUTDubtluSmyConc8Ds1lvIppw/PmcIkmAwG8= X-Received: by 2002:a05:6214:5910:b0:6ce:37cc:4911 with SMTP id 6a1803df08f44-6d18567ca36mr187179216d6.8.1730188244276; Tue, 29 Oct 2024 00:50:44 -0700 (PDT) MIME-Version: 1.0 From: liequan che Date: Tue, 29 Oct 2024 15:50:33 +0800 Message-ID: Subject: [PATCH] crypto: Introduce SM3 hash hmac pbkdf algorithm To: qemu-devel@nongnu.org Content-Type: multipart/alternative; boundary="000000000000b1dec4062598d7c1" Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::f2a; envelope-from=liequanche@gmail.com; helo=mail-qv1-xf2a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1730188293976116600 Content-Transfer-Encoding: quoted-printable --000000000000b1dec4062598d7c1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 SW50cm9kdWNlIHRoZSBTTTMgY3J5cHRvZ3JhcGhpYyBoYXNoIGFsZ29yaXRobSAoR0IvVCAzMjkw NS0yMDE2KS4KClNNMyAoR0IvVCAzMjkwNS0yMDE2KSBpcyBhIGNyeXB0b2dyYXBoaWMgc3RhbmRh cmQgaXNzdWVkIGJ5IHRoZQpPcmdhbml6YXRpb24gb2YgU3RhdGUgQ29tbWVyY2lhbCBDcnlwdG9n cmFwaHkgQWRtaW5pc3RyYXRpb24gKE9TQ0NBKQphcyBhbiBhdXRob3JpemVkIGNyeXB0b2dyYXBo aWMgYWxnb3JpdGhtIGZvciB1c2Ugd2l0aGluIENoaW5hLgoKRGV0ZWN0IHRoZSBTTTMgY3J5cHRv Z3JhcGhpYyBoYXNoIGFsZ29yaXRobSBhbmQgZW5hYmxlIHRoZSBmZWF0dXJlIHNpbGVudGx5Cmlm IGl0IGlzIGF2YWlsYWJsZS4KClNpZ25lZC1vZmYtYnk6IGNoZWxpZXF1YW4gPGNoZWxpZXF1YW5A aW5zcHVyLmNvbT4KLS0tCiBjcnlwdG8vaGFzaC1nY3J5cHQuYyAgICAgICAgICAgfCAgMyArKysK IGNyeXB0by9oYXNoLW5ldHRsZS5jICAgICAgICAgICB8IDE0ICsrKysrKysrKysrKwogY3J5cHRv L2hhc2guYyAgICAgICAgICAgICAgICAgIHwgIDMgKysrCiBjcnlwdG8vaG1hYy1nY3J5cHQuYyAg ICAgICAgICAgfCAgMyArKysKIGNyeXB0by9obWFjLW5ldHRsZS5jICAgICAgICAgICB8IDExICsr KysrKysrKysKIGNyeXB0by9wYmtkZi1nY3J5cHQuYyAgICAgICAgICB8ICA2ICsrKysrKwogY3J5 cHRvL3Bia2RmLW5ldHRsZS5jICAgICAgICAgIHwgMTMgKysrKysrKysrKysrCiBtZXNvbi5idWls ZCAgICAgICAgICAgICAgICAgICAgfCAzOSArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr KysrCiBxYXBpL2NyeXB0by5qc29uICAgICAgICAgICAgICAgfCAgNCArKystCiB0ZXN0cy91bml0 L3Rlc3QtY3J5cHRvLWhhc2guYyAgfCAxNiArKysrKysrKysrKysrKwogdGVzdHMvdW5pdC90ZXN0 LWNyeXB0by1obWFjLmMgIHwgIDggKysrKysrKwogdGVzdHMvdW5pdC90ZXN0LWNyeXB0by1wYmtk Zi5jIHwgMTYgKysrKysrKysrKysrKysKIDEyIGZpbGVzIGNoYW5nZWQsIDEzNSBpbnNlcnRpb25z KCspLCAxIGRlbGV0aW9uKC0pCgpkaWZmIC0tZ2l0IGEvY3J5cHRvL2hhc2gtZ2NyeXB0LmMgYi9j cnlwdG8vaGFzaC1nY3J5cHQuYwppbmRleCA4MjllNDgyNThkLi5kM2JkZmU1NjMzIDEwMDY0NAot LS0gYS9jcnlwdG8vaGFzaC1nY3J5cHQuYworKysgYi9jcnlwdG8vaGFzaC1nY3J5cH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YXNoLAogICAgICAgICBzdHJ1Y3QgaG1h Y19zaGEzODRfY3R4IHNoYTM4NDsKICAgICAgICAgc3RydWN0IGhtYWNfc2hhNTEyX2N0eCBzaGE1 MTI7CiAgICAgICAgIHN0cnVjdCBobWFjX3JpcGVtZDE2MF9jdHggcmlwZW1kMTYwOworI2lmZGVm IENPTkZJR19DUllQVE9fU00zCisgICAgICAgIHN0cnVjdCBobWFjX3NtM19jdHggc20zOworI2Vu ZGlmCiAgICAgfSBjdHg7CgogICAgIGlmIChpdGVyYXRpb25zID4gVUlOVF9NQVgpIHsKQEAgLTEw Niw2ICsxMTIsMTMgQEAgaW50IHFjcnlwdG9fcGJrZGYyKFFDcnlwdG9IYXNoQWxnb3JpdGhtIGhh c2gsCiAgICAgICAgIFBCS0RGMigmY3R4LnJpcGVtZDE2MCwgaG1hY19yaXBlbWQxNjBfdXBkYXRl LApobWFjX3JpcGVtZDE2MF9kaWdlc3QsCiAgICAgICAgICAgICAgICBSSVBFTUQxNjBfRElHRVNU X1NJWkUsIGl0ZXJhdGlvbnMsIG5zYWx0LCBzYWx0LCBub3V0LCBvdXQpOwogICAgICAgICBicmVh azsKKyNpZmRlZiBDT05GSUdfQ1JZUFRPX1NNMworICAgIGNhc2UgUUNSWVBUT19IQVNIX0FMR19T TTM6CisgICAgICAgIGhtYWNfc20zX3NldF9rZXkoJmN0eC5zbTMsIG5rZXksIGtleSk7CisgICAg ICAgIFBCS0RGMigmY3R4LnNtMywgaG1hY19zbTNfdXBkYXRlLCBobWFjX3NtM19kaWdlc3QsCisg ICAgICAgICAgICAgICBTTTNfRElHRVNUX1NJWkUsIGl0ZXJhdGlvbnMsIG5zYWx0LCBzYWx0LCBu b3V0LCBvdXQpOworICAgICAgICBicmVhazsKKyNlbmRpZgoKICAgICBkZWZhdWx0OgogICAgICAg ICBlcnJvcl9zZXRnX2Vycm5vKGVycnAsIEVOT1NZUywKZGlmZiAtLWdpdCBhL21lc29uLmJ1aWxk IGIvbWVzb24uYnVp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AubnNhbHQgPTNEIDIx LAorICAgICAgICAub3V0ID0zRCAiXHg0OFx4NzFceDFiXHg1OFx4YTNceGNiXHhjZVx4MDYiCisg Ilx4YmFceGFkXHg3N1x4YThceGI1XHhiOVx4ZDhceDA3IgorICJceDZhXHhlMlx4YjNceDViXHg5 NVx4Y2VceGM4XHhjZSIKKyAiXHhlN1x4YjFceGNiXHhlZVx4NjFceGRmXHgwNFx4ZWEiLAorICAg ICAgICAubm91dCA9M0QgMzIKKyAgICB9LAorI2VuZGlmCiAjaWYgMAogICAgIHsKICAgICAgICAg LnBhdGggPTNEICIvY3J5cHRvL3Bia2RmL25vbnJmYy93aGlybHBvb2wvaXRlcjEyMDAiLAotLT0y MAoyLjQ0LjAud2luZG93cy4x --000000000000b1dec4062598d7c1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Introduce the SM3 cryptographic hash algorithm (GB/T 32905= -2016).

SM3 (GB/T 32905-2016) is a cryptographic standard issued by = the
Organization of State Commercial Cryptography Administration (OSCCA)=
as an authorized cryptographic algorithm for use within China.

D= etect the SM3 cryptographic hash algorithm and enable the feature silently<= br>if it is available.

Signed-off-by: cheliequan <cheliequan@inspur.com>
---
=C2=A0cry= pto/hash-gcrypt.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A03 +++
=C2= =A0crypto/hash-nettle.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | 14 +++++++++++= +
=C2=A0crypto/hash.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0| =C2=A03 +++
=C2=A0crypto/hmac-gcrypt.c =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 | =C2=A03 +++
=C2=A0crypto/hmac-nettle.c =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 | 11 ++++++++++
=C2=A0crypto/pbkdf-gcrypt.c =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0| =C2=A06 ++++++
=C2=A0crypto/pbkdf-nettle.c= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 13 ++++++++++++
=C2=A0meson.build = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| 39 += +++++++++++++++++++++++++++++++++
=C2=A0qapi/crypto.json =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A04 +++-
=C2=A0tests/unit/test-= crypto-hash.c =C2=A0| 16 ++++++++++++++
=C2=A0tests/unit/test-crypto-hma= c.c =C2=A0| =C2=A08 +++++++
=C2=A0tests/unit/test-crypto-pbkdf.c | 16 ++= ++++++++++++
=C2=A012 files changed, 135 insertions(+), 1 deletion(-)
diff --git a/crypto/hash-gcrypt.c b/crypto/hash-gcrypt.c
index 829e= 48258d..d3bdfe5633 100644
--- a/crypto/hash-gcrypt.c
+++ b/crypto/has= h-gcrypt.c
@@ -33,6 +33,9 @@ static int qcrypto_hash_alg_map[QCRYPTO_HAS= H_ALG__MAX] =3D {
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA384] =3D GCRY= _MD_SHA384,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA512] =3D GCRY_MD_SH= A512,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_RIPEMD160] =3D GCRY_MD_RMD16= 0,
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SM3] = =3D GCRY_MD_SM3,
+#endif
=C2=A0};
=C2=A0
=C2=A0gboolean qcrypto= _hash_supports(QCryptoHashAlgorithm alg)
diff --git a/crypto/hash-nettle= .c b/crypto/hash-nettle.c
index 1ca1a41062..0c2f8ce86c 100644
--- a/c= rypto/hash-nettle.c
+++ b/crypto/hash-nettle.c
@@ -25,6 +25,9 @@
= =C2=A0#include <nettle/md5.h>
=C2=A0#include <nettle/sha.h><= br>=C2=A0#include <nettle/ripemd160.h>
+#ifdef CONFIG_CRYPTO_SM3+#include <nettle/sm3.h>
+#endif
=C2=A0
=C2=A0typedef void= (*qcrypto_nettle_init)(void *ctx);
=C2=A0typedef void (*qcrypto_nettle_= write)(void *ctx,
@@ -42,6 +45,9 @@ union qcrypto_hash_ctx {
=C2=A0 = =C2=A0 =C2=A0struct sha384_ctx sha384;
=C2=A0 =C2=A0 =C2=A0struct sha512= _ctx sha512;
=C2=A0 =C2=A0 =C2=A0struct ripemd160_ctx ripemd160;
+#if= def CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0struct sm3_ctx sm3;
+#endif
= =C2=A0};
=C2=A0
=C2=A0struct qcrypto_hash_alg {
@@ -92,6 +98,14 @@= struct qcrypto_hash_alg {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.result =3D= (qcrypto_nettle_result)ripemd160_digest,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0.len =3D RIPEMD160_DIGEST_SIZE,
=C2=A0 =C2=A0 =C2=A0},
+#ifdef = CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SM3] =3D {
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0.init =3D (qcrypto_nettle_init)sm3_init,
+ =C2= =A0 =C2=A0 =C2=A0 =C2=A0.write =3D (qcrypto_nettle_write)sm3_update,
+ = =C2=A0 =C2=A0 =C2=A0 =C2=A0.result =3D (qcrypto_nettle_result)sm3_digest,+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.len =3D SM3_DIGEST_SIZE,
+ =C2=A0 =C2=A0= },
+#endif
=C2=A0};
=C2=A0
=C2=A0gboolean qcrypto_hash_supports= (QCryptoHashAlgorithm alg)
diff --git a/crypto/hash.c b/crypto/hash.cindex b0f8228bdc..8f1502ce68 100644
--- a/crypto/hash.c
+++ b/crypto= /hash.c
@@ -30,6 +30,9 @@ static size_t qcrypto_hash_alg_size[QCRYPTO_HA= SH_ALG__MAX] =3D {
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA384] =3D 48,=
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA512] =3D 64,
=C2=A0 =C2=A0 = =C2=A0[QCRYPTO_HASH_ALG_RIPEMD160] =3D 20,
+#ifdef CONFIG_CRYPTO_SM3
= + =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SM3] =3D 32,
+#endif
=C2=A0};
=C2= =A0
=C2=A0size_t qcrypto_hash_digest_len(QCryptoHashAlgorithm alg)
di= ff --git a/crypto/hmac-gcrypt.c b/crypto/hmac-gcrypt.c
index 0c6f979711.= .888afb86ed 100644
--- a/crypto/hmac-gcrypt.c
+++ b/crypto/hmac-gcryp= t.c
@@ -26,6 +26,9 @@ static int qcrypto_hmac_alg_map[QCRYPTO_HASH_ALG__= MAX] =3D {
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA384] =3D GCRY_MAC_HM= AC_SHA384,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA512] =3D GCRY_MAC_HM= AC_SHA512,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_RIPEMD160] =3D GCRY_MAC= _HMAC_RMD160,
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0[QCRYPTO_HASH_= ALG_SM3] =3D GCRY_MAC_HMAC_SM3,
+#endif
=C2=A0};
=C2=A0
=C2=A0t= ypedef struct QCryptoHmacGcrypt QCryptoHmacGcrypt;
diff --git a/crypto/h= mac-nettle.c b/crypto/hmac-nettle.c
index 1ad6c4f253..e51e3319ab 100644<= br>--- a/crypto/hmac-nettle.c
+++ b/crypto/hmac-nettle.c
@@ -38,6 +38= ,9 @@ struct QCryptoHmacNettle {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struc= t hmac_sha256_ctx sha256_ctx; /* equals hmac_sha224_ctx */
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0struct hmac_sha512_ctx sha512_ctx; /* equals hmac_sha3= 84_ctx */
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hmac_ripemd160_ctx ri= pemd160_ctx;
+#ifdef CONFIG_CRYPTO_SM3
+ struct hmac_sm3_ctx ctx;
= +#endif
=C2=A0 =C2=A0 =C2=A0} u;
=C2=A0};
=C2=A0
@@ -89,6 +92,1= 4 @@ struct qcrypto_nettle_hmac_alg {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= .digest =3D (qcrypto_nettle_hmac_digest)hmac_ripemd160_digest,
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0.len =3D RIPEMD160_DIGEST_SIZE,
=C2=A0 =C2=A0= =C2=A0},
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_= SM3] =3D {
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.setkey =3D (qcrypto_nettle_hmac= _setkey)hmac_sm3_set_key,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.update =3D (qcry= pto_nettle_hmac_update)hmac_sm3_update,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.di= gest =3D (qcrypto_nettle_hmac_digest)hmac_sm3_digest,
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0.len =3D SM3_DIGEST_SIZE,
+ =C2=A0 =C2=A0},
+#endif
= =C2=A0};
=C2=A0
=C2=A0bool qcrypto_hmac_supports(QCryptoHashAlgorithm= alg)
diff --git a/crypto/pbkdf-gcrypt.c b/crypto/pbkdf-gcrypt.c
inde= x a8d8e64f4d..09b38d0d6e 100644
--- a/crypto/pbkdf-gcrypt.c
+++ b/cry= pto/pbkdf-gcrypt.c
@@ -33,6 +33,9 @@ bool qcrypto_pbkdf2_supports(QCrypt= oHashAlgorithm hash)
=C2=A0 =C2=A0 =C2=A0case QCRYPTO_HASH_ALG_SHA384:=C2=A0 =C2=A0 =C2=A0case QCRYPTO_HASH_ALG_SHA512:
=C2=A0 =C2=A0 =C2=A0= case QCRYPTO_HASH_ALG_RIPEMD160:
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 = =C2=A0case QCRYPTO_HASH_ALG_SM3:
+#endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0return true;
=C2=A0 =C2=A0 =C2=A0default:
=C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0return false;
@@ -54,6 +57,9 @@ int qcrypto_pbkdf2(QCryptoH= ashAlgorithm hash,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_S= HA384] =3D GCRY_MD_SHA384,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[QCRYPTO_HA= SH_ALG_SHA512] =3D GCRY_MD_SHA512,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0[QC= RYPTO_HASH_ALG_RIPEMD160] =3D GCRY_MD_RMD160,
+#ifdef CONFIG_CRYPTO_SM3<= br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SM3] =3D GCRY_MD_SM3,
= +#endif
=C2=A0 =C2=A0 =C2=A0};
=C2=A0 =C2=A0 =C2=A0int ret;
=C2=A0=
diff --git a/crypto/pbkdf-nettle.c b/crypto/pbkdf-nettle.c
index d62= 93c25a1..5fea570bd3 100644
--- a/crypto/pbkdf-nettle.c
+++ b/crypto/p= bkdf-nettle.c
@@ -34,6 +34,9 @@ bool qcrypto_pbkdf2_supports(QCryptoHash= Algorithm hash)
=C2=A0 =C2=A0 =C2=A0case QCRYPTO_HASH_ALG_SHA384:
=C2= =A0 =C2=A0 =C2=A0case QCRYPTO_HASH_ALG_SHA512:
=C2=A0 =C2=A0 =C2=A0case = QCRYPTO_HASH_ALG_RIPEMD160:
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0= case QCRYPTO_HASH_ALG_SM3:
+#endif
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= return true;
=C2=A0 =C2=A0 =C2=A0default:
=C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0return false;
@@ -55,6 +58,9 @@ int qcrypto_pbkdf2(QCryptoHashAlg= orithm hash,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hmac_sha384_ctx sh= a384;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hmac_sha512_ctx sha512;=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hmac_ripemd160_ctx ripemd160;+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0struct hmac_sm3_= ctx sm3;
+#endif
=C2=A0 =C2=A0 =C2=A0} ctx;
=C2=A0
=C2=A0 =C2= =A0 =C2=A0if (iterations > UINT_MAX) {
@@ -106,6 +112,13 @@ int qcryp= to_pbkdf2(QCryptoHashAlgorithm hash,
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0P= BKDF2(&ctx.ripemd160, hmac_ripemd160_update, hmac_ripemd160_digest,
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 RIPEMD160_DIGEST_SI= ZE, iterations, nsalt, salt, nout, out);
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0break;
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0case QCRYPTO_HASH_= ALG_SM3:
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0hmac_sm3_set_key(&ctx.sm3, nke= y, key);
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0PBKDF2(&ctx.sm3, hmac_sm3_upda= te, hmac_sm3_digest,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = SM3_DIGEST_SIZE, iterations, nsalt, salt, nout, out);
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0break;
+#endif
=C2=A0
=C2=A0 =C2=A0 =C2=A0default:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0error_setg_errno(errp, ENOSYS,
diff -= -git a/meson.build b/meson.build
index 089f45d386..4024f9a4bb 100644
= --- a/meson.build
+++ b/meson.build
@@ -1486,6 +1486,7 @@ gcrypt =3D = not_found
=C2=A0nettle =3D not_found
=C2=A0hogweed =3D not_found
= =C2=A0crypto_sm4 =3D not_found
+crypto_sm3 =3D not_found
=C2=A0xts = =3D 'none'
=C2=A0
=C2=A0if get_option('nettle').enabl= ed() and get_option('gcrypt').enabled()
@@ -1522,6 +1523,17 @@ i= f not gnutls_crypto.found()
=C2=A0 =C2=A0 =C2=A0 =C2=A0}''',= dependencies: gcrypt)
=C2=A0 =C2=A0 =C2=A0 =C2=A0crypto_sm4 =3D not_fou= nd
=C2=A0 =C2=A0 =C2=A0endif
+ =C2=A0 =C2=A0crypto_sm3 =3D gcrypt
= + =C2=A0 =C2=A0# SM3 ALG is available in libgcrypt >=3D 1.8
+ =C2=A0 = =C2=A0if gcrypt.found() and not cc.links('''
+ =C2=A0 =C2=A0= =C2=A0#include <gcrypt.h>
+ =C2=A0 =C2=A0 =C2=A0int main(void) {<= br>+ =C2=A0 =C2=A0 =C2=A0 =C2=A0gcry_md_hd_t handler;
+ =C2=A0 =C2=A0 = =C2=A0 =C2=A0gcry_md_open(&handler, GCRY_MD_SM3, 0);
+ =C2=A0 =C2=A0= =C2=A0 =C2=A0return 0;
+ =C2=A0 =C2=A0 =C2=A0}''', dependen= cies: gcrypt)
+ =C2=A0 =C2=A0 =C2=A0crypto_sm3 =3D not_found
+ =C2=A0= =C2=A0endif
=C2=A0 =C2=A0endif
=C2=A0 =C2=A0if (not get_option('= nettle').auto() or have_system) and not gcrypt.found()
=C2=A0 =C2=A0= =C2=A0nettle =3D dependency('nettle', version: '>=3D3.4'= ;,
@@ -1542,6 +1554,31 @@ if not gnutls_crypto.found()
=C2=A0 =C2=A0 = =C2=A0 =C2=A0}''', dependencies: nettle)
=C2=A0 =C2=A0 =C2= =A0 =C2=A0crypto_sm4 =3D not_found
=C2=A0 =C2=A0 =C2=A0endif
+ =C2=A0= =C2=A0crypto_sm3 =3D nettle
+ =C2=A0 =C2=A0# SM3 ALG is available in ne= ttle >=3D 3.4
+ =C2=A0 =C2=A0if nettle.found() and not cc.links('= ''
+ =C2=A0 =C2=A0 =C2=A0#include <nettle/sm3.h>
+ =C2= =A0 =C2=A0 =C2=A0#include <nettle/hmac.h>
+ =C2=A0 =C2=A0 =C2=A0in= t main(void) {
+ =C2=A0 =C2=A0 =C2=A0struct sm3_ctx ctx;
+ =C2=A0 =C2= =A0 =C2=A0struct hmac_sm3_ctx hmac_ctx;
+ =C2=A0 =C2=A0 =C2=A0unsigned c= har data[64] =3D {0};
+ =C2=A0 =C2=A0 =C2=A0unsigned char output[32];+ =C2=A0 =C2=A0
+ =C2=A0 =C2=A0 =C2=A0// SM3 hash function test
+ = =C2=A0 =C2=A0 =C2=A0sm3_init(&ctx);
+ =C2=A0 =C2=A0 =C2=A0sm3_update= (&ctx, 64, data);
+ =C2=A0 =C2=A0 =C2=A0sm3_digest(&ctx, 32, dat= a);
+
+ =C2=A0 =C2=A0 =C2=A0// HMAC-SM3 test
+ =C2=A0 =C2=A0 =C2= =A0hmac_sm3_set_key(&hmac_ctx, 32, data);
+ =C2=A0 =C2=A0 =C2=A0hmac= _sm3_update(&hmac_ctx, 64, data);
+ =C2=A0 =C2=A0 =C2=A0hmac_sm3_dig= est(&hmac_ctx, 32, output);
+ =C2=A0 =C2=A0
+ =C2=A0 =C2=A0 =C2= =A0return 0;
+ =C2=A0 =C2=A0 =C2=A0}''', dependencies: nettl= e)
+ =C2=A0 =C2=A0 =C2=A0crypto_sm3 =3D not_found
+ =C2=A0 =C2=A0endi= f
=C2=A0 =C2=A0endif
=C2=A0endif
=C2=A0
@@ -2229,6 +2266,7 @@ c= onfig_host_data.set('CONFIG_TASN1', tasn1.found())
=C2=A0config_= host_data.set('CONFIG_GCRYPT', gcrypt.found())
=C2=A0config_host= _data.set('CONFIG_NETTLE', nettle.found())
=C2=A0config_host_dat= a.set('CONFIG_CRYPTO_SM4', crypto_sm4.found())
+config_host_data= .set('CONFIG_CRYPTO_SM3', crypto_sm3.found())
=C2=A0config_host_= data.set('CONFIG_HOGWEED', hogweed.found())
=C2=A0config_host_da= ta.set('CONFIG_QEMU_PRIVATE_XTS', xts =3D=3D 'private')
= =C2=A0config_host_data.set('CONFIG_MALLOC_TRIM', has_malloc_trim)@@ -4306,6 +4344,7 @@ if nettle.found()
=C2=A0 =C2=A0 summary_info += =3D {' =C2=A0XTS': =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 xts != =3D 'private'}
=C2=A0endif
=C2=A0summary_info +=3D {'SM4 = ALG support': =C2=A0 crypto_sm4}
+summary_info +=3D {'SM3 ALG su= pport': =C2=A0 crypto_sm3}
=C2=A0summary_info +=3D {'AF_ALG supp= ort': =C2=A0 =C2=A0have_afalg}
=C2=A0summary_info +=3D {'rng-non= e': =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0get_option('rng_none')}=C2=A0summary_info +=3D {'Linux keyring': =C2=A0 =C2=A0 have_keyr= ing}
diff --git a/qapi/crypto.json b/qapi/crypto.json
index 2f2aeff5f= d..af38f0a4bd 100644
--- a/qapi/crypto.json
+++ b/qapi/crypto.json@@ -58,11 +58,13 @@
=C2=A0#
=C2=A0# @ripemd160: RIPEMD-160. (since 2= .7)
=C2=A0#
+# @sm3: SM3. (since 8.2.0)
+#
=C2=A0# Since: 2.6=C2=A0##
=C2=A0{ 'enum': 'QCryptoHashAlgorithm',
= =C2=A0 =C2=A0'prefix': 'QCRYPTO_HASH_ALG',
- =C2=A0'= data': ['md5', 'sha1', 'sha224', 'sha256= 9;, 'sha384', 'sha512', 'ripemd160']}
+ =C2=A0&#= 39;data': ['md5', 'sha1', 'sha224', 'sha256= ', 'sha384', 'sha512', 'ripemd160', 'sm3= 9;]}
=C2=A0
=C2=A0##
=C2=A0# @QCryptoCipherAlgorithm:
diff --gi= t a/tests/unit/test-crypto-hash.c b/tests/unit/test-crypto-hash.c
index = 1f4abb822b..61908e1769 100644
--- a/tests/unit/test-crypto-hash.c
+++= b/tests/unit/test-crypto-hash.c
@@ -42,6 +42,9 @@
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"63b= 54e4cb2d2032b393994aa263c0dbb" \
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"e00a9f2fe9ef60373522= 32a1eec55ee7"
=C2=A0#define OUTPUT_RIPEMD160 "f3d658fad3fdfb2b= 52c9369cf0d441249ddfa8a0"
+#ifdef CONFIG_CRYPTO_SM3
+#define OUT= PUT_SM3 "d4a97db105b477b84c4f20ec9c31a6c814e2705a0b83a5a89748d75f0ef45= 6a1"
+#endif
=C2=A0
=C2=A0#define OUTPUT_MD5_B64 "Yo0gY3= FWMDWrjvYvSSveyQ=3D=3D"
=C2=A0#define OUTPUT_SHA1_B64 "sudPJnW= KOkIeUJzuBFJEt4dTzAI=3D"
@@ -54,6 +57,10 @@
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0"7sVe5w=3D=3D"
=C2=A0#define OUTPUT_RIPEMD160_B64 "89Z= Y+tP9+ytSyTac8NRBJJ3fqKA=3D"
=C2=A0
+#ifdef CONFIG_CRYPTO_SM3+#define OUTPUT_SM3_B64 "1Kl9sQW0d7hMTyDsnDGmyBTicFoLg6Wol0jXXw70VqE= =3D"
+#endif
+
=C2=A0static const char *expected_outputs[] = =3D {
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_MD5] =3D OUTPUT_MD5,
=C2= =A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA1] =3D OUTPUT_SHA1,
@@ -62,6 +69,9= @@ static const char *expected_outputs[] =3D {
=C2=A0 =C2=A0 =C2=A0[QCR= YPTO_HASH_ALG_SHA384] =3D OUTPUT_SHA384,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HA= SH_ALG_SHA512] =3D OUTPUT_SHA512,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_= RIPEMD160] =3D OUTPUT_RIPEMD160,
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 = =C2=A0[QCRYPTO_HASH_ALG_SM3] =3D OUTPUT_SM3,
+#endif
=C2=A0};
=C2= =A0static const char *expected_outputs_b64[] =3D {
=C2=A0 =C2=A0 =C2=A0[= QCRYPTO_HASH_ALG_MD5] =3D OUTPUT_MD5_B64,
@@ -71,6 +81,9 @@ static const= char *expected_outputs_b64[] =3D {
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_AL= G_SHA384] =3D OUTPUT_SHA384_B64,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_S= HA512] =3D OUTPUT_SHA512_B64,
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_RIPE= MD160] =3D OUTPUT_RIPEMD160_B64,
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 = =C2=A0[QCRYPTO_HASH_ALG_SM3] =3D OUTPUT_SM3_B64,
+#endif
=C2=A0};
= =C2=A0static const int expected_lens[] =3D {
=C2=A0 =C2=A0 =C2=A0[QCRYPT= O_HASH_ALG_MD5] =3D 16,
@@ -80,6 +93,9 @@ static const int expected_lens= [] =3D {
=C2=A0 =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA384] =3D 48,
=C2=A0= =C2=A0 =C2=A0[QCRYPTO_HASH_ALG_SHA512] =3D 64,
=C2=A0 =C2=A0 =C2=A0[QCR= YPTO_HASH_ALG_RIPEMD160] =3D 20,
+#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 = =C2=A0[QCRYPTO_HASH_ALG_SM3] =3D 32,
+#endif
=C2=A0};
=C2=A0
= =C2=A0static const char hex[] =3D "0123456789abcdef";
diff --g= it a/tests/unit/test-crypto-hmac.c b/tests/unit/test-crypto-hmac.c
index= 23eb724d94..b1d04e9fcc 100644
--- a/tests/unit/test-crypto-hmac.c
++= + b/tests/unit/test-crypto-hmac.c
@@ -76,6 +76,14 @@ static QCryptoHmacT= estData test_data[] =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0"94964ed4c1155b62b668c241d67279e5"
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0"8a711676",
=C2=A0 =C2=A0 =C2=A0},
= +#ifdef CONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0{
+ =C2=A0 =C2=A0 =C2=A0 =C2= =A0.alg =3D QCRYPTO_HASH_ALG_SM3,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.hex_dige= st =3D
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"760e3799332bc913= 819b930085360ddb"
+ =C2=A0 =C2=A0"c05529261313d5b15b75bab4fd7= ae91e",
+ =C2=A0 =C2=A0},
+#endif
=C2=A0};
=C2=A0
=C2= =A0static const char hex[] =3D "0123456789abcdef";
diff --git = a/tests/unit/test-crypto-pbkdf.c b/tests/unit/test-crypto-pbkdf.c
index = 43c417f6b4..3d76593c86 100644
--- a/tests/unit/test-crypto-pbkdf.c
++= + b/tests/unit/test-crypto-pbkdf.c
@@ -326,6 +326,22 @@ static QCryptoPb= kdfTestData test_data[] =3D {
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 "\xce\xbf\x91\x14\x8b\x5c\x48\x41",
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0.nout =3D 32
=C2=A0 =C2=A0 =C2=A0},
+#ifdef C= ONFIG_CRYPTO_SM3
+ =C2=A0 =C2=A0{
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.path = =3D "/crypto/pbkdf/nonrfc/sm3/iter2",
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0.hash =3D QCRYPTO_HASH_ALG_SM3,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.iter= ations =3D 2,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.key =3D "password"= ,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.nkey =3D 8,
+ =C2=A0 =C2=A0 =C2=A0 = =C2=A0.salt =3D "ATHENA.MIT.EDUraeburn",
+ =C2=A0 =C2=A0 =C2= =A0 =C2=A0.nsalt =3D 21,
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.out =3D "\x4= 8\x71\x1b\x58\xa3\xcb\xce\x06"
+ "\xba\xad\x77\xa8\xb5\xb9\xd= 8\x07"
+ "\x6a\xe2\xb3\x5b\x95\xce\xc8\xce"
+ "= \xe7\xb1\xcb\xee\x61\xdf\x04\xea",
+ =C2=A0 =C2=A0 =C2=A0 =C2=A0.no= ut =3D 32
+ =C2=A0 =C2=A0},
+#endif
=C2=A0#if 0
=C2=A0 =C2=A0 = =C2=A0{
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0.path =3D "/crypto/pbkdf/= nonrfc/whirlpool/iter1200",
--
2.44.0.windows.1

--000000000000b1dec4062598d7c1--