summaryrefslogtreecommitdiff
path: root/cipher/pubkey-util.c
diff options
context:
space:
mode:
authorJia Zhang <qianyue.zj@alibaba-inc.com>2017-10-24 15:55:12 +0900
committerNIIBE Yutaka <gniibe@fsij.org>2017-10-24 16:18:55 +0900
commit4423bf3cc4432b9bfe801ff74cb05e6f0dd3eccd (patch)
tree55932118b9f72e87e179b252ae9e4d0a5138672c /cipher/pubkey-util.c
parent5b31e22d9fc542bdccb1586ef2c83d9794a731d3 (diff)
downloadlibgcrypt-4423bf3cc4432b9bfe801ff74cb05e6f0dd3eccd.tar.gz
Add crypto hash SM3.
* configure.ac (available_digests): Add sm3. * src/cipher.h: Add declarations for SM3. * cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add sm3.c. * cipher/md.c [USE_SM3] (digest_list): Add _gcry_digest_spec_sm3. * cipher/pubkey-util.c (hashnames): Add "sm3". * cipher/sm3.c: New. * tests/basic.c (check_digests): Add test vectors for SM3. * tests/hashtest-256g.in (algos): Add SM3. * tests/hashtest.c (testvectors): Add for SM3. -- GnuPG-bug-id: 3454 Signed-off-by: Jia Zhang <qianyue.zj@alibaba-inc.com>
Diffstat (limited to 'cipher/pubkey-util.c')
-rw-r--r--cipher/pubkey-util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/cipher/pubkey-util.c b/cipher/pubkey-util.c
index c40ef977..ae0e1c46 100644
--- a/cipher/pubkey-util.c
+++ b/cipher/pubkey-util.c
@@ -221,6 +221,7 @@ get_hash_algo (const char *s, size_t n)
{ "sha3-256", GCRY_MD_SHA3_256 },
{ "sha3-384", GCRY_MD_SHA3_384 },
{ "sha3-512", GCRY_MD_SHA3_512 },
+ { "sm3", GCRY_MD_SM3 },
{ NULL, 0 }
};
int algo;