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