ECPair: loop until within interval
This commit is contained in:
parent
f11cce0710
commit
a72e608898
1 changed files with 1 additions and 1 deletions
|
@ -89,7 +89,7 @@ ECPair.makeRandom = function (options) {
|
||||||
typeforce(types.Buffer256bit, buffer)
|
typeforce(types.Buffer256bit, buffer)
|
||||||
|
|
||||||
d = BigInteger.fromBuffer(buffer)
|
d = BigInteger.fromBuffer(buffer)
|
||||||
} while (d.compareTo(secp256k1.n) >= 0)
|
} while (d.signum() === 0 || d.compareTo(secp256k1.n) >= 0)
|
||||||
|
|
||||||
return new ECPair(d, null, options)
|
return new ECPair(d, null, options)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue