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
|
@ -35,6 +35,21 @@ describe('ECPubKey', 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 = ECPubKey.curve[property]
|
||||
var expected = secp256k1[property]
|
||||
|
||||
assert.deepEqual(actual, expected)
|
||||
}
|
||||
})
|
||||
|
||||
describe('fromHex/toHex', function() {
|
||||
it('supports compressed points', function() {
|
||||
var pubKey = ECPubKey.fromHex(fixtures.compressed.hex)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue