Hi Niels,
On 12/2/21 3:40 AM, Niels Möller wrote:
Tianjia Zhang tianjia.zhang@linux.alibaba.com writes:
Add OSCCA SM3 secure hash (OSCCA GM/T 0004-2012 SM3) generic hash transformation.
Thanks, merged the patch series onto a branch "sm3" for testing, with only minor changes.
--- /dev/null +++ b/sm3.h
[...]
+#define SM3_DIGEST_SIZE 32 +#define SM3_BLOCK_SIZE 64 +/* For backwards compatibility */ +#define SM3_DATA_SIZE SM3_BLOCK_SIZE
I dropped the definition of SM3_DATA_SIZE, since this is a new feature in Nettle, there's no old version to be compatible with.
Thanks for pointing it out.
Would you mind writing a short description of the algorithm for the manual? I think it should go under "Miscellaneous hash functions". Would be nice with some brief background on this hash function (origin, intended applications, when and where it's useful) plus reference docs for the defined constants and functions.
SM3 is a cryptographic hash function standard adopted by the government of the People's Republic of China, which was issued by the Cryptography Standardization Technical Committee of China on December 17, 2010. The corresponding standard is "GM/T 0004-2012 "SM3 Cryptographic Hash Algorithm"".
SM3 algorithm is a hash algorithm in ShangMi cryptosystems. SM3 is mainly used for digital signature and verification, message authentication code generation and verification, random number generation, etc. Its algorithm is public. Combined with the public key algorithm SM2 and the symmetric encryption algorithm SM4, it can be used in various data security and network security scenarios such as the TLS 1.3 protocol, disk encryption, standard digital certificates, and digital signatures. According to the State Cryptography Administration of China, its security and efficiency are equivalent to SHA-256.
Reference specification: 1. http://gmbz.org.cn/main/viewfile/20180108023812835219.html 2. http://www.gmbz.org.cn/upload/2018-07-24/1532401392982079739.pdf 3. https://datatracker.ietf.org/doc/html/draft-oscca-cfrg-sm3-02 4. https://datatracker.ietf.org/doc/html/rfc8998
Thanks for your reminder, the above is the information I provided. Do I need to submit it to the document through PATCH?
Best regards, Tianjia