mirror of
https://github.com/hanzoai/elliptic.git
synced 2026-09-23 23:51:03 +00:00
21 lines
471 B
JavaScript
21 lines
471 B
JavaScript
/* eslint-env node, mocha */
|
|
'use strict';
|
|
|
|
var assert = require('assert');
|
|
var elliptic = require('../');
|
|
|
|
describe('EC API', function() {
|
|
it('should instantiate with valid curve (secp256k1)', function() {
|
|
var ec = new elliptic.ec('secp256k1');
|
|
|
|
assert(ec);
|
|
assert(typeof ec === 'object');
|
|
});
|
|
|
|
it('should throw error with invalid curve', function() {
|
|
assert.throws(function() {
|
|
new elliptic.ec('nonexistent-curve');
|
|
}, Error);
|
|
});
|
|
});
|