Home GnuPG

Add SM4 symmetric cipher algorithm

Description

Add SM4 symmetric cipher algorithm

* cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add sm4.c.
* cipher/cipher.c (cipher_list, cipher_list_algo301): Add
_gcry_cipher_spec_sm4.
* cipher/mac-cmac.c (map_mac_algo_to_cipher): Add cmac SM4.
(_gcry_mac_type_spec_cmac_sm4): Add cmac SM4.
* cipher/mac-internal.h: Declare spec_cmac_sm4.
* cipher/mac.c (mac_list, mac_list_algo201): Add cmac SM4.
* cipher/sm4.c: New.
* configure.ac (available_ciphers): Add sm4.
* doc/gcrypt.texi: Add SM4 document.
* src/cipher.h: Add declarations for SM4 and cmac SM4.
* src/gcrypt.h.in (gcry_cipher_algos): Add algorithm ID for SM4.

[jk: add missing mapping in mac-cmac.c:map_mac_algo_to_cipher]
[jk: add GCRY_MAC_CMAC_SM4 to gcrypt.texi]

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
Tianjia Zhang <tianjia.zhang@linux.alibaba.com>Authored on Jun 16 2020, 11:09 AM
jukiviliCommitted on Jun 16 2020, 8:44 PM
Parents
rC6c571bfda640: doc: add GCRY_MD_SM3, GCRY_MAC_HMAC_SM3 and GCRY_MAC_GOST28147_IMIT
Branches
Unknown
Tags
Unknown

Event Timeline

jukivili committed rCddcce166ab8b: Add SM4 symmetric cipher algorithm (authored by Tianjia Zhang <tianjia.zhang@linux.alibaba.com>).Jun 16 2020, 8:44 PM