summaryrefslogtreecommitdiff
path: root/lib/gc.h
diff options
context:
space:
mode:
authorJia Zhang <qianyue.zj@alibaba-inc.com>2017-10-28 23:58:20 -0400
committerBruno Haible <bruno@clisp.org>2017-10-29 09:11:25 +0100
commite128f7fb2f0be16d96e5cc274bdd61bcb68313eb (patch)
tree9b919f579d914e1e6f1c402e305a13b3fff19da6 /lib/gc.h
parent61f381e0f7daffe7bbef904070d5ca5f81fc2273 (diff)
downloadgnulib-e128f7fb2f0be16d96e5cc274bdd61bcb68313eb.tar.gz
New module: crypto/gc-sm3
* lib/gc.h: Declare SM3-related stuffs. * lib/gc-gnulib.c: Support sm3 in internal functions. * lib/gc-libgcrypt.c: Support sm3 with libgcrypt. * m4/gc-sm3.m4: m4 file for gc-sm3 module. * modules/crypto/gc-sm3: Define gc-sm3 module. * tests/test-gc-sm3.c: Implement SM3 test case with libgcrypt. * modules/crypto/gc-sm3-tests: Define gc-sm3 test module. * MODULES.html.sh: List gc-sm3 module.
Diffstat (limited to 'lib/gc.h')
-rw-r--r--lib/gc.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gc.h b/lib/gc.h
index a47cc8d0e3..e65ba49a34 100644
--- a/lib/gc.h
+++ b/lib/gc.h
@@ -47,7 +47,8 @@ enum Gc_hash
GC_SHA256,
GC_SHA384,
GC_SHA512,
- GC_SHA224
+ GC_SHA224,
+ GC_SM3
};
typedef enum Gc_hash Gc_hash;
@@ -69,6 +70,7 @@ typedef void *gc_hash_handle;
#define GC_SHA384_DIGEST_SIZE 48
#define GC_SHA512_DIGEST_SIZE 64
#define GC_SHA224_DIGEST_SIZE 24
+#define GC_SM3_DIGEST_SIZE 32
/* Cipher types. */
enum Gc_cipher
@@ -156,6 +158,7 @@ extern Gc_rc gc_md2 (const void *in, size_t inlen, void *resbuf);
extern Gc_rc gc_md4 (const void *in, size_t inlen, void *resbuf);
extern Gc_rc gc_md5 (const void *in, size_t inlen, void *resbuf);
extern Gc_rc gc_sha1 (const void *in, size_t inlen, void *resbuf);
+extern Gc_rc gc_sm3 (const void *in, size_t inlen, void *resbuf);
extern Gc_rc gc_hmac_md5 (const void *key, size_t keylen,
const void *in, size_t inlen, char *resbuf);
extern Gc_rc gc_hmac_sha1 (const void *key, size_t keylen,