aboutsummaryrefslogtreecommitdiffstats
path: root/docs/demo
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2017-09-18 09:19:00 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2017-09-18 09:19:00 +0800
commit4ceb7a52b6e8884e75121440776e93331453f818 (patch)
tree3577a58c1334e2c4719cef9f3ff6246f4da26e93 /docs/demo
parent60c0ab40c388a4b6bc96ab90690c26ac3105bc60 (diff)
downloaddexon-bls-4ceb7a52b6e8884e75121440776e93331453f818.tar
dexon-bls-4ceb7a52b6e8884e75121440776e93331453f818.tar.gz
dexon-bls-4ceb7a52b6e8884e75121440776e93331453f818.tar.bz2
dexon-bls-4ceb7a52b6e8884e75121440776e93331453f818.tar.lz
dexon-bls-4ceb7a52b6e8884e75121440776e93331453f818.tar.xz
dexon-bls-4ceb7a52b6e8884e75121440776e93331453f818.tar.zst
dexon-bls-4ceb7a52b6e8884e75121440776e93331453f818.zip
add default parameter of blsInit
Diffstat (limited to 'docs/demo')
-rw-r--r--docs/demo/bls-demo.js2
-rw-r--r--docs/demo/bls.js4
-rw-r--r--docs/demo/exported-bls.js6
3 files changed, 8 insertions, 4 deletions
diff --git a/docs/demo/bls-demo.js b/docs/demo/bls-demo.js
index 7adb094..21ea201 100644
--- a/docs/demo/bls-demo.js
+++ b/docs/demo/bls-demo.js
@@ -34,7 +34,7 @@ function onChangeSelectCurve() {
if (curve == prevSelectedCurve) return
prevSelectedCurve = curve
console.log('idx=' + idx)
- let r = blsInit(idx, MCLBN_FP_UNIT_SIZE)
+ let r = blsInit(idx)
setText('status', r ? 'err:' + r : 'ok')
setText('curveOrder', blsGetCurveOrder())
}
diff --git a/docs/demo/bls.js b/docs/demo/bls.js
index 9176c75..4894dc5 100644
--- a/docs/demo/bls.js
+++ b/docs/demo/bls.js
@@ -193,6 +193,10 @@ function define_bls_extra_functions(mod) {
blsPublicKey_malloc = mclBnG2_malloc
blsSignature_malloc = mclBnG1_malloc
+ blsInit = function(curveType) {
+ return _blsInit(curveType, MCLBN_FP_UNIT_SIZE)
+ }
+
blsGetCurveOrder = wrap_outputString(_blsGetCurveOrder)
blsGetFieldOrder = wrap_outputString(_blsGetFieldOrder)
diff --git a/docs/demo/exported-bls.js b/docs/demo/exported-bls.js
index c30c53a..85bb3b4 100644
--- a/docs/demo/exported-bls.js
+++ b/docs/demo/exported-bls.js
@@ -1,6 +1,6 @@
function define_exported_bls(mod) {
-blsInit = mod.cwrap('blsInit', 'number', ['number', 'number', ])
-blsInitNotThreadSafe = mod.cwrap('blsInitNotThreadSafe', 'number', ['number', 'number', ])
+_blsInit = mod.cwrap('blsInit', 'number', ['number', 'number', ])
+_blsInitNotThreadSafe = mod.cwrap('blsInitNotThreadSafe', 'number', ['number', 'number', ])
blsGetOpUnitSize = mod.cwrap('blsGetOpUnitSize', 'number', [])
_blsGetCurveOrder = mod.cwrap('blsGetCurveOrder', 'number', ['number', 'number', ])
_blsGetFieldOrder = mod.cwrap('blsGetFieldOrder', 'number', ['number', 'number', ])
@@ -51,7 +51,7 @@ _blsSignatureSetHexStr = mod.cwrap('blsSignatureSetHexStr', 'number', ['number',
_blsSignatureGetHexStr = mod.cwrap('blsSignatureGetHexStr', 'number', ['number', 'number', 'number', ])
blsDHKeyExchange = mod.cwrap('blsDHKeyExchange', 'null', ['number', 'number', 'number', ])
mclBn_setErrFile = mod.cwrap('mclBn_setErrFile', 'number', ['number', ])
-mclBn_init = mod.cwrap('mclBn_init', 'number', ['number', 'number', ])
+_mclBn_init = mod.cwrap('mclBn_init', 'number', ['number', 'number', ])
mclBn_getOpUnitSize = mod.cwrap('mclBn_getOpUnitSize', 'number', [])
mclBn_getCurveOrder = mod.cwrap('mclBn_getCurveOrder', 'number', ['number', 'number', ])
mclBn_getFieldOrder = mod.cwrap('mclBn_getFieldOrder', 'number', ['number', 'number', ])