Removes use of convert module
This commit is contained in:
parent
827f00715c
commit
56336b9c2b
2 changed files with 9 additions and 10 deletions
src
|
@ -74,7 +74,7 @@ var ecdsa = {
|
|||
|
||||
verify: function (hash, sig, pubkey) {
|
||||
var r,s
|
||||
if (Array.isArray(sig)) {
|
||||
if (Array.isArray(sig) || Buffer.isBuffer(sig)) {
|
||||
var obj = ecdsa.parseSig(sig)
|
||||
r = obj.r
|
||||
s = obj.s
|
||||
|
@ -88,7 +88,7 @@ var ecdsa = {
|
|||
var Q
|
||||
if (pubkey instanceof ECPointFp) {
|
||||
Q = pubkey
|
||||
} else if (Array.isArray(pubkey)) {
|
||||
} else if (Array.isArray(pubkey) || Buffer.isBuffer(pubkey)) {
|
||||
Q = ECPointFp.decodeFrom(ecparams.getCurve(), pubkey)
|
||||
} else {
|
||||
throw new Error("Invalid format for pubkey value, must be byte array or ECPointFp")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue