@noir-lang/acvm_js 0.49.0-712468a.nightly → 0.49.0-9bf2dcb.nightly

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,44 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Returns the `BuildInfo` object containing information about how the installed package was built.
5
- * @returns {BuildInfo} - Information on how the installed package was built.
6
- */
7
- export function buildInfo(): BuildInfo;
8
- /**
9
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
10
- *
11
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
12
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
13
- * @returns {WitnessMap} A witness map containing the circuit's return values.
14
- * @param {Uint8Array} program
15
- * @param {WitnessMap} witness_map
16
- * @returns {WitnessMap}
17
- */
18
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
19
- /**
20
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
21
- *
22
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
23
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
24
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
25
- * @param {Uint8Array} program
26
- * @param {WitnessMap} solved_witness
27
- * @returns {WitnessMap}
28
- */
29
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
30
- /**
31
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
32
- *
33
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
34
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
35
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
36
- * @param {Uint8Array} program
37
- * @param {WitnessMap} solved_witness
38
- * @returns {WitnessMap}
39
- */
40
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
41
- /**
42
4
  * Performs a bitwise AND operation between `lhs` and `rhs`
43
5
  * @param {string} lhs
44
6
  * @param {string} rhs
@@ -118,12 +80,6 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
118
80
  */
119
81
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
120
82
  /**
121
- * Sets the package's logging level.
122
- *
123
- * @param {LogLevel} level - The maximum level of logging to be emitted.
124
- */
125
- export function initLogLevel(filter: string): void;
126
- /**
127
83
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
128
84
  *
129
85
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
@@ -151,6 +107,64 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
151
107
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
152
108
  */
153
109
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
110
+ /**
111
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
112
+ * @returns {BuildInfo} - Information on how the installed package was built.
113
+ */
114
+ export function buildInfo(): BuildInfo;
115
+ /**
116
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
117
+ *
118
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
119
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
120
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
121
+ * @param {Uint8Array} program
122
+ * @param {WitnessMap} witness_map
123
+ * @returns {WitnessMap}
124
+ */
125
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
126
+ /**
127
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
128
+ *
129
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
130
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
131
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
132
+ * @param {Uint8Array} program
133
+ * @param {WitnessMap} solved_witness
134
+ * @returns {WitnessMap}
135
+ */
136
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
137
+ /**
138
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
139
+ *
140
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
141
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
142
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
143
+ * @param {Uint8Array} program
144
+ * @param {WitnessMap} solved_witness
145
+ * @returns {WitnessMap}
146
+ */
147
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
148
+ /**
149
+ * Sets the package's logging level.
150
+ *
151
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
152
+ */
153
+ export function initLogLevel(filter: string): void;
154
+
155
+ export type ForeignCallInput = string[]
156
+ export type ForeignCallOutput = string | string[]
157
+
158
+ /**
159
+ * A callback which performs an foreign call and returns the response.
160
+ * @callback ForeignCallHandler
161
+ * @param {string} name - The identifier for the type of foreign call being performed.
162
+ * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
163
+ * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
164
+ */
165
+ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
166
+
167
+
154
168
 
155
169
  /**
156
170
  * @typedef {Object} BuildInfo - Information about how the installed package was built
@@ -202,17 +216,3 @@ export type SolvedAndReturnWitness = {
202
216
  }
203
217
 
204
218
 
205
-
206
- export type ForeignCallInput = string[]
207
- export type ForeignCallOutput = string | string[]
208
-
209
- /**
210
- * A callback which performs an foreign call and returns the response.
211
- * @callback ForeignCallHandler
212
- * @param {string} name - The identifier for the type of foreign call being performed.
213
- * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
214
- * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
215
- */
216
- export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
217
-
218
-
package/nodejs/acvm_js.js CHANGED
@@ -9,6 +9,28 @@ heap.push(undefined, null, true, false);
9
9
 
10
10
  function getObject(idx) { return heap[idx]; }
11
11
 
12
+ function isLikeNone(x) {
13
+ return x === undefined || x === null;
14
+ }
15
+
16
+ let cachedFloat64Memory0 = null;
17
+
18
+ function getFloat64Memory0() {
19
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
20
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
21
+ }
22
+ return cachedFloat64Memory0;
23
+ }
24
+
25
+ let cachedInt32Memory0 = null;
26
+
27
+ function getInt32Memory0() {
28
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
29
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
30
+ }
31
+ return cachedInt32Memory0;
32
+ }
33
+
12
34
  let heap_next = heap.length;
13
35
 
14
36
  function dropObject(idx) {
@@ -50,28 +72,6 @@ function addHeapObject(obj) {
50
72
  return idx;
51
73
  }
52
74
 
53
- function isLikeNone(x) {
54
- return x === undefined || x === null;
55
- }
56
-
57
- let cachedFloat64Memory0 = null;
58
-
59
- function getFloat64Memory0() {
60
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
61
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
62
- }
63
- return cachedFloat64Memory0;
64
- }
65
-
66
- let cachedInt32Memory0 = null;
67
-
68
- function getInt32Memory0() {
69
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
70
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
71
- }
72
- return cachedInt32Memory0;
73
- }
74
-
75
75
  let WASM_VECTOR_LEN = 0;
76
76
 
77
77
  let cachedTextEncoder = new TextEncoder('utf-8');
@@ -217,107 +217,8 @@ function makeMutClosure(arg0, arg1, dtor, f) {
217
217
  return real;
218
218
  }
219
219
  function __wbg_adapter_22(arg0, arg1, arg2) {
220
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(arg0, arg1, addHeapObject(arg2));
221
- }
222
-
223
- /**
224
- * Returns the `BuildInfo` object containing information about how the installed package was built.
225
- * @returns {BuildInfo} - Information on how the installed package was built.
226
- */
227
- module.exports.buildInfo = function() {
228
- const ret = wasm.buildInfo();
229
- return takeObject(ret);
230
- };
231
-
232
- function passArray8ToWasm0(arg, malloc) {
233
- const ptr = malloc(arg.length * 1) >>> 0;
234
- getUint8Memory0().set(arg, ptr / 1);
235
- WASM_VECTOR_LEN = arg.length;
236
- return ptr;
220
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(arg0, arg1, addHeapObject(arg2));
237
221
  }
238
- /**
239
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
240
- *
241
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
242
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
243
- * @returns {WitnessMap} A witness map containing the circuit's return values.
244
- * @param {Uint8Array} program
245
- * @param {WitnessMap} witness_map
246
- * @returns {WitnessMap}
247
- */
248
- module.exports.getReturnWitness = function(program, witness_map) {
249
- try {
250
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
251
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
252
- const len0 = WASM_VECTOR_LEN;
253
- wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
254
- var r0 = getInt32Memory0()[retptr / 4 + 0];
255
- var r1 = getInt32Memory0()[retptr / 4 + 1];
256
- var r2 = getInt32Memory0()[retptr / 4 + 2];
257
- if (r2) {
258
- throw takeObject(r1);
259
- }
260
- return takeObject(r0);
261
- } finally {
262
- wasm.__wbindgen_add_to_stack_pointer(16);
263
- }
264
- };
265
-
266
- /**
267
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
268
- *
269
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
270
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
271
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
272
- * @param {Uint8Array} program
273
- * @param {WitnessMap} solved_witness
274
- * @returns {WitnessMap}
275
- */
276
- module.exports.getPublicParametersWitness = function(program, solved_witness) {
277
- try {
278
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
279
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
280
- const len0 = WASM_VECTOR_LEN;
281
- wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
282
- var r0 = getInt32Memory0()[retptr / 4 + 0];
283
- var r1 = getInt32Memory0()[retptr / 4 + 1];
284
- var r2 = getInt32Memory0()[retptr / 4 + 2];
285
- if (r2) {
286
- throw takeObject(r1);
287
- }
288
- return takeObject(r0);
289
- } finally {
290
- wasm.__wbindgen_add_to_stack_pointer(16);
291
- }
292
- };
293
-
294
- /**
295
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
296
- *
297
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
298
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
299
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
300
- * @param {Uint8Array} program
301
- * @param {WitnessMap} solved_witness
302
- * @returns {WitnessMap}
303
- */
304
- module.exports.getPublicWitness = function(program, solved_witness) {
305
- try {
306
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
307
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
308
- const len0 = WASM_VECTOR_LEN;
309
- wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
310
- var r0 = getInt32Memory0()[retptr / 4 + 0];
311
- var r1 = getInt32Memory0()[retptr / 4 + 1];
312
- var r2 = getInt32Memory0()[retptr / 4 + 2];
313
- if (r2) {
314
- throw takeObject(r1);
315
- }
316
- return takeObject(r0);
317
- } finally {
318
- wasm.__wbindgen_add_to_stack_pointer(16);
319
- }
320
- };
321
222
 
322
223
  /**
323
224
  * Performs a bitwise AND operation between `lhs` and `rhs`
@@ -341,6 +242,13 @@ module.exports.xor = function(lhs, rhs) {
341
242
  return takeObject(ret);
342
243
  };
343
244
 
245
+ function passArray8ToWasm0(arg, malloc) {
246
+ const ptr = malloc(arg.length * 1) >>> 0;
247
+ getUint8Memory0().set(arg, ptr / 1);
248
+ WASM_VECTOR_LEN = arg.length;
249
+ return ptr;
250
+ }
251
+
344
252
  function getArrayU8FromWasm0(ptr, len) {
345
253
  ptr = ptr >>> 0;
346
254
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
@@ -549,27 +457,6 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
549
457
  }
550
458
  };
551
459
 
552
- /**
553
- * Sets the package's logging level.
554
- *
555
- * @param {LogLevel} level - The maximum level of logging to be emitted.
556
- */
557
- module.exports.initLogLevel = function(filter) {
558
- try {
559
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
560
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
561
- const len0 = WASM_VECTOR_LEN;
562
- wasm.initLogLevel(retptr, ptr0, len0);
563
- var r0 = getInt32Memory0()[retptr / 4 + 0];
564
- var r1 = getInt32Memory0()[retptr / 4 + 1];
565
- if (r1) {
566
- throw takeObject(r0);
567
- }
568
- } finally {
569
- wasm.__wbindgen_add_to_stack_pointer(16);
570
- }
571
- };
572
-
573
460
  /**
574
461
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
575
462
  *
@@ -616,8 +503,122 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
616
503
  return takeObject(ret);
617
504
  };
618
505
 
506
+ /**
507
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
508
+ * @returns {BuildInfo} - Information on how the installed package was built.
509
+ */
510
+ module.exports.buildInfo = function() {
511
+ const ret = wasm.buildInfo();
512
+ return takeObject(ret);
513
+ };
514
+
515
+ /**
516
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
517
+ *
518
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
519
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
520
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
521
+ * @param {Uint8Array} program
522
+ * @param {WitnessMap} witness_map
523
+ * @returns {WitnessMap}
524
+ */
525
+ module.exports.getReturnWitness = function(program, witness_map) {
526
+ try {
527
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
528
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
529
+ const len0 = WASM_VECTOR_LEN;
530
+ wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
531
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
532
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
533
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
534
+ if (r2) {
535
+ throw takeObject(r1);
536
+ }
537
+ return takeObject(r0);
538
+ } finally {
539
+ wasm.__wbindgen_add_to_stack_pointer(16);
540
+ }
541
+ };
542
+
543
+ /**
544
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
545
+ *
546
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
547
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
548
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
549
+ * @param {Uint8Array} program
550
+ * @param {WitnessMap} solved_witness
551
+ * @returns {WitnessMap}
552
+ */
553
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
554
+ try {
555
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
556
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
557
+ const len0 = WASM_VECTOR_LEN;
558
+ wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
559
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
560
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
561
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
562
+ if (r2) {
563
+ throw takeObject(r1);
564
+ }
565
+ return takeObject(r0);
566
+ } finally {
567
+ wasm.__wbindgen_add_to_stack_pointer(16);
568
+ }
569
+ };
570
+
571
+ /**
572
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
573
+ *
574
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
575
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
576
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
577
+ * @param {Uint8Array} program
578
+ * @param {WitnessMap} solved_witness
579
+ * @returns {WitnessMap}
580
+ */
581
+ module.exports.getPublicWitness = function(program, solved_witness) {
582
+ try {
583
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
584
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
585
+ const len0 = WASM_VECTOR_LEN;
586
+ wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
587
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
588
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
589
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
590
+ if (r2) {
591
+ throw takeObject(r1);
592
+ }
593
+ return takeObject(r0);
594
+ } finally {
595
+ wasm.__wbindgen_add_to_stack_pointer(16);
596
+ }
597
+ };
598
+
599
+ /**
600
+ * Sets the package's logging level.
601
+ *
602
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
603
+ */
604
+ module.exports.initLogLevel = function(filter) {
605
+ try {
606
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
607
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
608
+ const len0 = WASM_VECTOR_LEN;
609
+ wasm.initLogLevel(retptr, ptr0, len0);
610
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
611
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
612
+ if (r1) {
613
+ throw takeObject(r0);
614
+ }
615
+ } finally {
616
+ wasm.__wbindgen_add_to_stack_pointer(16);
617
+ }
618
+ };
619
+
619
620
  function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {
620
- wasm.wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
621
+ wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
621
622
  }
622
623
 
623
624
  function handleError(f, args) {
@@ -628,13 +629,30 @@ function handleError(f, args) {
628
629
  }
629
630
  }
630
631
  function __wbg_adapter_93(arg0, arg1, arg2, arg3) {
631
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
632
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
632
633
  }
633
634
 
635
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
636
+ const obj = getObject(arg1);
637
+ const ret = typeof(obj) === 'number' ? obj : undefined;
638
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
639
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
640
+ };
641
+
634
642
  module.exports.__wbindgen_object_drop_ref = function(arg0) {
635
643
  takeObject(arg0);
636
644
  };
637
645
 
646
+ module.exports.__wbindgen_is_array = function(arg0) {
647
+ const ret = Array.isArray(getObject(arg0));
648
+ return ret;
649
+ };
650
+
651
+ module.exports.__wbindgen_is_string = function(arg0) {
652
+ const ret = typeof(getObject(arg0)) === 'string';
653
+ return ret;
654
+ };
655
+
638
656
  module.exports.__wbindgen_cb_drop = function(arg0) {
639
657
  const obj = takeObject(arg0).original;
640
658
  if (obj.cnt-- == 1) {
@@ -665,13 +683,6 @@ module.exports.__wbindgen_number_new = function(arg0) {
665
683
  return addHeapObject(ret);
666
684
  };
667
685
 
668
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
669
- const obj = getObject(arg1);
670
- const ret = typeof(obj) === 'number' ? obj : undefined;
671
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
672
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
673
- };
674
-
675
686
  module.exports.__wbg_new_cd95aa9a75b6fbe6 = function() {
676
687
  const ret = new Map();
677
688
  return addHeapObject(ret);
@@ -686,16 +697,6 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
686
697
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
687
698
  };
688
699
 
689
- module.exports.__wbindgen_is_array = function(arg0) {
690
- const ret = Array.isArray(getObject(arg0));
691
- return ret;
692
- };
693
-
694
- module.exports.__wbindgen_is_string = function(arg0) {
695
- const ret = typeof(getObject(arg0)) === 'string';
696
- return ret;
697
- };
698
-
699
700
  module.exports.__wbg_new_abda76e883ba8a5f = function() {
700
701
  const ret = new Error();
701
702
  return addHeapObject(ret);
@@ -914,8 +915,8 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
914
915
  throw new Error(getStringFromWasm0(arg0, arg1));
915
916
  };
916
917
 
917
- module.exports.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
918
- const ret = makeMutClosure(arg0, arg1, 259, __wbg_adapter_22);
918
+ module.exports.__wbindgen_closure_wrapper748 = function(arg0, arg1, arg2) {
919
+ const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_22);
919
920
  return addHeapObject(ret);
920
921
  };
921
922
 
Binary file
@@ -1,10 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function buildInfo(): number;
5
- export function getReturnWitness(a: number, b: number, c: number, d: number): void;
6
- export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
7
- export function getPublicWitness(a: number, b: number, c: number, d: number): void;
8
4
  export function and(a: number, b: number): number;
9
5
  export function xor(a: number, b: number): number;
10
6
  export function sha256(a: number, b: number, c: number): void;
@@ -16,16 +12,20 @@ export function compressWitness(a: number, b: number): void;
16
12
  export function decompressWitness(a: number, b: number, c: number): void;
17
13
  export function compressWitnessStack(a: number, b: number): void;
18
14
  export function decompressWitnessStack(a: number, b: number, c: number): void;
19
- export function initLogLevel(a: number, b: number, c: number): void;
20
15
  export function executeCircuit(a: number, b: number, c: number, d: number): number;
21
16
  export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
22
17
  export function executeProgram(a: number, b: number, c: number, d: number): number;
18
+ export function buildInfo(): number;
19
+ export function getReturnWitness(a: number, b: number, c: number, d: number): void;
20
+ export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
21
+ export function getPublicWitness(a: number, b: number, c: number, d: number): void;
22
+ export function initLogLevel(a: number, b: number, c: number): void;
23
23
  export function __wbindgen_malloc(a: number): number;
24
24
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
25
25
  export const __wbindgen_export_2: WebAssembly.Table;
26
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(a: number, b: number, c: number): void;
26
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(a: number, b: number, c: number): void;
27
27
  export function __wbindgen_add_to_stack_pointer(a: number): number;
28
28
  export function __wbindgen_free(a: number, b: number): void;
29
- export function wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(a: number, b: number, c: number, d: number, e: number): void;
29
+ export function wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(a: number, b: number, c: number, d: number, e: number): void;
30
30
  export function __wbindgen_exn_store(a: number): void;
31
- export function wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587(a: number, b: number, c: number, d: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noir-lang/acvm_js",
3
- "version": "0.49.0-712468a.nightly",
3
+ "version": "0.49.0-9bf2dcb.nightly",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/web/acvm_js.d.ts CHANGED
@@ -1,44 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Returns the `BuildInfo` object containing information about how the installed package was built.
5
- * @returns {BuildInfo} - Information on how the installed package was built.
6
- */
7
- export function buildInfo(): BuildInfo;
8
- /**
9
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
10
- *
11
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
12
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
13
- * @returns {WitnessMap} A witness map containing the circuit's return values.
14
- * @param {Uint8Array} program
15
- * @param {WitnessMap} witness_map
16
- * @returns {WitnessMap}
17
- */
18
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
19
- /**
20
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
21
- *
22
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
23
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
24
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
25
- * @param {Uint8Array} program
26
- * @param {WitnessMap} solved_witness
27
- * @returns {WitnessMap}
28
- */
29
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
30
- /**
31
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
32
- *
33
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
34
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
35
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
36
- * @param {Uint8Array} program
37
- * @param {WitnessMap} solved_witness
38
- * @returns {WitnessMap}
39
- */
40
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
41
- /**
42
4
  * Performs a bitwise AND operation between `lhs` and `rhs`
43
5
  * @param {string} lhs
44
6
  * @param {string} rhs
@@ -118,12 +80,6 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
118
80
  */
119
81
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
120
82
  /**
121
- * Sets the package's logging level.
122
- *
123
- * @param {LogLevel} level - The maximum level of logging to be emitted.
124
- */
125
- export function initLogLevel(filter: string): void;
126
- /**
127
83
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
128
84
  *
129
85
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
@@ -151,6 +107,64 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
151
107
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
152
108
  */
153
109
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
110
+ /**
111
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
112
+ * @returns {BuildInfo} - Information on how the installed package was built.
113
+ */
114
+ export function buildInfo(): BuildInfo;
115
+ /**
116
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
117
+ *
118
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
119
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
120
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
121
+ * @param {Uint8Array} program
122
+ * @param {WitnessMap} witness_map
123
+ * @returns {WitnessMap}
124
+ */
125
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
126
+ /**
127
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
128
+ *
129
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
130
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
131
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
132
+ * @param {Uint8Array} program
133
+ * @param {WitnessMap} solved_witness
134
+ * @returns {WitnessMap}
135
+ */
136
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
137
+ /**
138
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
139
+ *
140
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
141
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
142
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
143
+ * @param {Uint8Array} program
144
+ * @param {WitnessMap} solved_witness
145
+ * @returns {WitnessMap}
146
+ */
147
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
148
+ /**
149
+ * Sets the package's logging level.
150
+ *
151
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
152
+ */
153
+ export function initLogLevel(filter: string): void;
154
+
155
+ export type ForeignCallInput = string[]
156
+ export type ForeignCallOutput = string | string[]
157
+
158
+ /**
159
+ * A callback which performs an foreign call and returns the response.
160
+ * @callback ForeignCallHandler
161
+ * @param {string} name - The identifier for the type of foreign call being performed.
162
+ * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
163
+ * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
164
+ */
165
+ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
166
+
167
+
154
168
 
155
169
  /**
156
170
  * @typedef {Object} BuildInfo - Information about how the installed package was built
@@ -203,28 +217,10 @@ export type SolvedAndReturnWitness = {
203
217
 
204
218
 
205
219
 
206
- export type ForeignCallInput = string[]
207
- export type ForeignCallOutput = string | string[]
208
-
209
- /**
210
- * A callback which performs an foreign call and returns the response.
211
- * @callback ForeignCallHandler
212
- * @param {string} name - The identifier for the type of foreign call being performed.
213
- * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
214
- * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
215
- */
216
- export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
217
-
218
-
219
-
220
220
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
221
221
 
222
222
  export interface InitOutput {
223
223
  readonly memory: WebAssembly.Memory;
224
- readonly buildInfo: () => number;
225
- readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
226
- readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
227
- readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
228
224
  readonly and: (a: number, b: number) => number;
229
225
  readonly xor: (a: number, b: number) => number;
230
226
  readonly sha256: (a: number, b: number, c: number) => void;
@@ -236,19 +232,23 @@ export interface InitOutput {
236
232
  readonly decompressWitness: (a: number, b: number, c: number) => void;
237
233
  readonly compressWitnessStack: (a: number, b: number) => void;
238
234
  readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
239
- readonly initLogLevel: (a: number, b: number, c: number) => void;
240
235
  readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
241
236
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number;
242
237
  readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
238
+ readonly buildInfo: () => number;
239
+ readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
240
+ readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
241
+ readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
242
+ readonly initLogLevel: (a: number, b: number, c: number) => void;
243
243
  readonly __wbindgen_malloc: (a: number) => number;
244
244
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
245
245
  readonly __wbindgen_export_2: WebAssembly.Table;
246
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380: (a: number, b: number, c: number) => void;
246
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385: (a: number, b: number, c: number) => void;
247
247
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
248
248
  readonly __wbindgen_free: (a: number, b: number) => void;
249
- readonly wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa: (a: number, b: number, c: number, d: number, e: number) => void;
249
+ readonly wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256: (a: number, b: number, c: number, d: number, e: number) => void;
250
250
  readonly __wbindgen_exn_store: (a: number) => void;
251
- readonly wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7: (a: number, b: number, c: number, d: number) => void;
251
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587: (a: number, b: number, c: number, d: number) => void;
252
252
  }
253
253
 
254
254
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/web/acvm_js.js CHANGED
@@ -6,6 +6,28 @@ heap.push(undefined, null, true, false);
6
6
 
7
7
  function getObject(idx) { return heap[idx]; }
8
8
 
9
+ function isLikeNone(x) {
10
+ return x === undefined || x === null;
11
+ }
12
+
13
+ let cachedFloat64Memory0 = null;
14
+
15
+ function getFloat64Memory0() {
16
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
17
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
18
+ }
19
+ return cachedFloat64Memory0;
20
+ }
21
+
22
+ let cachedInt32Memory0 = null;
23
+
24
+ function getInt32Memory0() {
25
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
26
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
27
+ }
28
+ return cachedInt32Memory0;
29
+ }
30
+
9
31
  let heap_next = heap.length;
10
32
 
11
33
  function dropObject(idx) {
@@ -47,28 +69,6 @@ function addHeapObject(obj) {
47
69
  return idx;
48
70
  }
49
71
 
50
- function isLikeNone(x) {
51
- return x === undefined || x === null;
52
- }
53
-
54
- let cachedFloat64Memory0 = null;
55
-
56
- function getFloat64Memory0() {
57
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
58
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
59
- }
60
- return cachedFloat64Memory0;
61
- }
62
-
63
- let cachedInt32Memory0 = null;
64
-
65
- function getInt32Memory0() {
66
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
67
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
68
- }
69
- return cachedInt32Memory0;
70
- }
71
-
72
72
  let WASM_VECTOR_LEN = 0;
73
73
 
74
74
  const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
@@ -214,106 +214,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
214
214
  return real;
215
215
  }
216
216
  function __wbg_adapter_22(arg0, arg1, arg2) {
217
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(arg0, arg1, addHeapObject(arg2));
218
- }
219
-
220
- /**
221
- * Returns the `BuildInfo` object containing information about how the installed package was built.
222
- * @returns {BuildInfo} - Information on how the installed package was built.
223
- */
224
- export function buildInfo() {
225
- const ret = wasm.buildInfo();
226
- return takeObject(ret);
227
- }
228
-
229
- function passArray8ToWasm0(arg, malloc) {
230
- const ptr = malloc(arg.length * 1) >>> 0;
231
- getUint8Memory0().set(arg, ptr / 1);
232
- WASM_VECTOR_LEN = arg.length;
233
- return ptr;
234
- }
235
- /**
236
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
237
- *
238
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
239
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
240
- * @returns {WitnessMap} A witness map containing the circuit's return values.
241
- * @param {Uint8Array} program
242
- * @param {WitnessMap} witness_map
243
- * @returns {WitnessMap}
244
- */
245
- export function getReturnWitness(program, witness_map) {
246
- try {
247
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
248
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
249
- const len0 = WASM_VECTOR_LEN;
250
- wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
251
- var r0 = getInt32Memory0()[retptr / 4 + 0];
252
- var r1 = getInt32Memory0()[retptr / 4 + 1];
253
- var r2 = getInt32Memory0()[retptr / 4 + 2];
254
- if (r2) {
255
- throw takeObject(r1);
256
- }
257
- return takeObject(r0);
258
- } finally {
259
- wasm.__wbindgen_add_to_stack_pointer(16);
260
- }
261
- }
262
-
263
- /**
264
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
265
- *
266
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
267
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
268
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
269
- * @param {Uint8Array} program
270
- * @param {WitnessMap} solved_witness
271
- * @returns {WitnessMap}
272
- */
273
- export function getPublicParametersWitness(program, solved_witness) {
274
- try {
275
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
276
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
277
- const len0 = WASM_VECTOR_LEN;
278
- wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
279
- var r0 = getInt32Memory0()[retptr / 4 + 0];
280
- var r1 = getInt32Memory0()[retptr / 4 + 1];
281
- var r2 = getInt32Memory0()[retptr / 4 + 2];
282
- if (r2) {
283
- throw takeObject(r1);
284
- }
285
- return takeObject(r0);
286
- } finally {
287
- wasm.__wbindgen_add_to_stack_pointer(16);
288
- }
289
- }
290
-
291
- /**
292
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
293
- *
294
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
295
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
296
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
297
- * @param {Uint8Array} program
298
- * @param {WitnessMap} solved_witness
299
- * @returns {WitnessMap}
300
- */
301
- export function getPublicWitness(program, solved_witness) {
302
- try {
303
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
304
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
305
- const len0 = WASM_VECTOR_LEN;
306
- wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
307
- var r0 = getInt32Memory0()[retptr / 4 + 0];
308
- var r1 = getInt32Memory0()[retptr / 4 + 1];
309
- var r2 = getInt32Memory0()[retptr / 4 + 2];
310
- if (r2) {
311
- throw takeObject(r1);
312
- }
313
- return takeObject(r0);
314
- } finally {
315
- wasm.__wbindgen_add_to_stack_pointer(16);
316
- }
217
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(arg0, arg1, addHeapObject(arg2));
317
218
  }
318
219
 
319
220
  /**
@@ -338,6 +239,13 @@ export function xor(lhs, rhs) {
338
239
  return takeObject(ret);
339
240
  }
340
241
 
242
+ function passArray8ToWasm0(arg, malloc) {
243
+ const ptr = malloc(arg.length * 1) >>> 0;
244
+ getUint8Memory0().set(arg, ptr / 1);
245
+ WASM_VECTOR_LEN = arg.length;
246
+ return ptr;
247
+ }
248
+
341
249
  function getArrayU8FromWasm0(ptr, len) {
342
250
  ptr = ptr >>> 0;
343
251
  return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
@@ -546,27 +454,6 @@ export function decompressWitnessStack(compressed_witness) {
546
454
  }
547
455
  }
548
456
 
549
- /**
550
- * Sets the package's logging level.
551
- *
552
- * @param {LogLevel} level - The maximum level of logging to be emitted.
553
- */
554
- export function initLogLevel(filter) {
555
- try {
556
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
557
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
558
- const len0 = WASM_VECTOR_LEN;
559
- wasm.initLogLevel(retptr, ptr0, len0);
560
- var r0 = getInt32Memory0()[retptr / 4 + 0];
561
- var r1 = getInt32Memory0()[retptr / 4 + 1];
562
- if (r1) {
563
- throw takeObject(r0);
564
- }
565
- } finally {
566
- wasm.__wbindgen_add_to_stack_pointer(16);
567
- }
568
- }
569
-
570
457
  /**
571
458
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
572
459
  *
@@ -613,8 +500,122 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
613
500
  return takeObject(ret);
614
501
  }
615
502
 
503
+ /**
504
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
505
+ * @returns {BuildInfo} - Information on how the installed package was built.
506
+ */
507
+ export function buildInfo() {
508
+ const ret = wasm.buildInfo();
509
+ return takeObject(ret);
510
+ }
511
+
512
+ /**
513
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
514
+ *
515
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
516
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
517
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
518
+ * @param {Uint8Array} program
519
+ * @param {WitnessMap} witness_map
520
+ * @returns {WitnessMap}
521
+ */
522
+ export function getReturnWitness(program, witness_map) {
523
+ try {
524
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
525
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
526
+ const len0 = WASM_VECTOR_LEN;
527
+ wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
528
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
529
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
530
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
531
+ if (r2) {
532
+ throw takeObject(r1);
533
+ }
534
+ return takeObject(r0);
535
+ } finally {
536
+ wasm.__wbindgen_add_to_stack_pointer(16);
537
+ }
538
+ }
539
+
540
+ /**
541
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
542
+ *
543
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
544
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
545
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
546
+ * @param {Uint8Array} program
547
+ * @param {WitnessMap} solved_witness
548
+ * @returns {WitnessMap}
549
+ */
550
+ export function getPublicParametersWitness(program, solved_witness) {
551
+ try {
552
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
553
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
554
+ const len0 = WASM_VECTOR_LEN;
555
+ wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
556
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
557
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
558
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
559
+ if (r2) {
560
+ throw takeObject(r1);
561
+ }
562
+ return takeObject(r0);
563
+ } finally {
564
+ wasm.__wbindgen_add_to_stack_pointer(16);
565
+ }
566
+ }
567
+
568
+ /**
569
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
570
+ *
571
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
572
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
573
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
574
+ * @param {Uint8Array} program
575
+ * @param {WitnessMap} solved_witness
576
+ * @returns {WitnessMap}
577
+ */
578
+ export function getPublicWitness(program, solved_witness) {
579
+ try {
580
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
581
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
582
+ const len0 = WASM_VECTOR_LEN;
583
+ wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
584
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
585
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
586
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
587
+ if (r2) {
588
+ throw takeObject(r1);
589
+ }
590
+ return takeObject(r0);
591
+ } finally {
592
+ wasm.__wbindgen_add_to_stack_pointer(16);
593
+ }
594
+ }
595
+
596
+ /**
597
+ * Sets the package's logging level.
598
+ *
599
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
600
+ */
601
+ export function initLogLevel(filter) {
602
+ try {
603
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
604
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
605
+ const len0 = WASM_VECTOR_LEN;
606
+ wasm.initLogLevel(retptr, ptr0, len0);
607
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
608
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
609
+ if (r1) {
610
+ throw takeObject(r0);
611
+ }
612
+ } finally {
613
+ wasm.__wbindgen_add_to_stack_pointer(16);
614
+ }
615
+ }
616
+
616
617
  function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {
617
- wasm.wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
618
+ wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
618
619
  }
619
620
 
620
621
  function handleError(f, args) {
@@ -625,7 +626,7 @@ function handleError(f, args) {
625
626
  }
626
627
  }
627
628
  function __wbg_adapter_93(arg0, arg1, arg2, arg3) {
628
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
629
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
629
630
  }
630
631
 
631
632
  async function __wbg_load(module, imports) {
@@ -662,9 +663,23 @@ async function __wbg_load(module, imports) {
662
663
  function __wbg_get_imports() {
663
664
  const imports = {};
664
665
  imports.wbg = {};
666
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
667
+ const obj = getObject(arg1);
668
+ const ret = typeof(obj) === 'number' ? obj : undefined;
669
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
670
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
671
+ };
665
672
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
666
673
  takeObject(arg0);
667
674
  };
675
+ imports.wbg.__wbindgen_is_array = function(arg0) {
676
+ const ret = Array.isArray(getObject(arg0));
677
+ return ret;
678
+ };
679
+ imports.wbg.__wbindgen_is_string = function(arg0) {
680
+ const ret = typeof(getObject(arg0)) === 'string';
681
+ return ret;
682
+ };
668
683
  imports.wbg.__wbindgen_cb_drop = function(arg0) {
669
684
  const obj = takeObject(arg0).original;
670
685
  if (obj.cnt-- == 1) {
@@ -690,12 +705,6 @@ function __wbg_get_imports() {
690
705
  const ret = arg0;
691
706
  return addHeapObject(ret);
692
707
  };
693
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
694
- const obj = getObject(arg1);
695
- const ret = typeof(obj) === 'number' ? obj : undefined;
696
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
697
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
698
- };
699
708
  imports.wbg.__wbg_new_cd95aa9a75b6fbe6 = function() {
700
709
  const ret = new Map();
701
710
  return addHeapObject(ret);
@@ -708,14 +717,6 @@ function __wbg_get_imports() {
708
717
  getInt32Memory0()[arg0 / 4 + 1] = len1;
709
718
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
710
719
  };
711
- imports.wbg.__wbindgen_is_array = function(arg0) {
712
- const ret = Array.isArray(getObject(arg0));
713
- return ret;
714
- };
715
- imports.wbg.__wbindgen_is_string = function(arg0) {
716
- const ret = typeof(getObject(arg0)) === 'string';
717
- return ret;
718
- };
719
720
  imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
720
721
  const ret = new Error();
721
722
  return addHeapObject(ret);
@@ -899,8 +900,8 @@ function __wbg_get_imports() {
899
900
  imports.wbg.__wbindgen_throw = function(arg0, arg1) {
900
901
  throw new Error(getStringFromWasm0(arg0, arg1));
901
902
  };
902
- imports.wbg.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
903
- const ret = makeMutClosure(arg0, arg1, 259, __wbg_adapter_22);
903
+ imports.wbg.__wbindgen_closure_wrapper748 = function(arg0, arg1, arg2) {
904
+ const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_22);
904
905
  return addHeapObject(ret);
905
906
  };
906
907
 
Binary file
@@ -1,10 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function buildInfo(): number;
5
- export function getReturnWitness(a: number, b: number, c: number, d: number): void;
6
- export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
7
- export function getPublicWitness(a: number, b: number, c: number, d: number): void;
8
4
  export function and(a: number, b: number): number;
9
5
  export function xor(a: number, b: number): number;
10
6
  export function sha256(a: number, b: number, c: number): void;
@@ -16,16 +12,20 @@ export function compressWitness(a: number, b: number): void;
16
12
  export function decompressWitness(a: number, b: number, c: number): void;
17
13
  export function compressWitnessStack(a: number, b: number): void;
18
14
  export function decompressWitnessStack(a: number, b: number, c: number): void;
19
- export function initLogLevel(a: number, b: number, c: number): void;
20
15
  export function executeCircuit(a: number, b: number, c: number, d: number): number;
21
16
  export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
22
17
  export function executeProgram(a: number, b: number, c: number, d: number): number;
18
+ export function buildInfo(): number;
19
+ export function getReturnWitness(a: number, b: number, c: number, d: number): void;
20
+ export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
21
+ export function getPublicWitness(a: number, b: number, c: number, d: number): void;
22
+ export function initLogLevel(a: number, b: number, c: number): void;
23
23
  export function __wbindgen_malloc(a: number): number;
24
24
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
25
25
  export const __wbindgen_export_2: WebAssembly.Table;
26
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(a: number, b: number, c: number): void;
26
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(a: number, b: number, c: number): void;
27
27
  export function __wbindgen_add_to_stack_pointer(a: number): number;
28
28
  export function __wbindgen_free(a: number, b: number): void;
29
- export function wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(a: number, b: number, c: number, d: number, e: number): void;
29
+ export function wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(a: number, b: number, c: number, d: number, e: number): void;
30
30
  export function __wbindgen_exn_store(a: number): void;
31
- export function wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587(a: number, b: number, c: number, d: number): void;