EC*Key: add .curve static property for public API
This commit is contained in:
parent
cba6c7a7b2
commit
9510af10e3
4 changed files with 45 additions and 8 deletions
test
|
@ -1,5 +1,6 @@
|
|||
var assert = require('assert')
|
||||
var crypto = require('crypto')
|
||||
var ecurve = require('ecurve')
|
||||
var networks = require('../src/networks')
|
||||
var sinon = require('sinon')
|
||||
|
||||
|
@ -42,6 +43,21 @@ describe('ECKey', function() {
|
|||
})
|
||||
})
|
||||
|
||||
it('uses the secp256k1 curve by default', function() {
|
||||
var secp256k1 = ecurve.getCurveByName('secp256k1')
|
||||
|
||||
for (var property in secp256k1) {
|
||||
// FIXME: circular structures in ecurve
|
||||
if (property === 'G') continue
|
||||
if (property === 'infinity') continue
|
||||
|
||||
var actual = ECKey.curve[property]
|
||||
var expected = secp256k1[property]
|
||||
|
||||
assert.deepEqual(actual, expected)
|
||||
}
|
||||
})
|
||||
|
||||
describe('fromWIF', function() {
|
||||
fixtures.valid.forEach(function(f) {
|
||||
f.WIFs.forEach(function(wif) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue