-
Notifications
You must be signed in to change notification settings - Fork 572
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
Comments
我也遇到相同的问题,请问当前是否有解决方案? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi~
我使用软件包中
func (pub *PublicKey) Sm3Digest(msg, uid []byte) ([]byte, error)
函数进行SM3摘要,发现在某些情况下摘要结果不是32字节。我认为问题出在该函数的返回值e.Bytes()
,e.Bytes()
返回的结果会把buf首位的非0位截去。由于这个函数是单独的接口,是否可以使用e.FillBytes()
进行替代获取合格的摘要。或者告诉API使用者如果需要获取合格的摘要,需对Sm3Digest
的结果前补0。以满足32位摘要的要求。期待回复,谢谢~The text was updated successfully, but these errors were encountered: