Comparing version 0.1.6 to 0.1.7
28
mcl.js
@@ -14,18 +14,18 @@ 'use strict'; | ||
/* eslint-disable */ | ||
const MCL_BN254 = 0 | ||
const MCL_BN381_1 = 1 | ||
const MCL_BN381_2 = 2 | ||
const MCL_BN462 = 3 | ||
const MCL_BN_SNARK1 = 4 | ||
const MCL_BLS12_381 = 5 | ||
exports.BN254 = 0 | ||
exports.BN381_1 = 1 | ||
exports.BN381_2 = 2 | ||
exports.BN462 = 3 | ||
exports.BN_SNARK1 = 4 | ||
exports.BLS12_381 = 5 | ||
/* eslint-disable */ | ||
const getUnitSize = curveType => { | ||
switch (curveType) { | ||
case MCL_BN254: | ||
case MCL_BN_SNARK1: | ||
case exports.BN254: | ||
case exports.BN_SNARK1: | ||
return 4; /* use mcl_c.js */ | ||
case MCL_BN381_1: | ||
case MCL_BN381_2: | ||
case MCL_BLS12_381: | ||
case MCL_BN462: | ||
case exports.BN381_1: | ||
case exports.BN381_2: | ||
case exports.BLS12_381: | ||
case exports.BN462: | ||
return 8; /* use mcl_c512.js */ | ||
@@ -584,4 +584,4 @@ default: | ||
} // setup() | ||
exports.init = (curveType = MCL_BN254) => { | ||
console.log(`init curveType=${curveType}`) | ||
exports.init = (curveType = exports.BN254) => { | ||
exports.curveType = curveType | ||
const name = getUnitSize(curveType) == 4 ? 'mcl_c' : 'mcl_c512' | ||
@@ -588,0 +588,0 @@ return new Promise(resolve => { |
{ | ||
"name": "mcl-wasm", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "mcl ; A portable and fast pairing-based cryptography library for Node.js by WebAssembly", | ||
@@ -5,0 +5,0 @@ "main": "mcl.js", |
@@ -30,6 +30,6 @@ 'use strict' | ||
// can't parallel | ||
await curveTest(0, 'BN254') | ||
await curveTest(1, 'BN381_1') | ||
await curveTest(5, 'BLS12_381') | ||
await curveTest(3, 'BN462') | ||
await curveTest(mcl.BN254, 'BN254') | ||
await curveTest(mcl.BN381_1, 'BN381_1') | ||
await curveTest(mcl.BLS12_381, 'BLS12_381') | ||
await curveTest(mcl.BN462, 'BN462') | ||
} | ||
@@ -36,0 +36,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3565351