diff options
author | NIIBE Yutaka <gniibe@fsij.org> | 2017-10-25 12:04:30 +0900 |
---|---|---|
committer | NIIBE Yutaka <gniibe@fsij.org> | 2017-10-25 12:04:30 +0900 |
commit | 94b84360ca55c407222a3eb8222d8b1816fc617f (patch) | |
tree | 0f3f9fb447b08a242f613fd5b8572b78c783443b /cipher/sm3.c | |
parent | 4423bf3cc4432b9bfe801ff74cb05e6f0dd3eccd (diff) | |
download | libgcrypt-94b84360ca55c407222a3eb8222d8b1816fc617f.tar.gz |
Add OID information for SM3.
* cipher/sm3.c (asn_sm3, oid_spec_sm3): New.
(_gcry_digest_spec_sm3): Add asn_sm3, oid_spec_sm3.
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'cipher/sm3.c')
-rw-r--r-- | cipher/sm3.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/cipher/sm3.c b/cipher/sm3.c index f0c574a5..ee5daf22 100644 --- a/cipher/sm3.c +++ b/cipher/sm3.c @@ -444,10 +444,23 @@ run_selftests (int algo, int extended, selftest_report_func_t report) return ec; } +static byte asn_sm3[] = /* Object ID is 1.2.156.10197.401 */ + { 0x30, 0x2F, 0x30, 0x0B, 0x06, 0x07, 0x2A, 0x81, + 0x1C, 0xCF, 0x55, 0x83, 0x11, 0x05, 0x00, 0x04, + 0x20 }; + +static gcry_md_oid_spec_t oid_spec_sm3[] = + { + /* China Electronics Standardization Instutute, + OID White paper (2015), Table 6 */ + { "1.2.156.10197.401" }, + { NULL }, + }; + gcry_md_spec_t _gcry_digest_spec_sm3 = { GCRY_MD_SM3, {0, 1}, - "SM3", NULL, 0, NULL, 32, + "SM3", asn_sm3, DIM (asn_sm3), oid_spec_sm3, 32, sm3_init, _gcry_md_block_write, sm3_final, sm3_read, NULL, sizeof (SM3_CONTEXT), run_selftests |