@enclave-e3/wasm 0.1.7 → 0.1.8

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.
@@ -1,144 +1,5 @@
1
+ /* @ts-self-types="./e3_wasm.d.ts" */
1
2
 
2
- let imports = {};
3
- imports['__wbindgen_placeholder__'] = module.exports;
4
-
5
- let cachedUint8ArrayMemory0 = null;
6
-
7
- function getUint8ArrayMemory0() {
8
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
- }
11
- return cachedUint8ArrayMemory0;
12
- }
13
-
14
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
15
-
16
- cachedTextDecoder.decode();
17
-
18
- function decodeText(ptr, len) {
19
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
20
- }
21
-
22
- function getStringFromWasm0(ptr, len) {
23
- ptr = ptr >>> 0;
24
- return decodeText(ptr, len);
25
- }
26
-
27
- let WASM_VECTOR_LEN = 0;
28
-
29
- const cachedTextEncoder = new TextEncoder();
30
-
31
- if (!('encodeInto' in cachedTextEncoder)) {
32
- cachedTextEncoder.encodeInto = function (arg, view) {
33
- const buf = cachedTextEncoder.encode(arg);
34
- view.set(buf);
35
- return {
36
- read: arg.length,
37
- written: buf.length
38
- };
39
- }
40
- }
41
-
42
- function passStringToWasm0(arg, malloc, realloc) {
43
-
44
- if (realloc === undefined) {
45
- const buf = cachedTextEncoder.encode(arg);
46
- const ptr = malloc(buf.length, 1) >>> 0;
47
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
48
- WASM_VECTOR_LEN = buf.length;
49
- return ptr;
50
- }
51
-
52
- let len = arg.length;
53
- let ptr = malloc(len, 1) >>> 0;
54
-
55
- const mem = getUint8ArrayMemory0();
56
-
57
- let offset = 0;
58
-
59
- for (; offset < len; offset++) {
60
- const code = arg.charCodeAt(offset);
61
- if (code > 0x7F) break;
62
- mem[ptr + offset] = code;
63
- }
64
-
65
- if (offset !== len) {
66
- if (offset !== 0) {
67
- arg = arg.slice(offset);
68
- }
69
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
70
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
71
- const ret = cachedTextEncoder.encodeInto(arg, view);
72
-
73
- offset += ret.written;
74
- ptr = realloc(ptr, len, offset, 1) >>> 0;
75
- }
76
-
77
- WASM_VECTOR_LEN = offset;
78
- return ptr;
79
- }
80
-
81
- let cachedDataViewMemory0 = null;
82
-
83
- function getDataViewMemory0() {
84
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
85
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
86
- }
87
- return cachedDataViewMemory0;
88
- }
89
-
90
- function addToExternrefTable0(obj) {
91
- const idx = wasm.__externref_table_alloc();
92
- wasm.__wbindgen_externrefs.set(idx, obj);
93
- return idx;
94
- }
95
-
96
- function handleError(f, args) {
97
- try {
98
- return f.apply(this, args);
99
- } catch (e) {
100
- const idx = addToExternrefTable0(e);
101
- wasm.__wbindgen_exn_store(idx);
102
- }
103
- }
104
-
105
- function getArrayU8FromWasm0(ptr, len) {
106
- ptr = ptr >>> 0;
107
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
108
- }
109
-
110
- function isLikeNone(x) {
111
- return x === undefined || x === null;
112
- }
113
-
114
- function passArray8ToWasm0(arg, malloc) {
115
- const ptr = malloc(arg.length * 1, 1) >>> 0;
116
- getUint8ArrayMemory0().set(arg, ptr / 1);
117
- WASM_VECTOR_LEN = arg.length;
118
- return ptr;
119
- }
120
-
121
- let cachedBigUint64ArrayMemory0 = null;
122
-
123
- function getBigUint64ArrayMemory0() {
124
- if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {
125
- cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);
126
- }
127
- return cachedBigUint64ArrayMemory0;
128
- }
129
-
130
- function passArray64ToWasm0(arg, malloc) {
131
- const ptr = malloc(arg.length * 8, 8) >>> 0;
132
- getBigUint64ArrayMemory0().set(arg, ptr / 8);
133
- WASM_VECTOR_LEN = arg.length;
134
- return ptr;
135
- }
136
-
137
- function takeFromExternrefTable0(idx) {
138
- const value = wasm.__wbindgen_externrefs.get(idx);
139
- wasm.__externref_table_dealloc(idx);
140
- return value;
141
- }
142
3
  /**
143
4
  * A function to encrypt a u64 value using BFV and default params.
144
5
  *
@@ -164,7 +25,7 @@ function takeFromExternrefTable0(idx) {
164
25
  * @param {BigUint64Array} moduli
165
26
  * @returns {Uint8Array}
166
27
  */
167
- exports.bfv_encrypt_number = function(data, public_key, degree, plaintext_modulus, moduli) {
28
+ function bfv_encrypt_number(data, public_key, degree, plaintext_modulus, moduli) {
168
29
  const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
169
30
  const len0 = WASM_VECTOR_LEN;
170
31
  const ptr1 = passArray64ToWasm0(moduli, wasm.__wbindgen_malloc);
@@ -176,7 +37,8 @@ exports.bfv_encrypt_number = function(data, public_key, degree, plaintext_modulu
176
37
  var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
177
38
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
178
39
  return v3;
179
- };
40
+ }
41
+ exports.bfv_encrypt_number = bfv_encrypt_number;
180
42
 
181
43
  /**
182
44
  * A function to encrypt a Vec<u64> value using BFV and default params.
@@ -203,7 +65,7 @@ exports.bfv_encrypt_number = function(data, public_key, degree, plaintext_modulu
203
65
  * @param {BigUint64Array} moduli
204
66
  * @returns {Uint8Array}
205
67
  */
206
- exports.bfv_encrypt_vector = function(data, public_key, degree, plaintext_modulus, moduli) {
68
+ function bfv_encrypt_vector(data, public_key, degree, plaintext_modulus, moduli) {
207
69
  const ptr0 = passArray64ToWasm0(data, wasm.__wbindgen_malloc);
208
70
  const len0 = WASM_VECTOR_LEN;
209
71
  const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
@@ -217,18 +79,9 @@ exports.bfv_encrypt_vector = function(data, public_key, degree, plaintext_modulu
217
79
  var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
218
80
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
219
81
  return v4;
220
- };
221
-
222
- function getArrayJsValueFromWasm0(ptr, len) {
223
- ptr = ptr >>> 0;
224
- const mem = getDataViewMemory0();
225
- const result = [];
226
- for (let i = ptr; i < ptr + 4 * len; i += 4) {
227
- result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
228
- }
229
- wasm.__externref_drop_slice(ptr, len);
230
- return result;
231
82
  }
83
+ exports.bfv_encrypt_vector = bfv_encrypt_vector;
84
+
232
85
  /**
233
86
  * A function to encrypt a u64 value using BFV and default params and
234
87
  * generate circuit inputs for Greco
@@ -255,7 +108,7 @@ function getArrayJsValueFromWasm0(ptr, len) {
255
108
  * @param {BigUint64Array} moduli
256
109
  * @returns {any[]}
257
110
  */
258
- exports.bfv_verifiable_encrypt_number = function(data, public_key, degree, plaintext_modulus, moduli) {
111
+ function bfv_verifiable_encrypt_number(data, public_key, degree, plaintext_modulus, moduli) {
259
112
  const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
260
113
  const len0 = WASM_VECTOR_LEN;
261
114
  const ptr1 = passArray64ToWasm0(moduli, wasm.__wbindgen_malloc);
@@ -267,7 +120,8 @@ exports.bfv_verifiable_encrypt_number = function(data, public_key, degree, plain
267
120
  var v3 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
268
121
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
269
122
  return v3;
270
- };
123
+ }
124
+ exports.bfv_verifiable_encrypt_number = bfv_verifiable_encrypt_number;
271
125
 
272
126
  /**
273
127
  * A function to encrypt a Vec<u64> value using BFV and default params and
@@ -295,7 +149,7 @@ exports.bfv_verifiable_encrypt_number = function(data, public_key, degree, plain
295
149
  * @param {BigUint64Array} moduli
296
150
  * @returns {any[]}
297
151
  */
298
- exports.bfv_verifiable_encrypt_vector = function(data, public_key, degree, plaintext_modulus, moduli) {
152
+ function bfv_verifiable_encrypt_vector(data, public_key, degree, plaintext_modulus, moduli) {
299
153
  const ptr0 = passArray64ToWasm0(data, wasm.__wbindgen_malloc);
300
154
  const len0 = WASM_VECTOR_LEN;
301
155
  const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
@@ -309,13 +163,48 @@ exports.bfv_verifiable_encrypt_vector = function(data, public_key, degree, plain
309
163
  var v4 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
310
164
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
311
165
  return v4;
312
- };
166
+ }
167
+ exports.bfv_verifiable_encrypt_vector = bfv_verifiable_encrypt_vector;
168
+
169
+ /**
170
+ * A function to compute the public key commitment for a given public key.
171
+ *
172
+ * # Arguments
173
+ *
174
+ * * `public_key` - The public key to compute the commitment for
175
+ *
176
+ * # Returns
177
+ * Returns a `Result<Vec<u8>, JsValue>` containing the commitment and any errors.
178
+ *
179
+ * # Panics
180
+ *
181
+ * Panics if the public key cannot be computed
182
+ * @param {Uint8Array} public_key
183
+ * @param {number} degree
184
+ * @param {bigint} plaintext_modulus
185
+ * @param {BigUint64Array} moduli
186
+ * @returns {Uint8Array}
187
+ */
188
+ function compute_pk_commitment(public_key, degree, plaintext_modulus, moduli) {
189
+ const ptr0 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
190
+ const len0 = WASM_VECTOR_LEN;
191
+ const ptr1 = passArray64ToWasm0(moduli, wasm.__wbindgen_malloc);
192
+ const len1 = WASM_VECTOR_LEN;
193
+ const ret = wasm.compute_pk_commitment(ptr0, len0, degree, plaintext_modulus, ptr1, len1);
194
+ if (ret[3]) {
195
+ throw takeFromExternrefTable0(ret[2]);
196
+ }
197
+ var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
198
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
199
+ return v3;
200
+ }
201
+ exports.compute_pk_commitment = compute_pk_commitment;
313
202
 
314
203
  /**
315
204
  * Retrieves a BFV parameter set by name.
316
205
  *
317
206
  * # Parameters
318
- * * `name` - Parameter set identifier (e.g., "SET_8192_1000_4")
207
+ * * `name` - Parameter set identifier (e.g., "SECURE_THRESHOLD_BFV_8192")
319
208
  *
320
209
  * # Returns
321
210
  * A JavaScript object with the following structure:
@@ -333,7 +222,7 @@ exports.bfv_verifiable_encrypt_vector = function(data, public_key, degree, plain
333
222
  * @param {string} name
334
223
  * @returns {any}
335
224
  */
336
- exports.get_bfv_params = function(name) {
225
+ function get_bfv_params(name) {
337
226
  const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
338
227
  const len0 = WASM_VECTOR_LEN;
339
228
  const ret = wasm.get_bfv_params(ptr0, len0);
@@ -341,219 +230,334 @@ exports.get_bfv_params = function(name) {
341
230
  throw takeFromExternrefTable0(ret[1]);
342
231
  }
343
232
  return takeFromExternrefTable0(ret[0]);
344
- };
233
+ }
234
+ exports.get_bfv_params = get_bfv_params;
345
235
 
346
236
  /**
347
237
  * Returns all available BFV parameter set identifiers.
348
238
  *
349
239
  * # Returns
350
240
  * Array of parameter set names that can be passed to `get_bfv_params()`.
351
- * Includes both production-ready sets (e.g., "SET_8192_1000_4") and
241
+ * Includes both production-ready sets (e.g., "SECURE_THRESHOLD_BFV_8192") and
352
242
  * insecure sets for testing (prefixed with "INSECURE_").
353
243
  * @returns {string[]}
354
244
  */
355
- exports.get_bfv_params_list = function() {
245
+ function get_bfv_params_list() {
356
246
  const ret = wasm.get_bfv_params_list();
357
247
  var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
358
248
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
359
249
  return v1;
360
- };
250
+ }
251
+ exports.get_bfv_params_list = get_bfv_params_list;
252
+
253
+ function __wbg_get_imports() {
254
+ const import0 = {
255
+ __proto__: null,
256
+ __wbg_Error_8c4e43fe74559d73: function(arg0, arg1) {
257
+ const ret = Error(getStringFromWasm0(arg0, arg1));
258
+ return ret;
259
+ },
260
+ __wbg_String_8f0eb39a4a4c2f66: function(arg0, arg1) {
261
+ const ret = String(arg1);
262
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
263
+ const len1 = WASM_VECTOR_LEN;
264
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
265
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
266
+ },
267
+ __wbg___wbindgen_is_function_0095a73b8b156f76: function(arg0) {
268
+ const ret = typeof(arg0) === 'function';
269
+ return ret;
270
+ },
271
+ __wbg___wbindgen_is_object_5ae8e5880f2c1fbd: function(arg0) {
272
+ const val = arg0;
273
+ const ret = typeof(val) === 'object' && val !== null;
274
+ return ret;
275
+ },
276
+ __wbg___wbindgen_is_string_cd444516edc5b180: function(arg0) {
277
+ const ret = typeof(arg0) === 'string';
278
+ return ret;
279
+ },
280
+ __wbg___wbindgen_is_undefined_9e4d92534c42d778: function(arg0) {
281
+ const ret = arg0 === undefined;
282
+ return ret;
283
+ },
284
+ __wbg___wbindgen_throw_be289d5034ed271b: function(arg0, arg1) {
285
+ throw new Error(getStringFromWasm0(arg0, arg1));
286
+ },
287
+ __wbg_call_389efe28435a9388: function() { return handleError(function (arg0, arg1) {
288
+ const ret = arg0.call(arg1);
289
+ return ret;
290
+ }, arguments); },
291
+ __wbg_call_4708e0c13bdc8e95: function() { return handleError(function (arg0, arg1, arg2) {
292
+ const ret = arg0.call(arg1, arg2);
293
+ return ret;
294
+ }, arguments); },
295
+ __wbg_crypto_86f2631e91b51511: function(arg0) {
296
+ const ret = arg0.crypto;
297
+ return ret;
298
+ },
299
+ __wbg_getRandomValues_b3f15fcbfabb0f8b: function() { return handleError(function (arg0, arg1) {
300
+ arg0.getRandomValues(arg1);
301
+ }, arguments); },
302
+ __wbg_length_32ed9a279acd054c: function(arg0) {
303
+ const ret = arg0.length;
304
+ return ret;
305
+ },
306
+ __wbg_msCrypto_d562bbe83e0d4b91: function(arg0) {
307
+ const ret = arg0.msCrypto;
308
+ return ret;
309
+ },
310
+ __wbg_new_361308b2356cecd0: function() {
311
+ const ret = new Object();
312
+ return ret;
313
+ },
314
+ __wbg_new_3eb36ae241fe6f44: function() {
315
+ const ret = new Array();
316
+ return ret;
317
+ },
318
+ __wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
319
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
320
+ return ret;
321
+ },
322
+ __wbg_new_with_length_a2c39cbe88fd8ff1: function(arg0) {
323
+ const ret = new Uint8Array(arg0 >>> 0);
324
+ return ret;
325
+ },
326
+ __wbg_node_e1f24f89a7336c2e: function(arg0) {
327
+ const ret = arg0.node;
328
+ return ret;
329
+ },
330
+ __wbg_process_3975fd6c72f520aa: function(arg0) {
331
+ const ret = arg0.process;
332
+ return ret;
333
+ },
334
+ __wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
335
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
336
+ },
337
+ __wbg_randomFillSync_f8c153b79f285817: function() { return handleError(function (arg0, arg1) {
338
+ arg0.randomFillSync(arg1);
339
+ }, arguments); },
340
+ __wbg_require_b74f47fc2d022fd6: function() { return handleError(function () {
341
+ const ret = module.require;
342
+ return ret;
343
+ }, arguments); },
344
+ __wbg_set_3f1d0b984ed272ed: function(arg0, arg1, arg2) {
345
+ arg0[arg1] = arg2;
346
+ },
347
+ __wbg_set_f43e577aea94465b: function(arg0, arg1, arg2) {
348
+ arg0[arg1 >>> 0] = arg2;
349
+ },
350
+ __wbg_static_accessor_GLOBAL_12837167ad935116: function() {
351
+ const ret = typeof global === 'undefined' ? null : global;
352
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
353
+ },
354
+ __wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f: function() {
355
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
356
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
357
+ },
358
+ __wbg_static_accessor_SELF_a621d3dfbb60d0ce: function() {
359
+ const ret = typeof self === 'undefined' ? null : self;
360
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
361
+ },
362
+ __wbg_static_accessor_WINDOW_f8727f0cf888e0bd: function() {
363
+ const ret = typeof window === 'undefined' ? null : window;
364
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
365
+ },
366
+ __wbg_subarray_a96e1fef17ed23cb: function(arg0, arg1, arg2) {
367
+ const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
368
+ return ret;
369
+ },
370
+ __wbg_versions_4e31226f5e8dc909: function(arg0) {
371
+ const ret = arg0.versions;
372
+ return ret;
373
+ },
374
+ __wbindgen_cast_0000000000000001: function(arg0) {
375
+ // Cast intrinsic for `F64 -> Externref`.
376
+ const ret = arg0;
377
+ return ret;
378
+ },
379
+ __wbindgen_cast_0000000000000002: function(arg0, arg1) {
380
+ // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
381
+ const ret = getArrayU8FromWasm0(arg0, arg1);
382
+ return ret;
383
+ },
384
+ __wbindgen_cast_0000000000000003: function(arg0, arg1) {
385
+ // Cast intrinsic for `Ref(String) -> Externref`.
386
+ const ret = getStringFromWasm0(arg0, arg1);
387
+ return ret;
388
+ },
389
+ __wbindgen_cast_0000000000000004: function(arg0) {
390
+ // Cast intrinsic for `U64 -> Externref`.
391
+ const ret = BigInt.asUintN(64, arg0);
392
+ return ret;
393
+ },
394
+ __wbindgen_cast_0000000000000005: function(arg0, arg1) {
395
+ var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
396
+ wasm.__wbindgen_free(arg0, arg1 * 1, 1);
397
+ // Cast intrinsic for `Vector(U8) -> Externref`.
398
+ const ret = v0;
399
+ return ret;
400
+ },
401
+ __wbindgen_init_externref_table: function() {
402
+ const table = wasm.__wbindgen_externrefs;
403
+ const offset = table.grow(4);
404
+ table.set(0, undefined);
405
+ table.set(offset + 0, undefined);
406
+ table.set(offset + 1, null);
407
+ table.set(offset + 2, true);
408
+ table.set(offset + 3, false);
409
+ },
410
+ };
411
+ return {
412
+ __proto__: null,
413
+ "./e3_wasm_bg.js": import0,
414
+ };
415
+ }
361
416
 
362
- exports.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
363
- const ret = Error(getStringFromWasm0(arg0, arg1));
364
- return ret;
365
- };
417
+ function addToExternrefTable0(obj) {
418
+ const idx = wasm.__externref_table_alloc();
419
+ wasm.__wbindgen_externrefs.set(idx, obj);
420
+ return idx;
421
+ }
366
422
 
367
- exports.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
368
- const ret = String(arg1);
369
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
370
- const len1 = WASM_VECTOR_LEN;
371
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
372
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
373
- };
374
-
375
- exports.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
376
- const ret = typeof(arg0) === 'function';
377
- return ret;
378
- };
379
-
380
- exports.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
381
- const val = arg0;
382
- const ret = typeof(val) === 'object' && val !== null;
383
- return ret;
384
- };
385
-
386
- exports.__wbg___wbindgen_is_string_fbb76cb2940daafd = function(arg0) {
387
- const ret = typeof(arg0) === 'string';
388
- return ret;
389
- };
390
-
391
- exports.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
392
- const ret = arg0 === undefined;
393
- return ret;
394
- };
395
-
396
- exports.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
397
- throw new Error(getStringFromWasm0(arg0, arg1));
398
- };
399
-
400
- exports.__wbg_call_525440f72fbfc0ea = function() { return handleError(function (arg0, arg1, arg2) {
401
- const ret = arg0.call(arg1, arg2);
402
- return ret;
403
- }, arguments) };
404
-
405
- exports.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
406
- const ret = arg0.call(arg1);
407
- return ret;
408
- }, arguments) };
409
-
410
- exports.__wbg_crypto_574e78ad8b13b65f = function(arg0) {
411
- const ret = arg0.crypto;
412
- return ret;
413
- };
414
-
415
- exports.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
416
- arg0.getRandomValues(arg1);
417
- }, arguments) };
418
-
419
- exports.__wbg_length_69bca3cb64fc8748 = function(arg0) {
420
- const ret = arg0.length;
421
- return ret;
422
- };
423
-
424
- exports.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
425
- const ret = arg0.msCrypto;
426
- return ret;
427
- };
428
-
429
- exports.__wbg_new_1acc0b6eea89d040 = function() {
430
- const ret = new Object();
431
- return ret;
432
- };
433
-
434
- exports.__wbg_new_e17d9f43105b08be = function() {
435
- const ret = new Array();
436
- return ret;
437
- };
438
-
439
- exports.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
440
- const ret = new Function(getStringFromWasm0(arg0, arg1));
441
- return ret;
442
- };
443
-
444
- exports.__wbg_new_with_length_01aa0dc35aa13543 = function(arg0) {
445
- const ret = new Uint8Array(arg0 >>> 0);
446
- return ret;
447
- };
448
-
449
- exports.__wbg_node_905d3e251edff8a2 = function(arg0) {
450
- const ret = arg0.node;
451
- return ret;
452
- };
453
-
454
- exports.__wbg_process_dc0fbacc7c1c06f7 = function(arg0) {
455
- const ret = arg0.process;
456
- return ret;
457
- };
458
-
459
- exports.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
460
- Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
461
- };
462
-
463
- exports.__wbg_randomFillSync_ac0988aba3254290 = function() { return handleError(function (arg0, arg1) {
464
- arg0.randomFillSync(arg1);
465
- }, arguments) };
466
-
467
- exports.__wbg_require_60cc747a6bc5215a = function() { return handleError(function () {
468
- const ret = module.require;
469
- return ret;
470
- }, arguments) };
471
-
472
- exports.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
473
- arg0[arg1] = arg2;
474
- };
475
-
476
- exports.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
477
- arg0[arg1 >>> 0] = arg2;
478
- };
479
-
480
- exports.__wbg_static_accessor_GLOBAL_89e1d9ac6a1b250e = function() {
481
- const ret = typeof global === 'undefined' ? null : global;
482
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
483
- };
484
-
485
- exports.__wbg_static_accessor_GLOBAL_THIS_8b530f326a9e48ac = function() {
486
- const ret = typeof globalThis === 'undefined' ? null : globalThis;
487
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
488
- };
489
-
490
- exports.__wbg_static_accessor_SELF_6fdf4b64710cc91b = function() {
491
- const ret = typeof self === 'undefined' ? null : self;
492
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
493
- };
494
-
495
- exports.__wbg_static_accessor_WINDOW_b45bfc5a37f6cfa2 = function() {
496
- const ret = typeof window === 'undefined' ? null : window;
497
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
498
- };
499
-
500
- exports.__wbg_subarray_480600f3d6a9f26c = function(arg0, arg1, arg2) {
501
- const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
502
- return ret;
503
- };
504
-
505
- exports.__wbg_versions_c01dfd4722a88165 = function(arg0) {
506
- const ret = arg0.versions;
507
- return ret;
508
- };
509
-
510
- exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
511
- // Cast intrinsic for `Ref(String) -> Externref`.
512
- const ret = getStringFromWasm0(arg0, arg1);
513
- return ret;
514
- };
515
-
516
- exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
517
- // Cast intrinsic for `U64 -> Externref`.
518
- const ret = BigInt.asUintN(64, arg0);
519
- return ret;
520
- };
521
-
522
- exports.__wbindgen_cast_77bc3e92745e9a35 = function(arg0, arg1) {
523
- var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
524
- wasm.__wbindgen_free(arg0, arg1 * 1, 1);
525
- // Cast intrinsic for `Vector(U8) -> Externref`.
526
- const ret = v0;
527
- return ret;
528
- };
529
-
530
- exports.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
531
- // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
532
- const ret = getArrayU8FromWasm0(arg0, arg1);
533
- return ret;
534
- };
535
-
536
- exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
537
- // Cast intrinsic for `F64 -> Externref`.
538
- const ret = arg0;
539
- return ret;
540
- };
541
-
542
- exports.__wbindgen_init_externref_table = function() {
543
- const table = wasm.__wbindgen_externrefs;
544
- const offset = table.grow(4);
545
- table.set(0, undefined);
546
- table.set(offset + 0, undefined);
547
- table.set(offset + 1, null);
548
- table.set(offset + 2, true);
549
- table.set(offset + 3, false);
550
- ;
551
- };
423
+ function getArrayJsValueFromWasm0(ptr, len) {
424
+ ptr = ptr >>> 0;
425
+ const mem = getDataViewMemory0();
426
+ const result = [];
427
+ for (let i = ptr; i < ptr + 4 * len; i += 4) {
428
+ result.push(wasm.__wbindgen_externrefs.get(mem.getUint32(i, true)));
429
+ }
430
+ wasm.__externref_drop_slice(ptr, len);
431
+ return result;
432
+ }
433
+
434
+ function getArrayU8FromWasm0(ptr, len) {
435
+ ptr = ptr >>> 0;
436
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
437
+ }
438
+
439
+ let cachedBigUint64ArrayMemory0 = null;
440
+ function getBigUint64ArrayMemory0() {
441
+ if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {
442
+ cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);
443
+ }
444
+ return cachedBigUint64ArrayMemory0;
445
+ }
446
+
447
+ let cachedDataViewMemory0 = null;
448
+ function getDataViewMemory0() {
449
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
450
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
451
+ }
452
+ return cachedDataViewMemory0;
453
+ }
454
+
455
+ function getStringFromWasm0(ptr, len) {
456
+ ptr = ptr >>> 0;
457
+ return decodeText(ptr, len);
458
+ }
459
+
460
+ let cachedUint8ArrayMemory0 = null;
461
+ function getUint8ArrayMemory0() {
462
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
463
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
464
+ }
465
+ return cachedUint8ArrayMemory0;
466
+ }
467
+
468
+ function handleError(f, args) {
469
+ try {
470
+ return f.apply(this, args);
471
+ } catch (e) {
472
+ const idx = addToExternrefTable0(e);
473
+ wasm.__wbindgen_exn_store(idx);
474
+ }
475
+ }
476
+
477
+ function isLikeNone(x) {
478
+ return x === undefined || x === null;
479
+ }
480
+
481
+ function passArray64ToWasm0(arg, malloc) {
482
+ const ptr = malloc(arg.length * 8, 8) >>> 0;
483
+ getBigUint64ArrayMemory0().set(arg, ptr / 8);
484
+ WASM_VECTOR_LEN = arg.length;
485
+ return ptr;
486
+ }
487
+
488
+ function passArray8ToWasm0(arg, malloc) {
489
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
490
+ getUint8ArrayMemory0().set(arg, ptr / 1);
491
+ WASM_VECTOR_LEN = arg.length;
492
+ return ptr;
493
+ }
494
+
495
+ function passStringToWasm0(arg, malloc, realloc) {
496
+ if (realloc === undefined) {
497
+ const buf = cachedTextEncoder.encode(arg);
498
+ const ptr = malloc(buf.length, 1) >>> 0;
499
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
500
+ WASM_VECTOR_LEN = buf.length;
501
+ return ptr;
502
+ }
503
+
504
+ let len = arg.length;
505
+ let ptr = malloc(len, 1) >>> 0;
506
+
507
+ const mem = getUint8ArrayMemory0();
508
+
509
+ let offset = 0;
510
+
511
+ for (; offset < len; offset++) {
512
+ const code = arg.charCodeAt(offset);
513
+ if (code > 0x7F) break;
514
+ mem[ptr + offset] = code;
515
+ }
516
+ if (offset !== len) {
517
+ if (offset !== 0) {
518
+ arg = arg.slice(offset);
519
+ }
520
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
521
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
522
+ const ret = cachedTextEncoder.encodeInto(arg, view);
523
+
524
+ offset += ret.written;
525
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
526
+ }
527
+
528
+ WASM_VECTOR_LEN = offset;
529
+ return ptr;
530
+ }
531
+
532
+ function takeFromExternrefTable0(idx) {
533
+ const value = wasm.__wbindgen_externrefs.get(idx);
534
+ wasm.__externref_table_dealloc(idx);
535
+ return value;
536
+ }
537
+
538
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
539
+ cachedTextDecoder.decode();
540
+ function decodeText(ptr, len) {
541
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
542
+ }
543
+
544
+ const cachedTextEncoder = new TextEncoder();
545
+
546
+ if (!('encodeInto' in cachedTextEncoder)) {
547
+ cachedTextEncoder.encodeInto = function (arg, view) {
548
+ const buf = cachedTextEncoder.encode(arg);
549
+ view.set(buf);
550
+ return {
551
+ read: arg.length,
552
+ written: buf.length
553
+ };
554
+ };
555
+ }
556
+
557
+ let WASM_VECTOR_LEN = 0;
552
558
 
553
559
  const wasmPath = `${__dirname}/e3_wasm_bg.wasm`;
554
560
  const wasmBytes = require('fs').readFileSync(wasmPath);
555
561
  const wasmModule = new WebAssembly.Module(wasmBytes);
556
- const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
557
-
562
+ const wasm = new WebAssembly.Instance(wasmModule, __wbg_get_imports()).exports;
558
563
  wasm.__wbindgen_start();
559
-