Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
80559 views
1
var assert = require('assert');
2
var elliptic = require('../');
3
4
describe('EC API', function() {
5
it('should instantiate with valid curve (secp256k1)', function() {
6
var ec = new elliptic.ec('secp256k1');
7
8
assert(ec);
9
assert(typeof(ec) == "object");
10
});
11
12
it('should throw error with invalid curve', function() {
13
assert.throws(function(){
14
var ec = new elliptic.ec('nonexistent-curve');
15
}, Error);
16
});
17
});
18
19