From 96ebb65099adbfdf94d957d154e67daa231fafc1 Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Tue, 22 Apr 2014 02:04:56 +1000 Subject: [PATCH] Removes ecdsa.getBigRandom --- src/ecdsa.js | 5 ----- test/ec.js | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/ecdsa.js b/src/ecdsa.js index ebb2216..26b0444 100644 --- a/src/ecdsa.js +++ b/src/ecdsa.js @@ -52,11 +52,6 @@ function deterministicGenerateK(hash,key) { } var ecdsa = { - getBigRandom: function (limit) { - return new BigInteger(limit.bitLength(), rng). - mod(limit.subtract(BigInteger.ONE)). - add(BigInteger.ONE) - }, sign: function (hash, priv) { var d = priv var n = ecparams.getN() diff --git a/test/ec.js b/test/ec.js index 71b5c59..72979e1 100644 --- a/test/ec.js +++ b/test/ec.js @@ -1,21 +1,21 @@ var assert = require('assert') -var ecdsa = require('../').ecdsa var sec = require('../src/jsbn/sec') var ecparams = sec('secp256k1') +var BigInteger = require('..').BigInteger var ECPointFp = require('../').ECPointFp var ECKey = require('../').ECKey describe('ec', function() { describe('ECPointFp', function() { - it('behaviours correctly', function() { + it('behaves correctly', function() { var G = ecparams.getG() var n = ecparams.getN() assert.ok(G.multiply(n).isInfinity(), "Gn is infinite") - var k = ecdsa.getBigRandom(n) + var k = BigInteger.ONE var P = G.multiply(k) assert.ok(!P.isInfinity(), "kG is not infinite") assert.ok(P.isOnCurve(), "kG on curve")