|
|
@ -169,6 +169,16 @@ describe('ECPair', function () { |
|
|
|
|
|
|
|
assert.strictEqual(keyPair.toWIF(), exWIF) |
|
|
|
}) |
|
|
|
|
|
|
|
it('loops until d is within interval [1, n - 1]', sinon.test(function () { |
|
|
|
var rng = this.mock() |
|
|
|
rng.exactly(3) |
|
|
|
rng.onCall(0).returns(new BigInteger('0').toBuffer(32)) // < 1
|
|
|
|
rng.onCall(1).returns(curve.n.toBuffer(32)) // > n-1
|
|
|
|
rng.onCall(2).returns(new BigInteger('42').toBuffer(32)) // valid
|
|
|
|
|
|
|
|
ECPair.makeRandom({ rng: rng }) |
|
|
|
})) |
|
|
|
}) |
|
|
|
|
|
|
|
describe('getAddress', function () { |
|
|
|