@aztec/noir-acvm_js 0.0.0-test.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.
@@ -0,0 +1,900 @@
1
+
2
+ let imports = {};
3
+ imports['__wbindgen_placeholder__'] = module.exports;
4
+ let wasm;
5
+ const { TextDecoder, TextEncoder } = require(`util`);
6
+
7
+ function addToExternrefTable0(obj) {
8
+ const idx = wasm.__externref_table_alloc();
9
+ wasm.__wbindgen_export_2.set(idx, obj);
10
+ return idx;
11
+ }
12
+
13
+ function handleError(f, args) {
14
+ try {
15
+ return f.apply(this, args);
16
+ } catch (e) {
17
+ const idx = addToExternrefTable0(e);
18
+ wasm.__wbindgen_exn_store(idx);
19
+ }
20
+ }
21
+
22
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
23
+
24
+ cachedTextDecoder.decode();
25
+
26
+ let cachedUint8ArrayMemory0 = null;
27
+
28
+ function getUint8ArrayMemory0() {
29
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
30
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
31
+ }
32
+ return cachedUint8ArrayMemory0;
33
+ }
34
+
35
+ function getStringFromWasm0(ptr, len) {
36
+ ptr = ptr >>> 0;
37
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
38
+ }
39
+
40
+ let WASM_VECTOR_LEN = 0;
41
+
42
+ let cachedTextEncoder = new TextEncoder('utf-8');
43
+
44
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
45
+ ? function (arg, view) {
46
+ return cachedTextEncoder.encodeInto(arg, view);
47
+ }
48
+ : function (arg, view) {
49
+ const buf = cachedTextEncoder.encode(arg);
50
+ view.set(buf);
51
+ return {
52
+ read: arg.length,
53
+ written: buf.length
54
+ };
55
+ });
56
+
57
+ function passStringToWasm0(arg, malloc, realloc) {
58
+
59
+ if (realloc === undefined) {
60
+ const buf = cachedTextEncoder.encode(arg);
61
+ const ptr = malloc(buf.length, 1) >>> 0;
62
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
63
+ WASM_VECTOR_LEN = buf.length;
64
+ return ptr;
65
+ }
66
+
67
+ let len = arg.length;
68
+ let ptr = malloc(len, 1) >>> 0;
69
+
70
+ const mem = getUint8ArrayMemory0();
71
+
72
+ let offset = 0;
73
+
74
+ for (; offset < len; offset++) {
75
+ const code = arg.charCodeAt(offset);
76
+ if (code > 0x7F) break;
77
+ mem[ptr + offset] = code;
78
+ }
79
+
80
+ if (offset !== len) {
81
+ if (offset !== 0) {
82
+ arg = arg.slice(offset);
83
+ }
84
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
85
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
86
+ const ret = encodeString(arg, view);
87
+
88
+ offset += ret.written;
89
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
90
+ }
91
+
92
+ WASM_VECTOR_LEN = offset;
93
+ return ptr;
94
+ }
95
+
96
+ let cachedDataViewMemory0 = null;
97
+
98
+ function getDataViewMemory0() {
99
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
100
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
101
+ }
102
+ return cachedDataViewMemory0;
103
+ }
104
+
105
+ function isLikeNone(x) {
106
+ return x === undefined || x === null;
107
+ }
108
+
109
+ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
110
+ ? { register: () => {}, unregister: () => {} }
111
+ : new FinalizationRegistry(state => {
112
+ wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
113
+ });
114
+
115
+ function makeMutClosure(arg0, arg1, dtor, f) {
116
+ const state = { a: arg0, b: arg1, cnt: 1, dtor };
117
+ const real = (...args) => {
118
+ // First up with a closure we increment the internal reference
119
+ // count. This ensures that the Rust closure environment won't
120
+ // be deallocated while we're invoking it.
121
+ state.cnt++;
122
+ const a = state.a;
123
+ state.a = 0;
124
+ try {
125
+ return f(a, state.b, ...args);
126
+ } finally {
127
+ if (--state.cnt === 0) {
128
+ wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
129
+ CLOSURE_DTORS.unregister(state);
130
+ } else {
131
+ state.a = a;
132
+ }
133
+ }
134
+ };
135
+ real.original = state;
136
+ CLOSURE_DTORS.register(real, state, state);
137
+ return real;
138
+ }
139
+
140
+ function debugString(val) {
141
+ // primitive types
142
+ const type = typeof val;
143
+ if (type == 'number' || type == 'boolean' || val == null) {
144
+ return `${val}`;
145
+ }
146
+ if (type == 'string') {
147
+ return `"${val}"`;
148
+ }
149
+ if (type == 'symbol') {
150
+ const description = val.description;
151
+ if (description == null) {
152
+ return 'Symbol';
153
+ } else {
154
+ return `Symbol(${description})`;
155
+ }
156
+ }
157
+ if (type == 'function') {
158
+ const name = val.name;
159
+ if (typeof name == 'string' && name.length > 0) {
160
+ return `Function(${name})`;
161
+ } else {
162
+ return 'Function';
163
+ }
164
+ }
165
+ // objects
166
+ if (Array.isArray(val)) {
167
+ const length = val.length;
168
+ let debug = '[';
169
+ if (length > 0) {
170
+ debug += debugString(val[0]);
171
+ }
172
+ for(let i = 1; i < length; i++) {
173
+ debug += ', ' + debugString(val[i]);
174
+ }
175
+ debug += ']';
176
+ return debug;
177
+ }
178
+ // Test for built-in
179
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
180
+ let className;
181
+ if (builtInMatches && builtInMatches.length > 1) {
182
+ className = builtInMatches[1];
183
+ } else {
184
+ // Failed to match the standard '[object ClassName]'
185
+ return toString.call(val);
186
+ }
187
+ if (className == 'Object') {
188
+ // we're a user defined class or Object
189
+ // JSON.stringify avoids problems with cycles, and is generally much
190
+ // easier than looping through ownProperties of `val`.
191
+ try {
192
+ return 'Object(' + JSON.stringify(val) + ')';
193
+ } catch (_) {
194
+ return 'Object';
195
+ }
196
+ }
197
+ // errors
198
+ if (val instanceof Error) {
199
+ return `${val.name}: ${val.message}\n${val.stack}`;
200
+ }
201
+ // TODO we could test for more things here, like `Set`s and `Map`s.
202
+ return className;
203
+ }
204
+
205
+ function passArray8ToWasm0(arg, malloc) {
206
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
207
+ getUint8ArrayMemory0().set(arg, ptr / 1);
208
+ WASM_VECTOR_LEN = arg.length;
209
+ return ptr;
210
+ }
211
+ /**
212
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
213
+ *
214
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
215
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
216
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
217
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
218
+ */
219
+ module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
220
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
221
+ const len0 = WASM_VECTOR_LEN;
222
+ const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
223
+ return ret;
224
+ };
225
+
226
+ /**
227
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
228
+ * This method also extracts the public return values from the solved witness into its own return witness.
229
+ *
230
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
231
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
232
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
233
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
234
+ */
235
+ module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
236
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
237
+ const len0 = WASM_VECTOR_LEN;
238
+ const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
239
+ return ret;
240
+ };
241
+
242
+ /**
243
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
244
+ *
245
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
246
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
247
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
248
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
249
+ */
250
+ module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
251
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
252
+ const len0 = WASM_VECTOR_LEN;
253
+ const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
254
+ return ret;
255
+ };
256
+
257
+ function takeFromExternrefTable0(idx) {
258
+ const value = wasm.__wbindgen_export_2.get(idx);
259
+ wasm.__externref_table_dealloc(idx);
260
+ return value;
261
+ }
262
+
263
+ function getArrayU8FromWasm0(ptr, len) {
264
+ ptr = ptr >>> 0;
265
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
266
+ }
267
+ /**
268
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
269
+ *
270
+ * @param {WitnessMap} witness_map - A witness map.
271
+ * @returns {Uint8Array} A compressed witness map
272
+ */
273
+ module.exports.compressWitness = function(witness_map) {
274
+ const ret = wasm.compressWitness(witness_map);
275
+ if (ret[3]) {
276
+ throw takeFromExternrefTable0(ret[2]);
277
+ }
278
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
279
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
280
+ return v1;
281
+ };
282
+
283
+ /**
284
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
285
+ * This should be used to only fetch the witness map for the main function.
286
+ *
287
+ * @param {Uint8Array} compressed_witness - A compressed witness.
288
+ * @returns {WitnessMap} The decompressed witness map.
289
+ */
290
+ module.exports.decompressWitness = function(compressed_witness) {
291
+ const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
292
+ const len0 = WASM_VECTOR_LEN;
293
+ const ret = wasm.decompressWitness(ptr0, len0);
294
+ if (ret[2]) {
295
+ throw takeFromExternrefTable0(ret[1]);
296
+ }
297
+ return takeFromExternrefTable0(ret[0]);
298
+ };
299
+
300
+ /**
301
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
302
+ *
303
+ * @param {WitnessStack} witness_stack - A witness stack.
304
+ * @returns {Uint8Array} A compressed witness stack
305
+ */
306
+ module.exports.compressWitnessStack = function(witness_stack) {
307
+ const ret = wasm.compressWitnessStack(witness_stack);
308
+ if (ret[3]) {
309
+ throw takeFromExternrefTable0(ret[2]);
310
+ }
311
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
312
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
313
+ return v1;
314
+ };
315
+
316
+ /**
317
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
318
+ *
319
+ * @param {Uint8Array} compressed_witness - A compressed witness.
320
+ * @returns {WitnessStack} The decompressed witness stack.
321
+ */
322
+ module.exports.decompressWitnessStack = function(compressed_witness) {
323
+ const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
324
+ const len0 = WASM_VECTOR_LEN;
325
+ const ret = wasm.decompressWitnessStack(ptr0, len0);
326
+ if (ret[2]) {
327
+ throw takeFromExternrefTable0(ret[1]);
328
+ }
329
+ return takeFromExternrefTable0(ret[0]);
330
+ };
331
+
332
+ /**
333
+ * Sets the package's logging level.
334
+ *
335
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
336
+ */
337
+ module.exports.initLogLevel = function(filter) {
338
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
339
+ const len0 = WASM_VECTOR_LEN;
340
+ const ret = wasm.initLogLevel(ptr0, len0);
341
+ if (ret[1]) {
342
+ throw takeFromExternrefTable0(ret[0]);
343
+ }
344
+ };
345
+
346
+ /**
347
+ * Performs a bitwise AND operation between `lhs` and `rhs`
348
+ * @param {string} lhs
349
+ * @param {string} rhs
350
+ * @returns {string}
351
+ */
352
+ module.exports.and = function(lhs, rhs) {
353
+ const ret = wasm.and(lhs, rhs);
354
+ return ret;
355
+ };
356
+
357
+ /**
358
+ * Performs a bitwise XOR operation between `lhs` and `rhs`
359
+ * @param {string} lhs
360
+ * @param {string} rhs
361
+ * @returns {string}
362
+ */
363
+ module.exports.xor = function(lhs, rhs) {
364
+ const ret = wasm.xor(lhs, rhs);
365
+ return ret;
366
+ };
367
+
368
+ let cachedUint32ArrayMemory0 = null;
369
+
370
+ function getUint32ArrayMemory0() {
371
+ if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
372
+ cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
373
+ }
374
+ return cachedUint32ArrayMemory0;
375
+ }
376
+
377
+ function passArray32ToWasm0(arg, malloc) {
378
+ const ptr = malloc(arg.length * 4, 4) >>> 0;
379
+ getUint32ArrayMemory0().set(arg, ptr / 4);
380
+ WASM_VECTOR_LEN = arg.length;
381
+ return ptr;
382
+ }
383
+
384
+ function getArrayU32FromWasm0(ptr, len) {
385
+ ptr = ptr >>> 0;
386
+ return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
387
+ }
388
+ /**
389
+ * Sha256 compression function
390
+ * @param {Uint32Array} inputs
391
+ * @param {Uint32Array} state
392
+ * @returns {Uint32Array}
393
+ */
394
+ module.exports.sha256_compression = function(inputs, state) {
395
+ const ptr0 = passArray32ToWasm0(inputs, wasm.__wbindgen_malloc);
396
+ const len0 = WASM_VECTOR_LEN;
397
+ const ptr1 = passArray32ToWasm0(state, wasm.__wbindgen_malloc);
398
+ const len1 = WASM_VECTOR_LEN;
399
+ const ret = wasm.sha256_compression(ptr0, len0, ptr1, len1);
400
+ var v3 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
401
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
402
+ return v3;
403
+ };
404
+
405
+ /**
406
+ * Calculates the Blake2s256 hash of the input bytes
407
+ * @param {Uint8Array} inputs
408
+ * @returns {Uint8Array}
409
+ */
410
+ module.exports.blake2s256 = function(inputs) {
411
+ const ptr0 = passArray8ToWasm0(inputs, wasm.__wbindgen_malloc);
412
+ const len0 = WASM_VECTOR_LEN;
413
+ const ret = wasm.blake2s256(ptr0, len0);
414
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
415
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
416
+ return v2;
417
+ };
418
+
419
+ /**
420
+ * Verifies a ECDSA signature over the secp256k1 curve.
421
+ * @param {Uint8Array} hashed_msg
422
+ * @param {Uint8Array} public_key_x_bytes
423
+ * @param {Uint8Array} public_key_y_bytes
424
+ * @param {Uint8Array} signature
425
+ * @returns {boolean}
426
+ */
427
+ module.exports.ecdsa_secp256k1_verify = function(hashed_msg, public_key_x_bytes, public_key_y_bytes, signature) {
428
+ const ptr0 = passArray8ToWasm0(hashed_msg, wasm.__wbindgen_malloc);
429
+ const len0 = WASM_VECTOR_LEN;
430
+ const ptr1 = passArray8ToWasm0(public_key_x_bytes, wasm.__wbindgen_malloc);
431
+ const len1 = WASM_VECTOR_LEN;
432
+ const ptr2 = passArray8ToWasm0(public_key_y_bytes, wasm.__wbindgen_malloc);
433
+ const len2 = WASM_VECTOR_LEN;
434
+ const ptr3 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
435
+ const len3 = WASM_VECTOR_LEN;
436
+ const ret = wasm.ecdsa_secp256k1_verify(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
437
+ return ret !== 0;
438
+ };
439
+
440
+ /**
441
+ * Verifies a ECDSA signature over the secp256r1 curve.
442
+ * @param {Uint8Array} hashed_msg
443
+ * @param {Uint8Array} public_key_x_bytes
444
+ * @param {Uint8Array} public_key_y_bytes
445
+ * @param {Uint8Array} signature
446
+ * @returns {boolean}
447
+ */
448
+ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes, public_key_y_bytes, signature) {
449
+ const ptr0 = passArray8ToWasm0(hashed_msg, wasm.__wbindgen_malloc);
450
+ const len0 = WASM_VECTOR_LEN;
451
+ const ptr1 = passArray8ToWasm0(public_key_x_bytes, wasm.__wbindgen_malloc);
452
+ const len1 = WASM_VECTOR_LEN;
453
+ const ptr2 = passArray8ToWasm0(public_key_y_bytes, wasm.__wbindgen_malloc);
454
+ const len2 = WASM_VECTOR_LEN;
455
+ const ptr3 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
456
+ const len3 = WASM_VECTOR_LEN;
457
+ const ret = wasm.ecdsa_secp256r1_verify(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
458
+ return ret !== 0;
459
+ };
460
+
461
+ /**
462
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
463
+ * @returns {BuildInfo} - Information on how the installed package was built.
464
+ */
465
+ module.exports.buildInfo = function() {
466
+ const ret = wasm.buildInfo();
467
+ return ret;
468
+ };
469
+
470
+ /**
471
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
472
+ *
473
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
474
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
475
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
476
+ * @param {Uint8Array} program
477
+ * @param {WitnessMap} witness_map
478
+ * @returns {WitnessMap}
479
+ */
480
+ module.exports.getReturnWitness = function(program, witness_map) {
481
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
482
+ const len0 = WASM_VECTOR_LEN;
483
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
484
+ if (ret[2]) {
485
+ throw takeFromExternrefTable0(ret[1]);
486
+ }
487
+ return takeFromExternrefTable0(ret[0]);
488
+ };
489
+
490
+ /**
491
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
492
+ *
493
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
494
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
495
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
496
+ * @param {Uint8Array} program
497
+ * @param {WitnessMap} solved_witness
498
+ * @returns {WitnessMap}
499
+ */
500
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
501
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
502
+ const len0 = WASM_VECTOR_LEN;
503
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
504
+ if (ret[2]) {
505
+ throw takeFromExternrefTable0(ret[1]);
506
+ }
507
+ return takeFromExternrefTable0(ret[0]);
508
+ };
509
+
510
+ /**
511
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
512
+ *
513
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
514
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
515
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
516
+ * @param {Uint8Array} program
517
+ * @param {WitnessMap} solved_witness
518
+ * @returns {WitnessMap}
519
+ */
520
+ module.exports.getPublicWitness = function(program, solved_witness) {
521
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
522
+ const len0 = WASM_VECTOR_LEN;
523
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
524
+ if (ret[2]) {
525
+ throw takeFromExternrefTable0(ret[1]);
526
+ }
527
+ return takeFromExternrefTable0(ret[0]);
528
+ };
529
+
530
+ function __wbg_adapter_30(arg0, arg1, arg2) {
531
+ wasm.closure265_externref_shim(arg0, arg1, arg2);
532
+ }
533
+
534
+ function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
535
+ wasm.closure826_externref_shim(arg0, arg1, arg2, arg3, arg4);
536
+ }
537
+
538
+ function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
539
+ wasm.closure830_externref_shim(arg0, arg1, arg2, arg3);
540
+ }
541
+
542
+ module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
543
+ const ret = arg0.call(arg1);
544
+ return ret;
545
+ }, arguments) };
546
+
547
+ module.exports.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
548
+ const ret = arg0.call(arg1, arg2);
549
+ return ret;
550
+ }, arguments) };
551
+
552
+ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(function (arg0, arg1, arg2, arg3) {
553
+ const ret = arg0.call(arg1, arg2, arg3);
554
+ return ret;
555
+ }, arguments) };
556
+
557
+ module.exports.__wbg_constructor_003f4a4118e07291 = function(arg0) {
558
+ const ret = new Error(arg0);
559
+ return ret;
560
+ };
561
+
562
+ module.exports.__wbg_constructor_c456dcccc52847dd = function(arg0) {
563
+ const ret = new Error(arg0);
564
+ return ret;
565
+ };
566
+
567
+ module.exports.__wbg_debug_3cb59063b29f58c1 = function(arg0) {
568
+ console.debug(arg0);
569
+ };
570
+
571
+ module.exports.__wbg_debug_e17b51583ca6a632 = function(arg0, arg1, arg2, arg3) {
572
+ console.debug(arg0, arg1, arg2, arg3);
573
+ };
574
+
575
+ module.exports.__wbg_error_524f506f44df1645 = function(arg0) {
576
+ console.error(arg0);
577
+ };
578
+
579
+ module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
580
+ let deferred0_0;
581
+ let deferred0_1;
582
+ try {
583
+ deferred0_0 = arg0;
584
+ deferred0_1 = arg1;
585
+ console.error(getStringFromWasm0(arg0, arg1));
586
+ } finally {
587
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
588
+ }
589
+ };
590
+
591
+ module.exports.__wbg_error_80de38b3f7cc3c3c = function(arg0, arg1, arg2, arg3) {
592
+ console.error(arg0, arg1, arg2, arg3);
593
+ };
594
+
595
+ module.exports.__wbg_forEach_d6a05ca96422eff9 = function(arg0, arg1, arg2) {
596
+ try {
597
+ var state0 = {a: arg1, b: arg2};
598
+ var cb0 = (arg0, arg1, arg2) => {
599
+ const a = state0.a;
600
+ state0.a = 0;
601
+ try {
602
+ return __wbg_adapter_89(a, state0.b, arg0, arg1, arg2);
603
+ } finally {
604
+ state0.a = a;
605
+ }
606
+ };
607
+ arg0.forEach(cb0);
608
+ } finally {
609
+ state0.a = state0.b = 0;
610
+ }
611
+ };
612
+
613
+ module.exports.__wbg_forEach_e1cf6f7c8ecb7dae = function(arg0, arg1, arg2) {
614
+ try {
615
+ var state0 = {a: arg1, b: arg2};
616
+ var cb0 = (arg0, arg1) => {
617
+ const a = state0.a;
618
+ state0.a = 0;
619
+ try {
620
+ return __wbg_adapter_110(a, state0.b, arg0, arg1);
621
+ } finally {
622
+ state0.a = a;
623
+ }
624
+ };
625
+ arg0.forEach(cb0);
626
+ } finally {
627
+ state0.a = state0.b = 0;
628
+ }
629
+ };
630
+
631
+ module.exports.__wbg_fromEntries_524679eecb0bdc2e = function() { return handleError(function (arg0) {
632
+ const ret = Object.fromEntries(arg0);
633
+ return ret;
634
+ }, arguments) };
635
+
636
+ module.exports.__wbg_from_2a5d3e218e67aa85 = function(arg0) {
637
+ const ret = Array.from(arg0);
638
+ return ret;
639
+ };
640
+
641
+ module.exports.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
642
+ const ret = arg0[arg1 >>> 0];
643
+ return ret;
644
+ };
645
+
646
+ module.exports.__wbg_info_033d8b8a0838f1d3 = function(arg0, arg1, arg2, arg3) {
647
+ console.info(arg0, arg1, arg2, arg3);
648
+ };
649
+
650
+ module.exports.__wbg_info_3daf2e093e091b66 = function(arg0) {
651
+ console.info(arg0);
652
+ };
653
+
654
+ module.exports.__wbg_length_e2d2a49132c1b256 = function(arg0) {
655
+ const ret = arg0.length;
656
+ return ret;
657
+ };
658
+
659
+ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
660
+ try {
661
+ var state0 = {a: arg0, b: arg1};
662
+ var cb0 = (arg0, arg1) => {
663
+ const a = state0.a;
664
+ state0.a = 0;
665
+ try {
666
+ return __wbg_adapter_110(a, state0.b, arg0, arg1);
667
+ } finally {
668
+ state0.a = a;
669
+ }
670
+ };
671
+ const ret = new Promise(cb0);
672
+ return ret;
673
+ } finally {
674
+ state0.a = state0.b = 0;
675
+ }
676
+ };
677
+
678
+ module.exports.__wbg_new_3f4c5c451d69e970 = function() {
679
+ const ret = new Map();
680
+ return ret;
681
+ };
682
+
683
+ module.exports.__wbg_new_5e0be73521bc8c17 = function() {
684
+ const ret = new Map();
685
+ return ret;
686
+ };
687
+
688
+ module.exports.__wbg_new_78feb108b6472713 = function() {
689
+ const ret = new Array();
690
+ return ret;
691
+ };
692
+
693
+ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
694
+ const ret = new Error();
695
+ return ret;
696
+ };
697
+
698
+ module.exports.__wbg_new_a324c5957dd8b845 = function() {
699
+ const ret = new Array();
700
+ return ret;
701
+ };
702
+
703
+ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
704
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
705
+ return ret;
706
+ };
707
+
708
+ module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
709
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
710
+ return ret;
711
+ };
712
+
713
+ module.exports.__wbg_parse_def2e24ef1252aff = function() { return handleError(function (arg0, arg1) {
714
+ const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
715
+ return ret;
716
+ }, arguments) };
717
+
718
+ module.exports.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
719
+ const ret = arg0.push(arg1);
720
+ return ret;
721
+ };
722
+
723
+ module.exports.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
724
+ queueMicrotask(arg0);
725
+ };
726
+
727
+ module.exports.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
728
+ const ret = arg0.queueMicrotask;
729
+ return ret;
730
+ };
731
+
732
+ module.exports.__wbg_resolve_4851785c9c5f573d = function(arg0) {
733
+ const ret = Promise.resolve(arg0);
734
+ return ret;
735
+ };
736
+
737
+ module.exports.__wbg_reverse_71c11f9686a5c11b = function(arg0) {
738
+ const ret = arg0.reverse();
739
+ return ret;
740
+ };
741
+
742
+ module.exports.__wbg_set_8fc6bf8a5b1071d1 = function(arg0, arg1, arg2) {
743
+ const ret = arg0.set(arg1, arg2);
744
+ return ret;
745
+ };
746
+
747
+ module.exports.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
748
+ const ret = Reflect.set(arg0, arg1, arg2);
749
+ return ret;
750
+ }, arguments) };
751
+
752
+ module.exports.__wbg_setcause_180f5110152d3ce3 = function(arg0, arg1) {
753
+ arg0.cause = arg1;
754
+ };
755
+
756
+ module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
757
+ const ret = arg1.stack;
758
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
759
+ const len1 = WASM_VECTOR_LEN;
760
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
761
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
762
+ };
763
+
764
+ module.exports.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
765
+ const ret = typeof global === 'undefined' ? null : global;
766
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
767
+ };
768
+
769
+ module.exports.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
770
+ const ret = typeof globalThis === 'undefined' ? null : globalThis;
771
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
772
+ };
773
+
774
+ module.exports.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
775
+ const ret = typeof self === 'undefined' ? null : self;
776
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
777
+ };
778
+
779
+ module.exports.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
780
+ const ret = typeof window === 'undefined' ? null : window;
781
+ return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
782
+ };
783
+
784
+ module.exports.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
785
+ const ret = arg0.then(arg1);
786
+ return ret;
787
+ };
788
+
789
+ module.exports.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
790
+ const ret = arg0.then(arg1, arg2);
791
+ return ret;
792
+ };
793
+
794
+ module.exports.__wbg_values_fcb8ba8c0aad8b58 = function(arg0) {
795
+ const ret = Object.values(arg0);
796
+ return ret;
797
+ };
798
+
799
+ module.exports.__wbg_warn_4ca3906c248c47c4 = function(arg0) {
800
+ console.warn(arg0);
801
+ };
802
+
803
+ module.exports.__wbg_warn_aaf1f4664a035bd6 = function(arg0, arg1, arg2, arg3) {
804
+ console.warn(arg0, arg1, arg2, arg3);
805
+ };
806
+
807
+ module.exports.__wbindgen_cb_drop = function(arg0) {
808
+ const obj = arg0.original;
809
+ if (obj.cnt-- == 1) {
810
+ obj.a = 0;
811
+ return true;
812
+ }
813
+ const ret = false;
814
+ return ret;
815
+ };
816
+
817
+ module.exports.__wbindgen_closure_wrapper740 = function(arg0, arg1, arg2) {
818
+ const ret = makeMutClosure(arg0, arg1, 266, __wbg_adapter_30);
819
+ return ret;
820
+ };
821
+
822
+ module.exports.__wbindgen_debug_string = function(arg0, arg1) {
823
+ const ret = debugString(arg1);
824
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
825
+ const len1 = WASM_VECTOR_LEN;
826
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
827
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
828
+ };
829
+
830
+ module.exports.__wbindgen_init_externref_table = function() {
831
+ const table = wasm.__wbindgen_export_2;
832
+ const offset = table.grow(4);
833
+ table.set(0, undefined);
834
+ table.set(offset + 0, undefined);
835
+ table.set(offset + 1, null);
836
+ table.set(offset + 2, true);
837
+ table.set(offset + 3, false);
838
+ ;
839
+ };
840
+
841
+ module.exports.__wbindgen_is_array = function(arg0) {
842
+ const ret = Array.isArray(arg0);
843
+ return ret;
844
+ };
845
+
846
+ module.exports.__wbindgen_is_function = function(arg0) {
847
+ const ret = typeof(arg0) === 'function';
848
+ return ret;
849
+ };
850
+
851
+ module.exports.__wbindgen_is_string = function(arg0) {
852
+ const ret = typeof(arg0) === 'string';
853
+ return ret;
854
+ };
855
+
856
+ module.exports.__wbindgen_is_undefined = function(arg0) {
857
+ const ret = arg0 === undefined;
858
+ return ret;
859
+ };
860
+
861
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
862
+ const obj = arg1;
863
+ const ret = typeof(obj) === 'number' ? obj : undefined;
864
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
865
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
866
+ };
867
+
868
+ module.exports.__wbindgen_number_new = function(arg0) {
869
+ const ret = arg0;
870
+ return ret;
871
+ };
872
+
873
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
874
+ const obj = arg1;
875
+ const ret = typeof(obj) === 'string' ? obj : undefined;
876
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
877
+ var len1 = WASM_VECTOR_LEN;
878
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
879
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
880
+ };
881
+
882
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
883
+ const ret = getStringFromWasm0(arg0, arg1);
884
+ return ret;
885
+ };
886
+
887
+ module.exports.__wbindgen_throw = function(arg0, arg1) {
888
+ throw new Error(getStringFromWasm0(arg0, arg1));
889
+ };
890
+
891
+ const path = require('path').join(__dirname, 'acvm_js_bg.wasm');
892
+ const bytes = require('fs').readFileSync(path);
893
+
894
+ const wasmModule = new WebAssembly.Module(bytes);
895
+ const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
896
+ wasm = wasmInstance.exports;
897
+ module.exports.__wasm = wasm;
898
+
899
+ wasm.__wbindgen_start();
900
+