Skip to content
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

有没有对应的JS版本SM2算法呢? #1616

Open
Rendtime opened this issue Jan 5, 2024 · 3 comments
Open

有没有对应的JS版本SM2算法呢? #1616

Rendtime opened this issue Jan 5, 2024 · 3 comments

Comments

@Rendtime
Copy link

Rendtime commented Jan 5, 2024

GmSSL-JS库测试了一下,SM2算法并不完整,有其他可用的吗?

@lpilp
Copy link

lpilp commented Jan 6, 2024

https://github.com/JuneAndGreen/sm-crypto 这个的挺好

@Rendtime
Copy link
Author

Rendtime commented Jan 6, 2024

https://github.com/JuneAndGreen/sm-crypto 这个的挺好

谢谢,我试过这个,但是和C++的结果不一致,我需要C++和JS的算法结果具有一致性。不晓得是不是我姿势不对

@lpilp
Copy link

lpilp commented Jan 6, 2024

算法是一样的,就是最后的结果的表达式不一样而已, 如签名的结果是 r,s , 有些项目返回的是 asn1(r,s ) ,有些是返回 r+s 的字符串,还有最后 base64的还是hex的, 还有非对称加密 返回c1c3c2或是c1c2c3还有就是 asn1(c1x,c1y,c3,c2), 你看下你的c++里返回的是什么样的就行了,然后中间转换下,总之: 这些项目都是经过实践检测的,主体算法没问题。统一下输入输出的数据表达形式是肯定可以互通的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants