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

SM3摘要结果长度在某些情况下不是32字节 #170

Open
folivoramao opened this issue Jul 19, 2022 · 1 comment
Open

SM3摘要结果长度在某些情况下不是32字节 #170

folivoramao opened this issue Jul 19, 2022 · 1 comment

Comments

@folivoramao
Copy link

Hi~
我使用软件包中func (pub *PublicKey) Sm3Digest(msg, uid []byte) ([]byte, error)函数进行SM3摘要,发现在某些情况下摘要结果不是32字节。我认为问题出在该函数的返回值e.Bytes()e.Bytes()返回的结果会把buf首位的非0位截去。由于这个函数是单独的接口,是否可以使用e.FillBytes()进行替代获取合格的摘要。或者告诉API使用者如果需要获取合格的摘要,需对Sm3Digest的结果前补0。以满足32位摘要的要求。期待回复,谢谢~

@folivoramao folivoramao changed the title SM3摘要结果长度不是32字节 SM3摘要结果长度在某些情况下不是32字节 Jul 19, 2022
@sundaykeke
Copy link

我也遇到相同的问题,请问当前是否有解决方案?

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