use ecurve instead of custom ec

This commit is contained in:
Daniel Cousens 2014-06-07 16:24:27 +10:00
parent de8b6a9931
commit 4ce9015f3b
14 changed files with 82 additions and 735 deletions

View file

@ -1,25 +1,24 @@
var assert = require('assert')
var crypto = require('../src/crypto')
var networks = require('../src/networks')
var sec = require('../src/sec')
var ecparams = sec('secp256k1')
var BigInteger = require('bigi')
var ECPointFp = require('../src/ec').ECPointFp
var ECPubKey = require('../src/ecpubkey')
var ecurve = require('ecurve')
var curve = ecurve.getCurveByName('secp256k1')
var ECPoint = ecurve.Point
var fixtures = require('./fixtures/ecpubkey.json')
describe('ECPubKey', function() {
var Q
beforeEach(function() {
var curve = ecparams.getCurve()
Q = new ECPointFp(
Q = ECPoint.fromAffine(
curve,
curve.fromBigInteger(new BigInteger(fixtures.Q.x)),
curve.fromBigInteger(new BigInteger(fixtures.Q.y))
new BigInteger(fixtures.Q.x),
new BigInteger(fixtures.Q.y)
)
})