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>
This commit is contained in:
liequan che 2024-10-30 08:51:46 +00:00 committed by Daniel P. Berrangé
parent 62eb377e0a
commit d078da86d6
13 changed files with 135 additions and 1 deletions

View file

@ -76,6 +76,14 @@ static QCryptoHmacTestData test_data[] = {
"94964ed4c1155b62b668c241d67279e5"
"8a711676",
},
#ifdef CONFIG_CRYPTO_SM3
{
.alg = QCRYPTO_HASH_ALGO_SM3,
.hex_digest =
"760e3799332bc913819b930085360ddb"
"c05529261313d5b15b75bab4fd7ae91e",
},
#endif
};
static const char hex[] = "0123456789abcdef";