From d1ccc409d4c655f695c7dc042a629a8898bd14eb Mon Sep 17 00:00:00 2001 From: Jussi Kivilinna Date: Wed, 4 Jan 2023 12:44:06 +0200 Subject: Add GMAC-SM4 and Poly1305-SM4 * cipher/cipher.c (cipher_list_algo301): Remove comma at the end of last entry. * cipher/mac-gmac.c (map_mac_algo_to_cipher): Add SM4. (_gcry_mac_type_spec_gmac_sm4): New. * cipher/max-internal.h (_gcry_mac_type_spec_gmac_sm4) (_gcry_mac_type_spec_poly1305mac_sm4): New. * cipher/mac-poly1305.c (poly1305mac_open): Add SM4. (_gcry_mac_type_spec_poly1305mac_sm4): New. * cipher/mac.c (mac_list, mac_list_algo401, mac_list_algo501): Add GMAC-SM4 and Poly1304-SM4. (mac_list_algo101): Remove comma at the end of last entry. * cipher/md.c (digest_list_algo301): Remove comma at the end of last entry. * doc/gcrypt.texi: Add GCRY_MAC_GMAC_SM4 and GCRY_MAC_POLY1305_SM4. * src/gcrypt.h.in (GCRY_MAC_GMAC_SM4, GCRY_MAC_POLY1305_SM4): New. * tests/bench-slope.c (bench_mac_init): Setup IV for GCRY_MAC_POLY1305_SM4. * tests/benchmark.c (mac_bench): Likewise. -- Signed-off-by: Jussi Kivilinna --- src/gcrypt.h.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in index 8451a4ce..47d73339 100644 --- a/src/gcrypt.h.in +++ b/src/gcrypt.h.in @@ -1516,13 +1516,15 @@ enum gcry_mac_algos GCRY_MAC_GMAC_TWOFISH = 403, GCRY_MAC_GMAC_SERPENT = 404, GCRY_MAC_GMAC_SEED = 405, + GCRY_MAC_GMAC_SM4 = 406, GCRY_MAC_POLY1305 = 501, GCRY_MAC_POLY1305_AES = 502, GCRY_MAC_POLY1305_CAMELLIA = 503, GCRY_MAC_POLY1305_TWOFISH = 504, GCRY_MAC_POLY1305_SERPENT = 505, - GCRY_MAC_POLY1305_SEED = 506 + GCRY_MAC_POLY1305_SEED = 506, + GCRY_MAC_POLY1305_SM4 = 507 }; /* Flags used with the open function. */ -- cgit v1.2.1