@bitgo/wasm-mps 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/js/wasm/wasm_mps.d.ts +8 -0
- package/dist/cjs/js/wasm/wasm_mps.js +273 -9
- package/dist/cjs/js/wasm/wasm_mps_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_mps_bg.wasm.d.ts +9 -3
- package/dist/esm/js/wasm/wasm_mps.d.ts +8 -0
- package/dist/esm/js/wasm/wasm_mps.js +1 -1
- package/dist/esm/js/wasm/wasm_mps_bg.js +269 -9
- package/dist/esm/js/wasm/wasm_mps_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_mps_bg.wasm.d.ts +9 -3
- package/package.json +1 -1
|
@@ -30,3 +30,11 @@ export function dkg_round0_process(party_id: number, decryption_key: Uint8Array,
|
|
|
30
30
|
export function dkg_round1_process(round1_messages: Array<any>, state: Uint8Array): MsgState;
|
|
31
31
|
|
|
32
32
|
export function dkg_round2_process(round2_messages: Array<any>, state: Uint8Array): Share;
|
|
33
|
+
|
|
34
|
+
export function dsg_round0_process(share: Uint8Array, derivation_path: string, message: Uint8Array): MsgState;
|
|
35
|
+
|
|
36
|
+
export function dsg_round1_process(round1_message: Uint8Array, state: Uint8Array): MsgState;
|
|
37
|
+
|
|
38
|
+
export function dsg_round2_process(round2_message: Uint8Array, state: Uint8Array): MsgState;
|
|
39
|
+
|
|
40
|
+
export function dsg_round3_process(round2_message: Uint8Array, state: Uint8Array): Uint8Array;
|
|
@@ -21,7 +21,7 @@ class MsgShare {
|
|
|
21
21
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
22
22
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
23
23
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
24
|
-
wasm.
|
|
24
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
25
25
|
return v1;
|
|
26
26
|
} finally {
|
|
27
27
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -66,7 +66,7 @@ class MsgState {
|
|
|
66
66
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
67
67
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
68
68
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
69
|
-
wasm.
|
|
69
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
70
70
|
return v1;
|
|
71
71
|
} finally {
|
|
72
72
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -82,7 +82,7 @@ class MsgState {
|
|
|
82
82
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
83
83
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
84
84
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
85
|
-
wasm.
|
|
85
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
86
86
|
return v1;
|
|
87
87
|
} finally {
|
|
88
88
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -120,7 +120,7 @@ class Share {
|
|
|
120
120
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
121
121
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
122
122
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
123
|
-
wasm.
|
|
123
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
124
124
|
return v1;
|
|
125
125
|
} finally {
|
|
126
126
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -136,7 +136,7 @@ class Share {
|
|
|
136
136
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
137
137
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
138
138
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
139
|
-
wasm.
|
|
139
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
140
140
|
return v1;
|
|
141
141
|
} finally {
|
|
142
142
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -156,9 +156,9 @@ exports.Share = Share;
|
|
|
156
156
|
function dkg_round0_process(party_id, decryption_key, encryption_keys, seed) {
|
|
157
157
|
try {
|
|
158
158
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
159
|
-
const ptr0 = passArray8ToWasm0(decryption_key, wasm.
|
|
159
|
+
const ptr0 = passArray8ToWasm0(decryption_key, wasm.__wbindgen_export2);
|
|
160
160
|
const len0 = WASM_VECTOR_LEN;
|
|
161
|
-
const ptr1 = passArray8ToWasm0(seed, wasm.
|
|
161
|
+
const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_export2);
|
|
162
162
|
const len1 = WASM_VECTOR_LEN;
|
|
163
163
|
wasm.dkg_round0_process(retptr, party_id, ptr0, len0, addHeapObject(encryption_keys), ptr1, len1);
|
|
164
164
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -182,7 +182,7 @@ exports.dkg_round0_process = dkg_round0_process;
|
|
|
182
182
|
function dkg_round1_process(round1_messages, state) {
|
|
183
183
|
try {
|
|
184
184
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
185
|
-
const ptr0 = passArray8ToWasm0(state, wasm.
|
|
185
|
+
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
186
186
|
const len0 = WASM_VECTOR_LEN;
|
|
187
187
|
wasm.dkg_round1_process(retptr, addHeapObject(round1_messages), ptr0, len0);
|
|
188
188
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -206,7 +206,7 @@ exports.dkg_round1_process = dkg_round1_process;
|
|
|
206
206
|
function dkg_round2_process(round2_messages, state) {
|
|
207
207
|
try {
|
|
208
208
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
209
|
-
const ptr0 = passArray8ToWasm0(state, wasm.
|
|
209
|
+
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
210
210
|
const len0 = WASM_VECTOR_LEN;
|
|
211
211
|
wasm.dkg_round2_process(retptr, addHeapObject(round2_messages), ptr0, len0);
|
|
212
212
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -222,12 +222,154 @@ function dkg_round2_process(round2_messages, state) {
|
|
|
222
222
|
}
|
|
223
223
|
exports.dkg_round2_process = dkg_round2_process;
|
|
224
224
|
|
|
225
|
+
/**
|
|
226
|
+
* @param {Uint8Array} share
|
|
227
|
+
* @param {string} derivation_path
|
|
228
|
+
* @param {Uint8Array} message
|
|
229
|
+
* @returns {MsgState}
|
|
230
|
+
*/
|
|
231
|
+
function dsg_round0_process(share, derivation_path, message) {
|
|
232
|
+
try {
|
|
233
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
234
|
+
const ptr0 = passArray8ToWasm0(share, wasm.__wbindgen_export2);
|
|
235
|
+
const len0 = WASM_VECTOR_LEN;
|
|
236
|
+
const ptr1 = passStringToWasm0(derivation_path, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
237
|
+
const len1 = WASM_VECTOR_LEN;
|
|
238
|
+
const ptr2 = passArray8ToWasm0(message, wasm.__wbindgen_export2);
|
|
239
|
+
const len2 = WASM_VECTOR_LEN;
|
|
240
|
+
wasm.dsg_round0_process(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
241
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
242
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
243
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
244
|
+
if (r2) {
|
|
245
|
+
throw takeObject(r1);
|
|
246
|
+
}
|
|
247
|
+
return MsgState.__wrap(r0);
|
|
248
|
+
} finally {
|
|
249
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
exports.dsg_round0_process = dsg_round0_process;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* @param {Uint8Array} round1_message
|
|
256
|
+
* @param {Uint8Array} state
|
|
257
|
+
* @returns {MsgState}
|
|
258
|
+
*/
|
|
259
|
+
function dsg_round1_process(round1_message, state) {
|
|
260
|
+
try {
|
|
261
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
262
|
+
const ptr0 = passArray8ToWasm0(round1_message, wasm.__wbindgen_export2);
|
|
263
|
+
const len0 = WASM_VECTOR_LEN;
|
|
264
|
+
const ptr1 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
265
|
+
const len1 = WASM_VECTOR_LEN;
|
|
266
|
+
wasm.dsg_round1_process(retptr, ptr0, len0, ptr1, len1);
|
|
267
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
268
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
269
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
270
|
+
if (r2) {
|
|
271
|
+
throw takeObject(r1);
|
|
272
|
+
}
|
|
273
|
+
return MsgState.__wrap(r0);
|
|
274
|
+
} finally {
|
|
275
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
exports.dsg_round1_process = dsg_round1_process;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* @param {Uint8Array} round2_message
|
|
282
|
+
* @param {Uint8Array} state
|
|
283
|
+
* @returns {MsgState}
|
|
284
|
+
*/
|
|
285
|
+
function dsg_round2_process(round2_message, state) {
|
|
286
|
+
try {
|
|
287
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
288
|
+
const ptr0 = passArray8ToWasm0(round2_message, wasm.__wbindgen_export2);
|
|
289
|
+
const len0 = WASM_VECTOR_LEN;
|
|
290
|
+
const ptr1 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
291
|
+
const len1 = WASM_VECTOR_LEN;
|
|
292
|
+
wasm.dsg_round2_process(retptr, ptr0, len0, ptr1, len1);
|
|
293
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
294
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
295
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
296
|
+
if (r2) {
|
|
297
|
+
throw takeObject(r1);
|
|
298
|
+
}
|
|
299
|
+
return MsgState.__wrap(r0);
|
|
300
|
+
} finally {
|
|
301
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
exports.dsg_round2_process = dsg_round2_process;
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* @param {Uint8Array} round2_message
|
|
308
|
+
* @param {Uint8Array} state
|
|
309
|
+
* @returns {Uint8Array}
|
|
310
|
+
*/
|
|
311
|
+
function dsg_round3_process(round2_message, state) {
|
|
312
|
+
try {
|
|
313
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
314
|
+
const ptr0 = passArray8ToWasm0(round2_message, wasm.__wbindgen_export2);
|
|
315
|
+
const len0 = WASM_VECTOR_LEN;
|
|
316
|
+
const ptr1 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
317
|
+
const len1 = WASM_VECTOR_LEN;
|
|
318
|
+
wasm.dsg_round3_process(retptr, ptr0, len0, ptr1, len1);
|
|
319
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
320
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
321
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
322
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
323
|
+
if (r3) {
|
|
324
|
+
throw takeObject(r2);
|
|
325
|
+
}
|
|
326
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
327
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
328
|
+
return v3;
|
|
329
|
+
} finally {
|
|
330
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
exports.dsg_round3_process = dsg_round3_process;
|
|
334
|
+
|
|
225
335
|
function __wbg_get_imports() {
|
|
226
336
|
const import0 = {
|
|
227
337
|
__proto__: null,
|
|
338
|
+
__wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
|
|
339
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
340
|
+
return ret;
|
|
341
|
+
},
|
|
342
|
+
__wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
|
|
343
|
+
const val = getObject(arg0);
|
|
344
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
345
|
+
return ret;
|
|
346
|
+
},
|
|
347
|
+
__wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
|
|
348
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
349
|
+
return ret;
|
|
350
|
+
},
|
|
351
|
+
__wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
|
|
352
|
+
const ret = getObject(arg0) === undefined;
|
|
353
|
+
return ret;
|
|
354
|
+
},
|
|
228
355
|
__wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
|
|
229
356
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
230
357
|
},
|
|
358
|
+
__wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
|
|
359
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
360
|
+
return addHeapObject(ret);
|
|
361
|
+
}, arguments); },
|
|
362
|
+
__wbg_call_4708e0c13bdc8e95: function() { return handleError(function (arg0, arg1, arg2) {
|
|
363
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
364
|
+
return addHeapObject(ret);
|
|
365
|
+
}, arguments); },
|
|
366
|
+
__wbg_crypto_86f2631e91b51511: function(arg0) {
|
|
367
|
+
const ret = getObject(arg0).crypto;
|
|
368
|
+
return addHeapObject(ret);
|
|
369
|
+
},
|
|
370
|
+
__wbg_getRandomValues_b3f15fcbfabb0f8b: function() { return handleError(function (arg0, arg1) {
|
|
371
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
372
|
+
}, arguments); },
|
|
231
373
|
__wbg_get_9b94d73e6221f75c: function(arg0, arg1) {
|
|
232
374
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
233
375
|
return addHeapObject(ret);
|
|
@@ -236,14 +378,74 @@ function __wbg_get_imports() {
|
|
|
236
378
|
const ret = getObject(arg0).length;
|
|
237
379
|
return ret;
|
|
238
380
|
},
|
|
381
|
+
__wbg_msCrypto_d562bbe83e0d4b91: function(arg0) {
|
|
382
|
+
const ret = getObject(arg0).msCrypto;
|
|
383
|
+
return addHeapObject(ret);
|
|
384
|
+
},
|
|
385
|
+
__wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
|
|
386
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
387
|
+
return addHeapObject(ret);
|
|
388
|
+
},
|
|
389
|
+
__wbg_new_with_length_a2c39cbe88fd8ff1: function(arg0) {
|
|
390
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
391
|
+
return addHeapObject(ret);
|
|
392
|
+
},
|
|
393
|
+
__wbg_node_e1f24f89a7336c2e: function(arg0) {
|
|
394
|
+
const ret = getObject(arg0).node;
|
|
395
|
+
return addHeapObject(ret);
|
|
396
|
+
},
|
|
397
|
+
__wbg_process_3975fd6c72f520aa: function(arg0) {
|
|
398
|
+
const ret = getObject(arg0).process;
|
|
399
|
+
return addHeapObject(ret);
|
|
400
|
+
},
|
|
239
401
|
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
240
402
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
241
403
|
},
|
|
404
|
+
__wbg_randomFillSync_f8c153b79f285817: function() { return handleError(function (arg0, arg1) {
|
|
405
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
406
|
+
}, arguments); },
|
|
407
|
+
__wbg_require_b74f47fc2d022fd6: function() { return handleError(function () {
|
|
408
|
+
const ret = module.require;
|
|
409
|
+
return addHeapObject(ret);
|
|
410
|
+
}, arguments); },
|
|
411
|
+
__wbg_static_accessor_GLOBAL_12837167ad935116: function() {
|
|
412
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
413
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
414
|
+
},
|
|
415
|
+
__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
|
|
416
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
417
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
418
|
+
},
|
|
419
|
+
__wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
|
|
420
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
421
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
422
|
+
},
|
|
423
|
+
__wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
|
|
424
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
425
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
426
|
+
},
|
|
427
|
+
__wbg_subarray_a96e1fef17ed23cb: function(arg0, arg1, arg2) {
|
|
428
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
429
|
+
return addHeapObject(ret);
|
|
430
|
+
},
|
|
431
|
+
__wbg_versions_4e31226f5e8dc909: function(arg0) {
|
|
432
|
+
const ret = getObject(arg0).versions;
|
|
433
|
+
return addHeapObject(ret);
|
|
434
|
+
},
|
|
242
435
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
436
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
437
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
438
|
+
return addHeapObject(ret);
|
|
439
|
+
},
|
|
440
|
+
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
243
441
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
244
442
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
245
443
|
return addHeapObject(ret);
|
|
246
444
|
},
|
|
445
|
+
__wbindgen_object_clone_ref: function(arg0) {
|
|
446
|
+
const ret = getObject(arg0);
|
|
447
|
+
return addHeapObject(ret);
|
|
448
|
+
},
|
|
247
449
|
__wbindgen_object_drop_ref: function(arg0) {
|
|
248
450
|
takeObject(arg0);
|
|
249
451
|
},
|
|
@@ -307,11 +509,23 @@ function getUint8ArrayMemory0() {
|
|
|
307
509
|
|
|
308
510
|
function getObject(idx) { return heap[idx]; }
|
|
309
511
|
|
|
512
|
+
function handleError(f, args) {
|
|
513
|
+
try {
|
|
514
|
+
return f.apply(this, args);
|
|
515
|
+
} catch (e) {
|
|
516
|
+
wasm.__wbindgen_export(addHeapObject(e));
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
310
520
|
let heap = new Array(128).fill(undefined);
|
|
311
521
|
heap.push(undefined, null, true, false);
|
|
312
522
|
|
|
313
523
|
let heap_next = heap.length;
|
|
314
524
|
|
|
525
|
+
function isLikeNone(x) {
|
|
526
|
+
return x === undefined || x === null;
|
|
527
|
+
}
|
|
528
|
+
|
|
315
529
|
function passArray8ToWasm0(arg, malloc) {
|
|
316
530
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
317
531
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -319,6 +533,43 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
319
533
|
return ptr;
|
|
320
534
|
}
|
|
321
535
|
|
|
536
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
537
|
+
if (realloc === undefined) {
|
|
538
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
539
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
540
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
541
|
+
WASM_VECTOR_LEN = buf.length;
|
|
542
|
+
return ptr;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
let len = arg.length;
|
|
546
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
547
|
+
|
|
548
|
+
const mem = getUint8ArrayMemory0();
|
|
549
|
+
|
|
550
|
+
let offset = 0;
|
|
551
|
+
|
|
552
|
+
for (; offset < len; offset++) {
|
|
553
|
+
const code = arg.charCodeAt(offset);
|
|
554
|
+
if (code > 0x7F) break;
|
|
555
|
+
mem[ptr + offset] = code;
|
|
556
|
+
}
|
|
557
|
+
if (offset !== len) {
|
|
558
|
+
if (offset !== 0) {
|
|
559
|
+
arg = arg.slice(offset);
|
|
560
|
+
}
|
|
561
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
562
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
563
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
564
|
+
|
|
565
|
+
offset += ret.written;
|
|
566
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
WASM_VECTOR_LEN = offset;
|
|
570
|
+
return ptr;
|
|
571
|
+
}
|
|
572
|
+
|
|
322
573
|
function takeObject(idx) {
|
|
323
574
|
const ret = getObject(idx);
|
|
324
575
|
dropObject(idx);
|
|
@@ -331,6 +582,19 @@ function decodeText(ptr, len) {
|
|
|
331
582
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
332
583
|
}
|
|
333
584
|
|
|
585
|
+
const cachedTextEncoder = new TextEncoder();
|
|
586
|
+
|
|
587
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
588
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
589
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
590
|
+
view.set(buf);
|
|
591
|
+
return {
|
|
592
|
+
read: arg.length,
|
|
593
|
+
written: buf.length
|
|
594
|
+
};
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
|
|
334
598
|
let WASM_VECTOR_LEN = 0;
|
|
335
599
|
|
|
336
600
|
const wasmPath = `${__dirname}/wasm_mps_bg.wasm`;
|
|
Binary file
|
|
@@ -6,13 +6,19 @@ export const __wbg_msgstate_free: (a: number, b: number) => void;
|
|
|
6
6
|
export const dkg_round0_process: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
7
7
|
export const dkg_round1_process: (a: number, b: number, c: number, d: number) => void;
|
|
8
8
|
export const dkg_round2_process: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const dsg_round0_process: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
|
+
export const dsg_round1_process: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
11
|
+
export const dsg_round2_process: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
12
|
+
export const dsg_round3_process: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
9
13
|
export const msgshare_msg: (a: number, b: number) => void;
|
|
10
14
|
export const msgshare_share: (a: number) => number;
|
|
11
15
|
export const msgstate_msg: (a: number, b: number) => void;
|
|
12
16
|
export const msgstate_state: (a: number, b: number) => void;
|
|
13
17
|
export const __wbg_share_free: (a: number, b: number) => void;
|
|
14
|
-
export const share_share: (a: number, b: number) => void;
|
|
15
18
|
export const share_pk: (a: number, b: number) => void;
|
|
19
|
+
export const share_share: (a: number, b: number) => void;
|
|
20
|
+
export const __wbindgen_export: (a: number) => void;
|
|
16
21
|
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
22
|
+
export const __wbindgen_export2: (a: number, b: number) => number;
|
|
23
|
+
export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|
|
24
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|
|
@@ -30,3 +30,11 @@ export function dkg_round0_process(party_id: number, decryption_key: Uint8Array,
|
|
|
30
30
|
export function dkg_round1_process(round1_messages: Array<any>, state: Uint8Array): MsgState;
|
|
31
31
|
|
|
32
32
|
export function dkg_round2_process(round2_messages: Array<any>, state: Uint8Array): Share;
|
|
33
|
+
|
|
34
|
+
export function dsg_round0_process(share: Uint8Array, derivation_path: string, message: Uint8Array): MsgState;
|
|
35
|
+
|
|
36
|
+
export function dsg_round1_process(round1_message: Uint8Array, state: Uint8Array): MsgState;
|
|
37
|
+
|
|
38
|
+
export function dsg_round2_process(round2_message: Uint8Array, state: Uint8Array): MsgState;
|
|
39
|
+
|
|
40
|
+
export function dsg_round3_process(round2_message: Uint8Array, state: Uint8Array): Uint8Array;
|
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./wasm_mps_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
|
-
MsgShare, MsgState, Share, dkg_round0_process, dkg_round1_process, dkg_round2_process
|
|
8
|
+
MsgShare, MsgState, Share, dkg_round0_process, dkg_round1_process, dkg_round2_process, dsg_round0_process, dsg_round1_process, dsg_round2_process, dsg_round3_process
|
|
9
9
|
} from "./wasm_mps_bg.js";
|
|
@@ -19,7 +19,7 @@ export class MsgShare {
|
|
|
19
19
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
20
20
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
21
21
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
22
|
-
wasm.
|
|
22
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
23
23
|
return v1;
|
|
24
24
|
} finally {
|
|
25
25
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -63,7 +63,7 @@ export class MsgState {
|
|
|
63
63
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
64
64
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
65
65
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
66
|
-
wasm.
|
|
66
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
67
67
|
return v1;
|
|
68
68
|
} finally {
|
|
69
69
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -79,7 +79,7 @@ export class MsgState {
|
|
|
79
79
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
80
80
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
81
81
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
82
|
-
wasm.
|
|
82
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
83
83
|
return v1;
|
|
84
84
|
} finally {
|
|
85
85
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -116,7 +116,7 @@ export class Share {
|
|
|
116
116
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
117
117
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
118
118
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
119
|
-
wasm.
|
|
119
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
120
120
|
return v1;
|
|
121
121
|
} finally {
|
|
122
122
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -132,7 +132,7 @@ export class Share {
|
|
|
132
132
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
133
133
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
134
134
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
135
|
-
wasm.
|
|
135
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
136
136
|
return v1;
|
|
137
137
|
} finally {
|
|
138
138
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
@@ -151,9 +151,9 @@ if (Symbol.dispose) Share.prototype[Symbol.dispose] = Share.prototype.free;
|
|
|
151
151
|
export function dkg_round0_process(party_id, decryption_key, encryption_keys, seed) {
|
|
152
152
|
try {
|
|
153
153
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
154
|
-
const ptr0 = passArray8ToWasm0(decryption_key, wasm.
|
|
154
|
+
const ptr0 = passArray8ToWasm0(decryption_key, wasm.__wbindgen_export2);
|
|
155
155
|
const len0 = WASM_VECTOR_LEN;
|
|
156
|
-
const ptr1 = passArray8ToWasm0(seed, wasm.
|
|
156
|
+
const ptr1 = passArray8ToWasm0(seed, wasm.__wbindgen_export2);
|
|
157
157
|
const len1 = WASM_VECTOR_LEN;
|
|
158
158
|
wasm.dkg_round0_process(retptr, party_id, ptr0, len0, addHeapObject(encryption_keys), ptr1, len1);
|
|
159
159
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -176,7 +176,7 @@ export function dkg_round0_process(party_id, decryption_key, encryption_keys, se
|
|
|
176
176
|
export function dkg_round1_process(round1_messages, state) {
|
|
177
177
|
try {
|
|
178
178
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
179
|
-
const ptr0 = passArray8ToWasm0(state, wasm.
|
|
179
|
+
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
180
180
|
const len0 = WASM_VECTOR_LEN;
|
|
181
181
|
wasm.dkg_round1_process(retptr, addHeapObject(round1_messages), ptr0, len0);
|
|
182
182
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -199,7 +199,7 @@ export function dkg_round1_process(round1_messages, state) {
|
|
|
199
199
|
export function dkg_round2_process(round2_messages, state) {
|
|
200
200
|
try {
|
|
201
201
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
202
|
-
const ptr0 = passArray8ToWasm0(state, wasm.
|
|
202
|
+
const ptr0 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
203
203
|
const len0 = WASM_VECTOR_LEN;
|
|
204
204
|
wasm.dkg_round2_process(retptr, addHeapObject(round2_messages), ptr0, len0);
|
|
205
205
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
@@ -213,9 +213,147 @@ export function dkg_round2_process(round2_messages, state) {
|
|
|
213
213
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @param {Uint8Array} share
|
|
219
|
+
* @param {string} derivation_path
|
|
220
|
+
* @param {Uint8Array} message
|
|
221
|
+
* @returns {MsgState}
|
|
222
|
+
*/
|
|
223
|
+
export function dsg_round0_process(share, derivation_path, message) {
|
|
224
|
+
try {
|
|
225
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
226
|
+
const ptr0 = passArray8ToWasm0(share, wasm.__wbindgen_export2);
|
|
227
|
+
const len0 = WASM_VECTOR_LEN;
|
|
228
|
+
const ptr1 = passStringToWasm0(derivation_path, wasm.__wbindgen_export2, wasm.__wbindgen_export3);
|
|
229
|
+
const len1 = WASM_VECTOR_LEN;
|
|
230
|
+
const ptr2 = passArray8ToWasm0(message, wasm.__wbindgen_export2);
|
|
231
|
+
const len2 = WASM_VECTOR_LEN;
|
|
232
|
+
wasm.dsg_round0_process(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
233
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
234
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
235
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
236
|
+
if (r2) {
|
|
237
|
+
throw takeObject(r1);
|
|
238
|
+
}
|
|
239
|
+
return MsgState.__wrap(r0);
|
|
240
|
+
} finally {
|
|
241
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* @param {Uint8Array} round1_message
|
|
247
|
+
* @param {Uint8Array} state
|
|
248
|
+
* @returns {MsgState}
|
|
249
|
+
*/
|
|
250
|
+
export function dsg_round1_process(round1_message, state) {
|
|
251
|
+
try {
|
|
252
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
253
|
+
const ptr0 = passArray8ToWasm0(round1_message, wasm.__wbindgen_export2);
|
|
254
|
+
const len0 = WASM_VECTOR_LEN;
|
|
255
|
+
const ptr1 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
256
|
+
const len1 = WASM_VECTOR_LEN;
|
|
257
|
+
wasm.dsg_round1_process(retptr, ptr0, len0, ptr1, len1);
|
|
258
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
259
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
260
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
261
|
+
if (r2) {
|
|
262
|
+
throw takeObject(r1);
|
|
263
|
+
}
|
|
264
|
+
return MsgState.__wrap(r0);
|
|
265
|
+
} finally {
|
|
266
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* @param {Uint8Array} round2_message
|
|
272
|
+
* @param {Uint8Array} state
|
|
273
|
+
* @returns {MsgState}
|
|
274
|
+
*/
|
|
275
|
+
export function dsg_round2_process(round2_message, state) {
|
|
276
|
+
try {
|
|
277
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
278
|
+
const ptr0 = passArray8ToWasm0(round2_message, wasm.__wbindgen_export2);
|
|
279
|
+
const len0 = WASM_VECTOR_LEN;
|
|
280
|
+
const ptr1 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
281
|
+
const len1 = WASM_VECTOR_LEN;
|
|
282
|
+
wasm.dsg_round2_process(retptr, ptr0, len0, ptr1, len1);
|
|
283
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
284
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
285
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
286
|
+
if (r2) {
|
|
287
|
+
throw takeObject(r1);
|
|
288
|
+
}
|
|
289
|
+
return MsgState.__wrap(r0);
|
|
290
|
+
} finally {
|
|
291
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* @param {Uint8Array} round2_message
|
|
297
|
+
* @param {Uint8Array} state
|
|
298
|
+
* @returns {Uint8Array}
|
|
299
|
+
*/
|
|
300
|
+
export function dsg_round3_process(round2_message, state) {
|
|
301
|
+
try {
|
|
302
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
303
|
+
const ptr0 = passArray8ToWasm0(round2_message, wasm.__wbindgen_export2);
|
|
304
|
+
const len0 = WASM_VECTOR_LEN;
|
|
305
|
+
const ptr1 = passArray8ToWasm0(state, wasm.__wbindgen_export2);
|
|
306
|
+
const len1 = WASM_VECTOR_LEN;
|
|
307
|
+
wasm.dsg_round3_process(retptr, ptr0, len0, ptr1, len1);
|
|
308
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
309
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
310
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
311
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
312
|
+
if (r3) {
|
|
313
|
+
throw takeObject(r2);
|
|
314
|
+
}
|
|
315
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
316
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
317
|
+
return v3;
|
|
318
|
+
} finally {
|
|
319
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
export function __wbg___wbindgen_is_function_0095a73b8b156f76(arg0) {
|
|
323
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
324
|
+
return ret;
|
|
325
|
+
}
|
|
326
|
+
export function __wbg___wbindgen_is_object_5ae8e5880f2c1fbd(arg0) {
|
|
327
|
+
const val = getObject(arg0);
|
|
328
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
329
|
+
return ret;
|
|
330
|
+
}
|
|
331
|
+
export function __wbg___wbindgen_is_string_cd444516edc5b180(arg0) {
|
|
332
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
333
|
+
return ret;
|
|
334
|
+
}
|
|
335
|
+
export function __wbg___wbindgen_is_undefined_9e4d92534c42d778(arg0) {
|
|
336
|
+
const ret = getObject(arg0) === undefined;
|
|
337
|
+
return ret;
|
|
338
|
+
}
|
|
216
339
|
export function __wbg___wbindgen_throw_be289d5034ed271b(arg0, arg1) {
|
|
217
340
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
218
341
|
}
|
|
342
|
+
export function __wbg_call_389efe28435a9388() { return handleError(function (arg0, arg1) {
|
|
343
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
344
|
+
return addHeapObject(ret);
|
|
345
|
+
}, arguments); }
|
|
346
|
+
export function __wbg_call_4708e0c13bdc8e95() { return handleError(function (arg0, arg1, arg2) {
|
|
347
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
348
|
+
return addHeapObject(ret);
|
|
349
|
+
}, arguments); }
|
|
350
|
+
export function __wbg_crypto_86f2631e91b51511(arg0) {
|
|
351
|
+
const ret = getObject(arg0).crypto;
|
|
352
|
+
return addHeapObject(ret);
|
|
353
|
+
}
|
|
354
|
+
export function __wbg_getRandomValues_b3f15fcbfabb0f8b() { return handleError(function (arg0, arg1) {
|
|
355
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
356
|
+
}, arguments); }
|
|
219
357
|
export function __wbg_get_9b94d73e6221f75c(arg0, arg1) {
|
|
220
358
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
221
359
|
return addHeapObject(ret);
|
|
@@ -224,14 +362,74 @@ export function __wbg_length_32ed9a279acd054c(arg0) {
|
|
|
224
362
|
const ret = getObject(arg0).length;
|
|
225
363
|
return ret;
|
|
226
364
|
}
|
|
365
|
+
export function __wbg_msCrypto_d562bbe83e0d4b91(arg0) {
|
|
366
|
+
const ret = getObject(arg0).msCrypto;
|
|
367
|
+
return addHeapObject(ret);
|
|
368
|
+
}
|
|
369
|
+
export function __wbg_new_no_args_1c7c842f08d00ebb(arg0, arg1) {
|
|
370
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
371
|
+
return addHeapObject(ret);
|
|
372
|
+
}
|
|
373
|
+
export function __wbg_new_with_length_a2c39cbe88fd8ff1(arg0) {
|
|
374
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
375
|
+
return addHeapObject(ret);
|
|
376
|
+
}
|
|
377
|
+
export function __wbg_node_e1f24f89a7336c2e(arg0) {
|
|
378
|
+
const ret = getObject(arg0).node;
|
|
379
|
+
return addHeapObject(ret);
|
|
380
|
+
}
|
|
381
|
+
export function __wbg_process_3975fd6c72f520aa(arg0) {
|
|
382
|
+
const ret = getObject(arg0).process;
|
|
383
|
+
return addHeapObject(ret);
|
|
384
|
+
}
|
|
227
385
|
export function __wbg_prototypesetcall_bdcdcc5842e4d77d(arg0, arg1, arg2) {
|
|
228
386
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
229
387
|
}
|
|
388
|
+
export function __wbg_randomFillSync_f8c153b79f285817() { return handleError(function (arg0, arg1) {
|
|
389
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
390
|
+
}, arguments); }
|
|
391
|
+
export function __wbg_require_b74f47fc2d022fd6() { return handleError(function () {
|
|
392
|
+
const ret = module.require;
|
|
393
|
+
return addHeapObject(ret);
|
|
394
|
+
}, arguments); }
|
|
395
|
+
export function __wbg_static_accessor_GLOBAL_12837167ad935116() {
|
|
396
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
397
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
398
|
+
}
|
|
399
|
+
export function __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f() {
|
|
400
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
401
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
402
|
+
}
|
|
403
|
+
export function __wbg_static_accessor_SELF_a621d3dfbb60d0ce() {
|
|
404
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
405
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
406
|
+
}
|
|
407
|
+
export function __wbg_static_accessor_WINDOW_f8727f0cf888e0bd() {
|
|
408
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
409
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
410
|
+
}
|
|
411
|
+
export function __wbg_subarray_a96e1fef17ed23cb(arg0, arg1, arg2) {
|
|
412
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
413
|
+
return addHeapObject(ret);
|
|
414
|
+
}
|
|
415
|
+
export function __wbg_versions_4e31226f5e8dc909(arg0) {
|
|
416
|
+
const ret = getObject(arg0).versions;
|
|
417
|
+
return addHeapObject(ret);
|
|
418
|
+
}
|
|
230
419
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
420
|
+
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
421
|
+
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
422
|
+
return addHeapObject(ret);
|
|
423
|
+
}
|
|
424
|
+
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
231
425
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
232
426
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
233
427
|
return addHeapObject(ret);
|
|
234
428
|
}
|
|
429
|
+
export function __wbindgen_object_clone_ref(arg0) {
|
|
430
|
+
const ret = getObject(arg0);
|
|
431
|
+
return addHeapObject(ret);
|
|
432
|
+
}
|
|
235
433
|
export function __wbindgen_object_drop_ref(arg0) {
|
|
236
434
|
takeObject(arg0);
|
|
237
435
|
}
|
|
@@ -288,11 +486,23 @@ function getUint8ArrayMemory0() {
|
|
|
288
486
|
|
|
289
487
|
function getObject(idx) { return heap[idx]; }
|
|
290
488
|
|
|
489
|
+
function handleError(f, args) {
|
|
490
|
+
try {
|
|
491
|
+
return f.apply(this, args);
|
|
492
|
+
} catch (e) {
|
|
493
|
+
wasm.__wbindgen_export(addHeapObject(e));
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
291
497
|
let heap = new Array(128).fill(undefined);
|
|
292
498
|
heap.push(undefined, null, true, false);
|
|
293
499
|
|
|
294
500
|
let heap_next = heap.length;
|
|
295
501
|
|
|
502
|
+
function isLikeNone(x) {
|
|
503
|
+
return x === undefined || x === null;
|
|
504
|
+
}
|
|
505
|
+
|
|
296
506
|
function passArray8ToWasm0(arg, malloc) {
|
|
297
507
|
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
298
508
|
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
@@ -300,6 +510,43 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
300
510
|
return ptr;
|
|
301
511
|
}
|
|
302
512
|
|
|
513
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
514
|
+
if (realloc === undefined) {
|
|
515
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
516
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
517
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
518
|
+
WASM_VECTOR_LEN = buf.length;
|
|
519
|
+
return ptr;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
let len = arg.length;
|
|
523
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
524
|
+
|
|
525
|
+
const mem = getUint8ArrayMemory0();
|
|
526
|
+
|
|
527
|
+
let offset = 0;
|
|
528
|
+
|
|
529
|
+
for (; offset < len; offset++) {
|
|
530
|
+
const code = arg.charCodeAt(offset);
|
|
531
|
+
if (code > 0x7F) break;
|
|
532
|
+
mem[ptr + offset] = code;
|
|
533
|
+
}
|
|
534
|
+
if (offset !== len) {
|
|
535
|
+
if (offset !== 0) {
|
|
536
|
+
arg = arg.slice(offset);
|
|
537
|
+
}
|
|
538
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
539
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
540
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
541
|
+
|
|
542
|
+
offset += ret.written;
|
|
543
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
WASM_VECTOR_LEN = offset;
|
|
547
|
+
return ptr;
|
|
548
|
+
}
|
|
549
|
+
|
|
303
550
|
function takeObject(idx) {
|
|
304
551
|
const ret = getObject(idx);
|
|
305
552
|
dropObject(idx);
|
|
@@ -320,6 +567,19 @@ function decodeText(ptr, len) {
|
|
|
320
567
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
321
568
|
}
|
|
322
569
|
|
|
570
|
+
const cachedTextEncoder = new TextEncoder();
|
|
571
|
+
|
|
572
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
573
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
574
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
575
|
+
view.set(buf);
|
|
576
|
+
return {
|
|
577
|
+
read: arg.length,
|
|
578
|
+
written: buf.length
|
|
579
|
+
};
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
|
|
323
583
|
let WASM_VECTOR_LEN = 0;
|
|
324
584
|
|
|
325
585
|
|
|
Binary file
|
|
@@ -6,13 +6,19 @@ export const __wbg_msgstate_free: (a: number, b: number) => void;
|
|
|
6
6
|
export const dkg_round0_process: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
7
7
|
export const dkg_round1_process: (a: number, b: number, c: number, d: number) => void;
|
|
8
8
|
export const dkg_round2_process: (a: number, b: number, c: number, d: number) => void;
|
|
9
|
+
export const dsg_round0_process: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
10
|
+
export const dsg_round1_process: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
11
|
+
export const dsg_round2_process: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
12
|
+
export const dsg_round3_process: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
9
13
|
export const msgshare_msg: (a: number, b: number) => void;
|
|
10
14
|
export const msgshare_share: (a: number) => number;
|
|
11
15
|
export const msgstate_msg: (a: number, b: number) => void;
|
|
12
16
|
export const msgstate_state: (a: number, b: number) => void;
|
|
13
17
|
export const __wbg_share_free: (a: number, b: number) => void;
|
|
14
|
-
export const share_share: (a: number, b: number) => void;
|
|
15
18
|
export const share_pk: (a: number, b: number) => void;
|
|
19
|
+
export const share_share: (a: number, b: number) => void;
|
|
20
|
+
export const __wbindgen_export: (a: number) => void;
|
|
16
21
|
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
22
|
+
export const __wbindgen_export2: (a: number, b: number) => number;
|
|
23
|
+
export const __wbindgen_export3: (a: number, b: number, c: number, d: number) => number;
|
|
24
|
+
export const __wbindgen_export4: (a: number, b: number, c: number) => void;
|