-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for SM3 #316
Comments
Hello 👋 Thanks for the detailed proposal. To be perfectly honest, I personally don't expect much interest from the other vendors in implementing this, as there's no RFC for SM3, it's not part of TLS, and I don't think there's much developer interest (but feel free to prove me wrong on that point). Nevertheless, the process for attempting to standardize this would be the same as I've written elsewhere, it is outlined in #280 (comment). |
thanks for replying.
|
Ah, I see. Alright, thanks for the additional details 👍 |
what shold I do next step? |
Not necessarily, the first step is to discuss it in the Web Incubator Community Group, as explained in #280 (comment). |
@twiss |
Description
SM3 is a fast software friendly hash function.
I would like to add it to as an optional part of the webcrypto API.
Spec
it can be found here:
ISO/IEC 10118-3:2018
http://www.gmbz.org.cn/upload/2018-07-24/1532401392982079739.pdf
http://c.gb688.cn/bzgk/gb/showGb?type=online&hcno=45B1A67F20F3BF339211C391E9278F5E (Chinese National Standard GB/T 32905-2016 Information security techniques—SM3 cryptographic hash algorithm)
Tests
There is an extensive test vector list available here http://c.gb688.cn/bzgk/gb/showGb?type=online&hcno=45B1A67F20F3BF339211C391E9278F5E
Support
It is already supported into many cryptographic libraries like openssl、linux kernel, and implementing it is really easy, so it shouldn't be lots of work to implement for vendors.
Reasons SM3 is a usefull hash function
In China, some important system which used in important industries like financial、power and govnetment must use Chinese National Standard like SM3.
There is also a Chinese Crypto Standard GM/T 0087-2020 Browser cryptography API specification, add Chinese National Standard like SM2、SM3、SM4 to webcrypto API.
JS API
Using it would be similar to the current
SHA
extension.Consumers would call
crypto.subtle.digest
with the name, data and optionally the key and get returned a promise, that when resolved would return the digest body.Name and variants
SM3
• there only one size 256 defined in ISO/IEC 10118-3:2018,so it don’t need to named as SM3-256.
Return value
An ArrayBuffer containing the resulting digest, and sized matching the size parameter.
Usage example
Implementation interest
I am a employee of 360 Technology Co., Ltd. which is member of W3C. as a Chinese company, 360 secure browser which is a popular browser in China had implemented GM/T 0087 as above described. we want to add Chinese National Standard to webcrypto API. I can draft a spec PR and make a W3C's testsuite friendly version if reception seems positive.
I'm also interested into implementing this into the major engines.
The text was updated successfully, but these errors were encountered: