Browse Source

Removes ecdsa.getBigRandom

hk-custom-address
Daniel Cousens 11 years ago
parent
commit
96ebb65099
  1. 5
      src/ecdsa.js
  2. 6
      test/ec.js

5
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()

6
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")

Loading…
Cancel
Save