Skip to content

Commit

Permalink
fixed: sm2 signature & verify would lead to error when using cross ve…
Browse files Browse the repository at this point in the history
…rsion
  • Loading branch information
JuneAndGreen committed Jul 26, 2021
1 parent d79d0e1 commit b7aa8ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 0.3.1

* 修复 sm2 在 userId 长度大于 31 时新旧版本验签不通过的问题
## 0.3.0

* sm2、sm3 重构
Expand Down
2 changes: 1 addition & 1 deletion src/sm2/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ function getHash(hashHex, publicKey, userId = '1234567812345678') {

const entl = userId.length * 4
data.unshift(entl & 0x00ff)
data.unshift(entl & 0xff00)
data.unshift(entl >> 8 & 0x00ff)

const z = sm3(data)

Expand Down

0 comments on commit b7aa8ce

Please sign in to comment.