Browse Source

ECKey: use signum over compareTo

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
5f88cb8931
  1. 2
      src/eckey.js

2
src/eckey.js

@ -11,7 +11,7 @@ var sec = require('./sec')
var ecparams = sec('secp256k1')
function ECKey(D, compressed) {
assert(D.compareTo(BigInteger.ZERO) > 0, 'Private key must be greater than 0')
assert(D.signum() > 0, 'Private key must be greater than 0')
assert(D.compareTo(ecparams.getN()) < 0, 'Private key must be less than the curve order')
var Q = ecparams.getG().multiply(D)

Loading…
Cancel
Save