summary refs log tree commit diff stats
path: root/crypto/hash-gcrypt.c
diff options
context:
space:
mode:
authorliequan che <liequanche@gmail.com>2024-10-30 08:51:46 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2024-11-05 18:37:18 +0000
commitd078da86d61cf0f188cd099bef9b7b2dcfeba5a7 (patch)
tree7fa359d1900f7460aead1f89e59a81f2f3648835 /crypto/hash-gcrypt.c
parent62eb377e0a3179ff57274e096eca0102f96d0170 (diff)
downloadfocaccia-qemu-d078da86d61cf0f188cd099bef9b7b2dcfeba5a7.tar.gz
focaccia-qemu-d078da86d61cf0f188cd099bef9b7b2dcfeba5a7.zip
crypto: Introduce SM3 hash hmac pbkdf algorithm
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.

Detect the SM3 cryptographic hash algorithm and enable the feature silently
if it is available.

Signed-off-by: cheliequan <cheliequan@inspur.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
Diffstat (limited to 'crypto/hash-gcrypt.c')
-rw-r--r--crypto/hash-gcrypt.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/hash-gcrypt.c b/crypto/hash-gcrypt.c
index 73533a4949..f04a9f553c 100644
--- a/crypto/hash-gcrypt.c
+++ b/crypto/hash-gcrypt.c
@@ -34,6 +34,9 @@ static int qcrypto_hash_alg_map[QCRYPTO_HASH_ALGO__MAX] = {
     [QCRYPTO_HASH_ALGO_SHA384] = GCRY_MD_SHA384,
     [QCRYPTO_HASH_ALGO_SHA512] = GCRY_MD_SHA512,
     [QCRYPTO_HASH_ALGO_RIPEMD160] = GCRY_MD_RMD160,
+#ifdef CONFIG_CRYPTO_SM3
+    [QCRYPTO_HASH_ALGO_SM3] = GCRY_MD_SM3,
+#endif
 };
 
 gboolean qcrypto_hash_supports(QCryptoHashAlgo alg)