Skip to content

Commit

Permalink
Merge pull request #30 from mvayngrib/signnogen
Browse files Browse the repository at this point in the history
don't generate a new key in ecSign
  • Loading branch information
dcousens authored Sep 12, 2016
2 parents 64d2c8a + 8a134f0 commit 6e4afa8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions browser/sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ function ecSign (hash, priv) {
if (!curveId) throw new Error('unknown curve ' + priv.curve.join('.'))

var curve = new EC(curveId)
var key = curve.genKeyPair()

key._importPrivate(priv.privateKey)
var key = curve.keyFromPrivate(priv.privateKey)
var out = key.sign(hash)

return new Buffer(out.toDER())
Expand Down

0 comments on commit 6e4afa8

Please sign in to comment.