Page MenuHome GnuPG

Hash SM3 support
Closed, ResolvedPublic

Description

It would be good if we have support of Chinese secure hash named SM3.

SM3 Cryptographic Hash Algorithm:

http://www.oscca.gov.cn/UpFile/20101222141857786.pdf

(I took the URL from U2F document, but I can't get the document.)

Revisions and Commits

Event Timeline

gniibe set External Link to https://tools.ietf.org/html/draft-shen-sm3-hash-01.

Thank you. The diff doesn't include sm3.c. Could you please update?

This is my note.
If it is intended to be used to OpenPGP, GCRY_MD_SM3 should be assigned in OpenPGP standard.

Thank you. The diff doesn't include sm3.c. Could you please update?

Sorry my fault. Updated.

This is my note.
If it is intended to be used to OpenPGP, GCRY_MD_SM3 should be assigned in OpenPGP standard.

Thanks for your reminding. It sounds like pretty interesting.

Currently, my though is quite simple.

  • Implement SM3 in libgcrypt
  • gnulib interfaces to libgcrypt to use sm3
  • A new sm3sum program in coreutils interface to gnulib

I would like to extend this work, including adding SM3 to OpenPGP.

gniibe triaged this task as Normal priority.Oct 24 2017, 9:29 AM

I am now examining OID allocation.
I'll add the OID of SM3 into sm3.c.

I use: 1.2.156.10197.1.401

More information:

I looked http://oidref.com/1.2.156.10197
It was registered by Chinese Cryptography Standardization Technology Committee (CCSTC) .
It is currently under control of China Electric Standard Institute: http://www.cesi.cn

I don't know if CCSTC is under 国家密码管理局 http://www.sca.gov.cn/

The CESI's OID it self seems under 200004 http://www.cesi.cn/201612/937.html

OK, I found: http://www.oidchina.cn/oid/release/1.2.156.10197.
站点: 国家OID注册中心
数字OID: 10197
中文OID:
英文OID: sca10197
应用范围: 密码标准化技术委员会

申请机构中文名: 国家密码管理局
申请机构英文名: State Cryptography Administration
申请机构中文地址: 北京市丰台区靛厂路7号
申请机构英文地址: dianchang road NO.7,fengtai district,beijing,china

CESI also publishes a complete white pager documenting OID assignment in details. See http://www.cesi.cn/201612/1688.html and download the pdf. Search "10197" and I see the following info:

  • page 31: 1.2.156.10197 is assigned to SCA (国家密码管理局) by OID register center.
  • page 37: 1.2.156.10197 is assigned to CCSTC(中国密码行业标准化技术委员会) and 1.2.156.197 is assigned to SCA.

Thanks for the information.
Closing, as I pushed rC94b84360ca55: Add OID information for SM3..