ECKey: use signum over compareTo

This commit is contained in:
Daniel Cousens 2014-05-31 11:24:00 +10:00
parent 978f0c5406
commit 5f88cb8931

View file

@ -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)