@noir-lang/acvm_js 0.37.1 → 0.38.0-2fcbef5.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,45 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
5
- *
6
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
7
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
8
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
9
- * @param {Uint8Array} circuit
10
- * @param {WitnessMap} solved_witness
11
- * @returns {WitnessMap}
12
- */
13
- export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
14
- /**
15
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
16
- *
17
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
18
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
19
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
20
- * @param {Uint8Array} circuit
21
- * @param {WitnessMap} solved_witness
22
- * @returns {WitnessMap}
23
- */
24
- export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
25
- /**
26
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
27
- *
28
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
29
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
30
- * @returns {WitnessMap} A witness map containing the circuit's return values.
31
- * @param {Uint8Array} circuit
32
- * @param {WitnessMap} witness_map
33
- * @returns {WitnessMap}
34
- */
35
- export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
36
- /**
37
- * Sets the package's logging level.
38
- *
39
- * @param {LogLevel} level - The maximum level of logging to be emitted.
40
- */
41
- export function initLogLevel(level: LogLevel): void;
42
- /**
43
4
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
44
5
  *
45
6
  * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
@@ -114,6 +75,12 @@ export function xor(lhs: string, rhs: string): string;
114
75
  */
115
76
  export function and(lhs: string, rhs: string): string;
116
77
  /**
78
+ * Sets the package's logging level.
79
+ *
80
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
81
+ */
82
+ export function initLogLevel(filter: string): void;
83
+ /**
117
84
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
118
85
  *
119
86
  * @param {Uint8Array} compressed_witness - A compressed witness.
@@ -132,6 +99,50 @@ export function compressWitness(witness_map: WitnessMap): Uint8Array;
132
99
  * @returns {BuildInfo} - Information on how the installed package was built.
133
100
  */
134
101
  export function buildInfo(): BuildInfo;
102
+ /**
103
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
104
+ *
105
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
106
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
107
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
108
+ * @param {Uint8Array} circuit
109
+ * @param {WitnessMap} solved_witness
110
+ * @returns {WitnessMap}
111
+ */
112
+ export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
113
+ /**
114
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
115
+ *
116
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
117
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
118
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
119
+ * @param {Uint8Array} circuit
120
+ * @param {WitnessMap} solved_witness
121
+ * @returns {WitnessMap}
122
+ */
123
+ export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
124
+ /**
125
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
126
+ *
127
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
128
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
129
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
130
+ * @param {Uint8Array} circuit
131
+ * @param {WitnessMap} witness_map
132
+ * @returns {WitnessMap}
133
+ */
134
+ export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
135
+
136
+ // Map from witness index to hex string value of witness.
137
+ export type WitnessMap = Map<number, string>;
138
+
139
+
140
+
141
+ export type ExecutionError = Error & {
142
+ callStack?: string[];
143
+ };
144
+
145
+
135
146
 
136
147
  export type ForeignCallInput = string[]
137
148
  export type ForeignCallOutput = string | string[]
@@ -147,21 +158,6 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
147
158
 
148
159
 
149
160
 
150
- export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
151
-
152
-
153
-
154
- // Map from witness index to hex string value of witness.
155
- export type WitnessMap = Map<number, string>;
156
-
157
-
158
-
159
- export type ExecutionError = Error & {
160
- callStack?: string[];
161
- };
162
-
163
-
164
-
165
161
  /**
166
162
  * @typedef {Object} BuildInfo - Information about how the installed package was built
167
163
  * @property {string} gitHash - The hash of the git commit from which the package was built.
package/nodejs/acvm_js.js CHANGED
@@ -23,6 +23,37 @@ function takeObject(idx) {
23
23
  return ret;
24
24
  }
25
25
 
26
+ function isLikeNone(x) {
27
+ return x === undefined || x === null;
28
+ }
29
+
30
+ let cachedFloat64Memory0 = null;
31
+
32
+ function getFloat64Memory0() {
33
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
34
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
35
+ }
36
+ return cachedFloat64Memory0;
37
+ }
38
+
39
+ let cachedInt32Memory0 = null;
40
+
41
+ function getInt32Memory0() {
42
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
43
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
44
+ }
45
+ return cachedInt32Memory0;
46
+ }
47
+
48
+ function addHeapObject(obj) {
49
+ if (heap_next === heap.length) heap.push(heap.length + 1);
50
+ const idx = heap_next;
51
+ heap_next = heap[idx];
52
+
53
+ heap[idx] = obj;
54
+ return idx;
55
+ }
56
+
26
57
  let WASM_VECTOR_LEN = 0;
27
58
 
28
59
  let cachedUint8Memory0 = null;
@@ -87,37 +118,6 @@ function passStringToWasm0(arg, malloc, realloc) {
87
118
  return ptr;
88
119
  }
89
120
 
90
- function isLikeNone(x) {
91
- return x === undefined || x === null;
92
- }
93
-
94
- let cachedInt32Memory0 = null;
95
-
96
- function getInt32Memory0() {
97
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
98
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
99
- }
100
- return cachedInt32Memory0;
101
- }
102
-
103
- function addHeapObject(obj) {
104
- if (heap_next === heap.length) heap.push(heap.length + 1);
105
- const idx = heap_next;
106
- heap_next = heap[idx];
107
-
108
- heap[idx] = obj;
109
- return idx;
110
- }
111
-
112
- let cachedFloat64Memory0 = null;
113
-
114
- function getFloat64Memory0() {
115
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
116
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
117
- }
118
- return cachedFloat64Memory0;
119
- }
120
-
121
121
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
122
122
 
123
123
  cachedTextDecoder.decode();
@@ -226,107 +226,8 @@ function makeMutClosure(arg0, arg1, dtor, f) {
226
226
  return real;
227
227
  }
228
228
  function __wbg_adapter_54(arg0, arg1, arg2) {
229
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783(arg0, arg1, addHeapObject(arg2));
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;
229
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3da3e2c7f8a86974(arg0, arg1, addHeapObject(arg2));
237
230
  }
238
- /**
239
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
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 public inputs.
244
- * @param {Uint8Array} circuit
245
- * @param {WitnessMap} solved_witness
246
- * @returns {WitnessMap}
247
- */
248
- module.exports.getPublicWitness = function(circuit, solved_witness) {
249
- try {
250
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
251
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
252
- const len0 = WASM_VECTOR_LEN;
253
- wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
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} circuit
273
- * @param {WitnessMap} solved_witness
274
- * @returns {WitnessMap}
275
- */
276
- module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
277
- try {
278
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
279
- const ptr0 = passArray8ToWasm0(circuit, 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 return values.
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 return values.
300
- * @param {Uint8Array} circuit
301
- * @param {WitnessMap} witness_map
302
- * @returns {WitnessMap}
303
- */
304
- module.exports.getReturnWitness = function(circuit, witness_map) {
305
- try {
306
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
307
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
308
- const len0 = WASM_VECTOR_LEN;
309
- wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
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
-
322
- /**
323
- * Sets the package's logging level.
324
- *
325
- * @param {LogLevel} level - The maximum level of logging to be emitted.
326
- */
327
- module.exports.initLogLevel = function(level) {
328
- wasm.initLogLevel(addHeapObject(level));
329
- };
330
231
 
331
232
  function _assertClass(instance, klass) {
332
233
  if (!(instance instanceof klass)) {
@@ -334,6 +235,13 @@ function _assertClass(instance, klass) {
334
235
  }
335
236
  return instance.ptr;
336
237
  }
238
+
239
+ function passArray8ToWasm0(arg, malloc) {
240
+ const ptr = malloc(arg.length * 1) >>> 0;
241
+ getUint8Memory0().set(arg, ptr / 1);
242
+ WASM_VECTOR_LEN = arg.length;
243
+ return ptr;
244
+ }
337
245
  /**
338
246
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
339
247
  *
@@ -506,6 +414,17 @@ module.exports.and = function(lhs, rhs) {
506
414
  return takeObject(ret);
507
415
  };
508
416
 
417
+ /**
418
+ * Sets the package's logging level.
419
+ *
420
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
421
+ */
422
+ module.exports.initLogLevel = function(filter) {
423
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
424
+ const len0 = WASM_VECTOR_LEN;
425
+ wasm.initLogLevel(ptr0, len0);
426
+ };
427
+
509
428
  /**
510
429
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
511
430
  *
@@ -564,6 +483,90 @@ module.exports.buildInfo = function() {
564
483
  return takeObject(ret);
565
484
  };
566
485
 
486
+ /**
487
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
488
+ *
489
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
490
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
491
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
492
+ * @param {Uint8Array} circuit
493
+ * @param {WitnessMap} solved_witness
494
+ * @returns {WitnessMap}
495
+ */
496
+ module.exports.getPublicWitness = function(circuit, solved_witness) {
497
+ try {
498
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
499
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
500
+ const len0 = WASM_VECTOR_LEN;
501
+ wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
502
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
503
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
504
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
505
+ if (r2) {
506
+ throw takeObject(r1);
507
+ }
508
+ return takeObject(r0);
509
+ } finally {
510
+ wasm.__wbindgen_add_to_stack_pointer(16);
511
+ }
512
+ };
513
+
514
+ /**
515
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
516
+ *
517
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
518
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
519
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
520
+ * @param {Uint8Array} circuit
521
+ * @param {WitnessMap} solved_witness
522
+ * @returns {WitnessMap}
523
+ */
524
+ module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
525
+ try {
526
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
527
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
528
+ const len0 = WASM_VECTOR_LEN;
529
+ wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
530
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
531
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
532
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
533
+ if (r2) {
534
+ throw takeObject(r1);
535
+ }
536
+ return takeObject(r0);
537
+ } finally {
538
+ wasm.__wbindgen_add_to_stack_pointer(16);
539
+ }
540
+ };
541
+
542
+ /**
543
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
544
+ *
545
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
546
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
547
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
548
+ * @param {Uint8Array} circuit
549
+ * @param {WitnessMap} witness_map
550
+ * @returns {WitnessMap}
551
+ */
552
+ module.exports.getReturnWitness = function(circuit, witness_map) {
553
+ try {
554
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
555
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
556
+ const len0 = WASM_VECTOR_LEN;
557
+ wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
558
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
559
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
560
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
561
+ if (r2) {
562
+ throw takeObject(r1);
563
+ }
564
+ return takeObject(r0);
565
+ } finally {
566
+ wasm.__wbindgen_add_to_stack_pointer(16);
567
+ }
568
+ };
569
+
567
570
  function handleError(f, args) {
568
571
  try {
569
572
  return f.apply(this, args);
@@ -571,8 +574,8 @@ function handleError(f, args) {
571
574
  wasm.__wbindgen_exn_store(addHeapObject(e));
572
575
  }
573
576
  }
574
- function __wbg_adapter_155(arg0, arg1, arg2, arg3) {
575
- wasm.wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
577
+ function __wbg_adapter_159(arg0, arg1, arg2, arg3) {
578
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h1d98448ca4fec2cc(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
576
579
  }
577
580
 
578
581
  /**
@@ -626,35 +629,23 @@ class WasmBlackBoxFunctionSolver {
626
629
  }
627
630
  module.exports.WasmBlackBoxFunctionSolver = WasmBlackBoxFunctionSolver;
628
631
 
629
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
630
- takeObject(arg0);
631
- };
632
-
633
632
  module.exports.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
634
633
  const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
635
634
  return addHeapObject(ret);
636
635
  };
637
636
 
638
- module.exports.__wbindgen_is_array = function(arg0) {
639
- const ret = Array.isArray(getObject(arg0));
640
- return ret;
637
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
638
+ takeObject(arg0);
641
639
  };
642
640
 
643
- module.exports.__wbindgen_string_get = function(arg0, arg1) {
641
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
644
642
  const obj = getObject(arg1);
645
- const ret = typeof(obj) === 'string' ? obj : undefined;
646
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
647
- var len1 = WASM_VECTOR_LEN;
648
- getInt32Memory0()[arg0 / 4 + 1] = len1;
649
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
650
- };
651
-
652
- module.exports.__wbindgen_is_string = function(arg0) {
653
- const ret = typeof(getObject(arg0)) === 'string';
654
- return ret;
643
+ const ret = typeof(obj) === 'number' ? obj : undefined;
644
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
645
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
655
646
  };
656
647
 
657
- module.exports.__wbg_new_746e482766ed0a19 = function() {
648
+ module.exports.__wbg_new_88dbce24756a0c16 = function() {
658
649
  const ret = new Map();
659
650
  return addHeapObject(ret);
660
651
  };
@@ -664,11 +655,13 @@ module.exports.__wbindgen_number_new = function(arg0) {
664
655
  return addHeapObject(ret);
665
656
  };
666
657
 
667
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
658
+ module.exports.__wbindgen_string_get = function(arg0, arg1) {
668
659
  const obj = getObject(arg1);
669
- const ret = typeof(obj) === 'number' ? obj : undefined;
670
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
671
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
660
+ const ret = typeof(obj) === 'string' ? obj : undefined;
661
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
662
+ var len1 = WASM_VECTOR_LEN;
663
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
664
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
672
665
  };
673
666
 
674
667
  module.exports.__wbindgen_error_new = function(arg0, arg1) {
@@ -681,9 +674,14 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
681
674
  return addHeapObject(ret);
682
675
  };
683
676
 
684
- module.exports.__wbg_constructor_fcf20c319686533c = function(arg0) {
685
- const ret = new Error(takeObject(arg0));
686
- return addHeapObject(ret);
677
+ module.exports.__wbindgen_is_string = function(arg0) {
678
+ const ret = typeof(getObject(arg0)) === 'string';
679
+ return ret;
680
+ };
681
+
682
+ module.exports.__wbindgen_is_array = function(arg0) {
683
+ const ret = Array.isArray(getObject(arg0));
684
+ return ret;
687
685
  };
688
686
 
689
687
  module.exports.__wbindgen_string_new = function(arg0, arg1) {
@@ -701,6 +699,11 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
701
699
  return ret;
702
700
  };
703
701
 
702
+ module.exports.__wbg_constructor_b94d8cb256e76d97 = function(arg0) {
703
+ const ret = new Error(takeObject(arg0));
704
+ return addHeapObject(ret);
705
+ };
706
+
704
707
  module.exports.__wbindgen_is_undefined = function(arg0) {
705
708
  const ret = getObject(arg0) === undefined;
706
709
  return ret;
@@ -798,6 +801,14 @@ module.exports.__wbindgen_is_symbol = function(arg0) {
798
801
  return ret;
799
802
  };
800
803
 
804
+ module.exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
805
+ getObject(arg0).getRandomValues(getObject(arg1));
806
+ }, arguments) };
807
+
808
+ module.exports.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
809
+ getObject(arg0).randomFillSync(takeObject(arg1));
810
+ }, arguments) };
811
+
801
812
  module.exports.__wbg_crypto_c48a774b022d20ac = function(arg0) {
802
813
  const ret = getObject(arg0).crypto;
803
814
  return addHeapObject(ret);
@@ -828,13 +839,9 @@ module.exports.__wbg_require_8f08ceecec0f4fee = function() { return handleError(
828
839
  return addHeapObject(ret);
829
840
  }, arguments) };
830
841
 
831
- module.exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
832
- getObject(arg0).getRandomValues(getObject(arg1));
833
- }, arguments) };
834
-
835
- module.exports.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
836
- getObject(arg0).randomFillSync(takeObject(arg1));
837
- }, arguments) };
842
+ module.exports.__wbg_debug_e3f6a1578e6d45ca = function(arg0) {
843
+ console.debug(getObject(arg0));
844
+ };
838
845
 
839
846
  module.exports.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
840
847
  console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
@@ -848,12 +855,16 @@ module.exports.__wbg_error_50f42b952a595a23 = function(arg0, arg1, arg2, arg3) {
848
855
  console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
849
856
  };
850
857
 
858
+ module.exports.__wbg_info_05db236d79f1b785 = function(arg0) {
859
+ console.info(getObject(arg0));
860
+ };
861
+
851
862
  module.exports.__wbg_info_24d8f53d98f12b95 = function(arg0, arg1, arg2, arg3) {
852
863
  console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
853
864
  };
854
865
 
855
- module.exports.__wbg_log_9b164efbe6db702f = function(arg0, arg1, arg2, arg3) {
856
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
866
+ module.exports.__wbg_warn_9bdd743e9f5fe1e0 = function(arg0) {
867
+ console.warn(getObject(arg0));
857
868
  };
858
869
 
859
870
  module.exports.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
@@ -999,7 +1010,7 @@ module.exports.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) {
999
1010
  const a = state0.a;
1000
1011
  state0.a = 0;
1001
1012
  try {
1002
- return __wbg_adapter_155(a, state0.b, arg0, arg1);
1013
+ return __wbg_adapter_159(a, state0.b, arg0, arg1);
1003
1014
  } finally {
1004
1015
  state0.a = a;
1005
1016
  }
@@ -1027,7 +1038,7 @@ module.exports.__wbg_new_2b55e405e4af4986 = function(arg0, arg1) {
1027
1038
  const a = state0.a;
1028
1039
  state0.a = 0;
1029
1040
  try {
1030
- return __wbg_adapter_155(a, state0.b, arg0, arg1);
1041
+ return __wbg_adapter_159(a, state0.b, arg0, arg1);
1031
1042
  } finally {
1032
1043
  state0.a = a;
1033
1044
  }
@@ -1189,8 +1200,8 @@ module.exports.__wbindgen_function_table = function() {
1189
1200
  return addHeapObject(ret);
1190
1201
  };
1191
1202
 
1192
- module.exports.__wbindgen_closure_wrapper505 = function(arg0, arg1, arg2) {
1193
- const ret = makeMutClosure(arg0, arg1, 161, __wbg_adapter_54);
1203
+ module.exports.__wbindgen_closure_wrapper1403 = function(arg0, arg1, arg2) {
1204
+ const ret = makeMutClosure(arg0, arg1, 493, __wbg_adapter_54);
1194
1205
  return addHeapObject(ret);
1195
1206
  };
1196
1207
 
Binary file
@@ -1,10 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function getPublicWitness(a: number, b: number, c: number, d: number): void;
5
- export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
6
- export function getReturnWitness(a: number, b: number, c: number, d: number): void;
7
- export function initLogLevel(a: number): void;
8
4
  export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
9
5
  export function executeCircuit(a: number, b: number, c: number, d: number): number;
10
6
  export function createBlackBoxSolver(): number;
@@ -16,16 +12,20 @@ export function blake2s256(a: number, b: number, c: number): void;
16
12
  export function sha256(a: number, b: number, c: number): void;
17
13
  export function xor(a: number, b: number): number;
18
14
  export function and(a: number, b: number): number;
15
+ export function initLogLevel(a: number, b: number): void;
19
16
  export function decompressWitness(a: number, b: number, c: number): void;
20
17
  export function compressWitness(a: number, b: number): void;
21
18
  export function buildInfo(): number;
19
+ export function getPublicWitness(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 getReturnWitness(a: number, b: number, c: number, d: number): void;
22
22
  export function __wbg_trap_free(a: number): void;
23
23
  export function trap___wbgd_downcast_token(): number;
24
24
  export function __wbindgen_malloc(a: number): number;
25
25
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
26
26
  export const __wbindgen_export_2: WebAssembly.Table;
27
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783(a: number, b: number, c: number): void;
27
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3da3e2c7f8a86974(a: number, b: number, c: number): void;
28
28
  export function __wbindgen_add_to_stack_pointer(a: number): number;
29
29
  export function __wbindgen_free(a: number, b: number): void;
30
30
  export function __wbindgen_exn_store(a: number): void;
31
- export function wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__h1d98448ca4fec2cc(a: number, b: number, c: number, d: number): void;
package/package.json CHANGED
@@ -1,16 +1,21 @@
1
1
  {
2
2
  "name": "@noir-lang/acvm_js",
3
- "version": "0.37.1",
4
- "repository": {
5
- "type": "git",
6
- "url": "https://github.com/noir-lang/acvm.git"
7
- },
3
+ "version": "0.38.0-2fcbef5.nightly",
8
4
  "publishConfig": {
9
5
  "access": "public"
10
6
  },
11
- "collaborators": [
7
+ "contributors": [
12
8
  "The Noir Team <team@noir-lang.org>"
13
9
  ],
10
+ "homepage": "https://noir-lang.org/",
11
+ "repository": {
12
+ "url": "https://github.com/noir-lang/noir.git",
13
+ "directory": "acvm_repo/acvm_js",
14
+ "type": "git"
15
+ },
16
+ "bugs": {
17
+ "url": "https://github.com/noir-lang/noir/issues"
18
+ },
14
19
  "license": "MIT",
15
20
  "main": "./nodejs/acvm_js.js",
16
21
  "types": "./web/acvm_js.d.ts",
package/web/acvm_js.d.ts CHANGED
@@ -1,45 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
5
- *
6
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
7
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
8
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
9
- * @param {Uint8Array} circuit
10
- * @param {WitnessMap} solved_witness
11
- * @returns {WitnessMap}
12
- */
13
- export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
14
- /**
15
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
16
- *
17
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
18
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
19
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
20
- * @param {Uint8Array} circuit
21
- * @param {WitnessMap} solved_witness
22
- * @returns {WitnessMap}
23
- */
24
- export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
25
- /**
26
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
27
- *
28
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
29
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
30
- * @returns {WitnessMap} A witness map containing the circuit's return values.
31
- * @param {Uint8Array} circuit
32
- * @param {WitnessMap} witness_map
33
- * @returns {WitnessMap}
34
- */
35
- export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
36
- /**
37
- * Sets the package's logging level.
38
- *
39
- * @param {LogLevel} level - The maximum level of logging to be emitted.
40
- */
41
- export function initLogLevel(level: LogLevel): void;
42
- /**
43
4
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
44
5
  *
45
6
  * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
@@ -114,6 +75,12 @@ export function xor(lhs: string, rhs: string): string;
114
75
  */
115
76
  export function and(lhs: string, rhs: string): string;
116
77
  /**
78
+ * Sets the package's logging level.
79
+ *
80
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
81
+ */
82
+ export function initLogLevel(filter: string): void;
83
+ /**
117
84
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
118
85
  *
119
86
  * @param {Uint8Array} compressed_witness - A compressed witness.
@@ -132,6 +99,50 @@ export function compressWitness(witness_map: WitnessMap): Uint8Array;
132
99
  * @returns {BuildInfo} - Information on how the installed package was built.
133
100
  */
134
101
  export function buildInfo(): BuildInfo;
102
+ /**
103
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
104
+ *
105
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
106
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
107
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
108
+ * @param {Uint8Array} circuit
109
+ * @param {WitnessMap} solved_witness
110
+ * @returns {WitnessMap}
111
+ */
112
+ export function getPublicWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
113
+ /**
114
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
115
+ *
116
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
117
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
118
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
119
+ * @param {Uint8Array} circuit
120
+ * @param {WitnessMap} solved_witness
121
+ * @returns {WitnessMap}
122
+ */
123
+ export function getPublicParametersWitness(circuit: Uint8Array, solved_witness: WitnessMap): WitnessMap;
124
+ /**
125
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
126
+ *
127
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
128
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
129
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
130
+ * @param {Uint8Array} circuit
131
+ * @param {WitnessMap} witness_map
132
+ * @returns {WitnessMap}
133
+ */
134
+ export function getReturnWitness(circuit: Uint8Array, witness_map: WitnessMap): WitnessMap;
135
+
136
+ // Map from witness index to hex string value of witness.
137
+ export type WitnessMap = Map<number, string>;
138
+
139
+
140
+
141
+ export type ExecutionError = Error & {
142
+ callStack?: string[];
143
+ };
144
+
145
+
135
146
 
136
147
  export type ForeignCallInput = string[]
137
148
  export type ForeignCallOutput = string | string[]
@@ -147,21 +158,6 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
147
158
 
148
159
 
149
160
 
150
- export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
151
-
152
-
153
-
154
- // Map from witness index to hex string value of witness.
155
- export type WitnessMap = Map<number, string>;
156
-
157
-
158
-
159
- export type ExecutionError = Error & {
160
- callStack?: string[];
161
- };
162
-
163
-
164
-
165
161
  /**
166
162
  * @typedef {Object} BuildInfo - Information about how the installed package was built
167
163
  * @property {string} gitHash - The hash of the git commit from which the package was built.
@@ -195,10 +191,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
195
191
 
196
192
  export interface InitOutput {
197
193
  readonly memory: WebAssembly.Memory;
198
- readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
199
- readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
200
- readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
201
- readonly initLogLevel: (a: number) => void;
202
194
  readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
203
195
  readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
204
196
  readonly createBlackBoxSolver: () => number;
@@ -210,19 +202,23 @@ export interface InitOutput {
210
202
  readonly sha256: (a: number, b: number, c: number) => void;
211
203
  readonly xor: (a: number, b: number) => number;
212
204
  readonly and: (a: number, b: number) => number;
205
+ readonly initLogLevel: (a: number, b: number) => void;
213
206
  readonly decompressWitness: (a: number, b: number, c: number) => void;
214
207
  readonly compressWitness: (a: number, b: number) => void;
215
208
  readonly buildInfo: () => number;
209
+ readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
210
+ readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
211
+ readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
216
212
  readonly __wbg_trap_free: (a: number) => void;
217
213
  readonly trap___wbgd_downcast_token: () => number;
218
214
  readonly __wbindgen_malloc: (a: number) => number;
219
215
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
220
216
  readonly __wbindgen_export_2: WebAssembly.Table;
221
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783: (a: number, b: number, c: number) => void;
217
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3da3e2c7f8a86974: (a: number, b: number, c: number) => void;
222
218
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
223
219
  readonly __wbindgen_free: (a: number, b: number) => void;
224
220
  readonly __wbindgen_exn_store: (a: number) => void;
225
- readonly wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687: (a: number, b: number, c: number, d: number) => void;
221
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h1d98448ca4fec2cc: (a: number, b: number, c: number, d: number) => void;
226
222
  }
227
223
 
228
224
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/web/acvm_js.js CHANGED
@@ -20,6 +20,37 @@ function takeObject(idx) {
20
20
  return ret;
21
21
  }
22
22
 
23
+ function isLikeNone(x) {
24
+ return x === undefined || x === null;
25
+ }
26
+
27
+ let cachedFloat64Memory0 = null;
28
+
29
+ function getFloat64Memory0() {
30
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
31
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
32
+ }
33
+ return cachedFloat64Memory0;
34
+ }
35
+
36
+ let cachedInt32Memory0 = null;
37
+
38
+ function getInt32Memory0() {
39
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
40
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
41
+ }
42
+ return cachedInt32Memory0;
43
+ }
44
+
45
+ function addHeapObject(obj) {
46
+ if (heap_next === heap.length) heap.push(heap.length + 1);
47
+ const idx = heap_next;
48
+ heap_next = heap[idx];
49
+
50
+ heap[idx] = obj;
51
+ return idx;
52
+ }
53
+
23
54
  let WASM_VECTOR_LEN = 0;
24
55
 
25
56
  let cachedUint8Memory0 = null;
@@ -84,37 +115,6 @@ function passStringToWasm0(arg, malloc, realloc) {
84
115
  return ptr;
85
116
  }
86
117
 
87
- function isLikeNone(x) {
88
- return x === undefined || x === null;
89
- }
90
-
91
- let cachedInt32Memory0 = null;
92
-
93
- function getInt32Memory0() {
94
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
95
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
96
- }
97
- return cachedInt32Memory0;
98
- }
99
-
100
- function addHeapObject(obj) {
101
- if (heap_next === heap.length) heap.push(heap.length + 1);
102
- const idx = heap_next;
103
- heap_next = heap[idx];
104
-
105
- heap[idx] = obj;
106
- return idx;
107
- }
108
-
109
- let cachedFloat64Memory0 = null;
110
-
111
- function getFloat64Memory0() {
112
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
113
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
114
- }
115
- return cachedFloat64Memory0;
116
- }
117
-
118
118
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
119
119
 
120
120
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -223,106 +223,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
223
223
  return real;
224
224
  }
225
225
  function __wbg_adapter_54(arg0, arg1, arg2) {
226
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783(arg0, arg1, addHeapObject(arg2));
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 public inputs.
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 public inputs.
241
- * @param {Uint8Array} circuit
242
- * @param {WitnessMap} solved_witness
243
- * @returns {WitnessMap}
244
- */
245
- export function getPublicWitness(circuit, solved_witness) {
246
- try {
247
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
248
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
249
- const len0 = WASM_VECTOR_LEN;
250
- wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
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} circuit
270
- * @param {WitnessMap} solved_witness
271
- * @returns {WitnessMap}
272
- */
273
- export function getPublicParametersWitness(circuit, solved_witness) {
274
- try {
275
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
276
- const ptr0 = passArray8ToWasm0(circuit, 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 return values.
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 return values.
297
- * @param {Uint8Array} circuit
298
- * @param {WitnessMap} witness_map
299
- * @returns {WitnessMap}
300
- */
301
- export function getReturnWitness(circuit, witness_map) {
302
- try {
303
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
304
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
305
- const len0 = WASM_VECTOR_LEN;
306
- wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
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
- }
317
- }
318
-
319
- /**
320
- * Sets the package's logging level.
321
- *
322
- * @param {LogLevel} level - The maximum level of logging to be emitted.
323
- */
324
- export function initLogLevel(level) {
325
- wasm.initLogLevel(addHeapObject(level));
226
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3da3e2c7f8a86974(arg0, arg1, addHeapObject(arg2));
326
227
  }
327
228
 
328
229
  function _assertClass(instance, klass) {
@@ -331,6 +232,13 @@ function _assertClass(instance, klass) {
331
232
  }
332
233
  return instance.ptr;
333
234
  }
235
+
236
+ function passArray8ToWasm0(arg, malloc) {
237
+ const ptr = malloc(arg.length * 1) >>> 0;
238
+ getUint8Memory0().set(arg, ptr / 1);
239
+ WASM_VECTOR_LEN = arg.length;
240
+ return ptr;
241
+ }
334
242
  /**
335
243
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
336
244
  *
@@ -503,6 +411,17 @@ export function and(lhs, rhs) {
503
411
  return takeObject(ret);
504
412
  }
505
413
 
414
+ /**
415
+ * Sets the package's logging level.
416
+ *
417
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
418
+ */
419
+ export function initLogLevel(filter) {
420
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
421
+ const len0 = WASM_VECTOR_LEN;
422
+ wasm.initLogLevel(ptr0, len0);
423
+ }
424
+
506
425
  /**
507
426
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
508
427
  *
@@ -561,6 +480,90 @@ export function buildInfo() {
561
480
  return takeObject(ret);
562
481
  }
563
482
 
483
+ /**
484
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
485
+ *
486
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
487
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
488
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
489
+ * @param {Uint8Array} circuit
490
+ * @param {WitnessMap} solved_witness
491
+ * @returns {WitnessMap}
492
+ */
493
+ export function getPublicWitness(circuit, solved_witness) {
494
+ try {
495
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
496
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
497
+ const len0 = WASM_VECTOR_LEN;
498
+ wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
499
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
500
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
501
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
502
+ if (r2) {
503
+ throw takeObject(r1);
504
+ }
505
+ return takeObject(r0);
506
+ } finally {
507
+ wasm.__wbindgen_add_to_stack_pointer(16);
508
+ }
509
+ }
510
+
511
+ /**
512
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
513
+ *
514
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
515
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
516
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
517
+ * @param {Uint8Array} circuit
518
+ * @param {WitnessMap} solved_witness
519
+ * @returns {WitnessMap}
520
+ */
521
+ export function getPublicParametersWitness(circuit, solved_witness) {
522
+ try {
523
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
524
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
525
+ const len0 = WASM_VECTOR_LEN;
526
+ wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
527
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
528
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
529
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
530
+ if (r2) {
531
+ throw takeObject(r1);
532
+ }
533
+ return takeObject(r0);
534
+ } finally {
535
+ wasm.__wbindgen_add_to_stack_pointer(16);
536
+ }
537
+ }
538
+
539
+ /**
540
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
541
+ *
542
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
543
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
544
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
545
+ * @param {Uint8Array} circuit
546
+ * @param {WitnessMap} witness_map
547
+ * @returns {WitnessMap}
548
+ */
549
+ export function getReturnWitness(circuit, witness_map) {
550
+ try {
551
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
552
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
553
+ const len0 = WASM_VECTOR_LEN;
554
+ wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
555
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
556
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
557
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
558
+ if (r2) {
559
+ throw takeObject(r1);
560
+ }
561
+ return takeObject(r0);
562
+ } finally {
563
+ wasm.__wbindgen_add_to_stack_pointer(16);
564
+ }
565
+ }
566
+
564
567
  function handleError(f, args) {
565
568
  try {
566
569
  return f.apply(this, args);
@@ -568,8 +571,8 @@ function handleError(f, args) {
568
571
  wasm.__wbindgen_exn_store(addHeapObject(e));
569
572
  }
570
573
  }
571
- function __wbg_adapter_155(arg0, arg1, arg2, arg3) {
572
- wasm.wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
574
+ function __wbg_adapter_159(arg0, arg1, arg2, arg3) {
575
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h1d98448ca4fec2cc(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
573
576
  }
574
577
 
575
578
  /**
@@ -655,30 +658,20 @@ async function __wbg_load(module, imports) {
655
658
  function __wbg_get_imports() {
656
659
  const imports = {};
657
660
  imports.wbg = {};
658
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
659
- takeObject(arg0);
660
- };
661
661
  imports.wbg.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
662
662
  const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
663
663
  return addHeapObject(ret);
664
664
  };
665
- imports.wbg.__wbindgen_is_array = function(arg0) {
666
- const ret = Array.isArray(getObject(arg0));
667
- return ret;
665
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
666
+ takeObject(arg0);
668
667
  };
669
- imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
668
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
670
669
  const obj = getObject(arg1);
671
- const ret = typeof(obj) === 'string' ? obj : undefined;
672
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
673
- var len1 = WASM_VECTOR_LEN;
674
- getInt32Memory0()[arg0 / 4 + 1] = len1;
675
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
676
- };
677
- imports.wbg.__wbindgen_is_string = function(arg0) {
678
- const ret = typeof(getObject(arg0)) === 'string';
679
- return ret;
670
+ const ret = typeof(obj) === 'number' ? obj : undefined;
671
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
672
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
680
673
  };
681
- imports.wbg.__wbg_new_746e482766ed0a19 = function() {
674
+ imports.wbg.__wbg_new_88dbce24756a0c16 = function() {
682
675
  const ret = new Map();
683
676
  return addHeapObject(ret);
684
677
  };
@@ -686,11 +679,13 @@ function __wbg_get_imports() {
686
679
  const ret = arg0;
687
680
  return addHeapObject(ret);
688
681
  };
689
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
682
+ imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
690
683
  const obj = getObject(arg1);
691
- const ret = typeof(obj) === 'number' ? obj : undefined;
692
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
693
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
684
+ const ret = typeof(obj) === 'string' ? obj : undefined;
685
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
686
+ var len1 = WASM_VECTOR_LEN;
687
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
688
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
694
689
  };
695
690
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
696
691
  const ret = new Error(getStringFromWasm0(arg0, arg1));
@@ -700,9 +695,13 @@ function __wbg_get_imports() {
700
695
  const ret = getObject(arg0);
701
696
  return addHeapObject(ret);
702
697
  };
703
- imports.wbg.__wbg_constructor_fcf20c319686533c = function(arg0) {
704
- const ret = new Error(takeObject(arg0));
705
- return addHeapObject(ret);
698
+ imports.wbg.__wbindgen_is_string = function(arg0) {
699
+ const ret = typeof(getObject(arg0)) === 'string';
700
+ return ret;
701
+ };
702
+ imports.wbg.__wbindgen_is_array = function(arg0) {
703
+ const ret = Array.isArray(getObject(arg0));
704
+ return ret;
706
705
  };
707
706
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
708
707
  const ret = getStringFromWasm0(arg0, arg1);
@@ -717,6 +716,10 @@ function __wbg_get_imports() {
717
716
  const ret = false;
718
717
  return ret;
719
718
  };
719
+ imports.wbg.__wbg_constructor_b94d8cb256e76d97 = function(arg0) {
720
+ const ret = new Error(takeObject(arg0));
721
+ return addHeapObject(ret);
722
+ };
720
723
  imports.wbg.__wbindgen_is_undefined = function(arg0) {
721
724
  const ret = getObject(arg0) === undefined;
722
725
  return ret;
@@ -798,6 +801,12 @@ function __wbg_get_imports() {
798
801
  const ret = typeof(getObject(arg0)) === 'symbol';
799
802
  return ret;
800
803
  };
804
+ imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
805
+ getObject(arg0).getRandomValues(getObject(arg1));
806
+ }, arguments) };
807
+ imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
808
+ getObject(arg0).randomFillSync(takeObject(arg1));
809
+ }, arguments) };
801
810
  imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
802
811
  const ret = getObject(arg0).crypto;
803
812
  return addHeapObject(ret);
@@ -822,12 +831,9 @@ function __wbg_get_imports() {
822
831
  const ret = module.require;
823
832
  return addHeapObject(ret);
824
833
  }, arguments) };
825
- imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
826
- getObject(arg0).getRandomValues(getObject(arg1));
827
- }, arguments) };
828
- imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
829
- getObject(arg0).randomFillSync(takeObject(arg1));
830
- }, arguments) };
834
+ imports.wbg.__wbg_debug_e3f6a1578e6d45ca = function(arg0) {
835
+ console.debug(getObject(arg0));
836
+ };
831
837
  imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
832
838
  console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
833
839
  };
@@ -837,11 +843,14 @@ function __wbg_get_imports() {
837
843
  imports.wbg.__wbg_error_50f42b952a595a23 = function(arg0, arg1, arg2, arg3) {
838
844
  console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
839
845
  };
846
+ imports.wbg.__wbg_info_05db236d79f1b785 = function(arg0) {
847
+ console.info(getObject(arg0));
848
+ };
840
849
  imports.wbg.__wbg_info_24d8f53d98f12b95 = function(arg0, arg1, arg2, arg3) {
841
850
  console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
842
851
  };
843
- imports.wbg.__wbg_log_9b164efbe6db702f = function(arg0, arg1, arg2, arg3) {
844
- console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
852
+ imports.wbg.__wbg_warn_9bdd743e9f5fe1e0 = function(arg0) {
853
+ console.warn(getObject(arg0));
845
854
  };
846
855
  imports.wbg.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
847
856
  console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
@@ -960,7 +969,7 @@ function __wbg_get_imports() {
960
969
  const a = state0.a;
961
970
  state0.a = 0;
962
971
  try {
963
- return __wbg_adapter_155(a, state0.b, arg0, arg1);
972
+ return __wbg_adapter_159(a, state0.b, arg0, arg1);
964
973
  } finally {
965
974
  state0.a = a;
966
975
  }
@@ -985,7 +994,7 @@ function __wbg_get_imports() {
985
994
  const a = state0.a;
986
995
  state0.a = 0;
987
996
  try {
988
- return __wbg_adapter_155(a, state0.b, arg0, arg1);
997
+ return __wbg_adapter_159(a, state0.b, arg0, arg1);
989
998
  } finally {
990
999
  state0.a = a;
991
1000
  }
@@ -1119,8 +1128,8 @@ function __wbg_get_imports() {
1119
1128
  const ret = wasm.__wbindgen_export_2;
1120
1129
  return addHeapObject(ret);
1121
1130
  };
1122
- imports.wbg.__wbindgen_closure_wrapper505 = function(arg0, arg1, arg2) {
1123
- const ret = makeMutClosure(arg0, arg1, 161, __wbg_adapter_54);
1131
+ imports.wbg.__wbindgen_closure_wrapper1403 = function(arg0, arg1, arg2) {
1132
+ const ret = makeMutClosure(arg0, arg1, 493, __wbg_adapter_54);
1124
1133
  return addHeapObject(ret);
1125
1134
  };
1126
1135
 
Binary file
@@ -1,10 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function getPublicWitness(a: number, b: number, c: number, d: number): void;
5
- export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
6
- export function getReturnWitness(a: number, b: number, c: number, d: number): void;
7
- export function initLogLevel(a: number): void;
8
4
  export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
9
5
  export function executeCircuit(a: number, b: number, c: number, d: number): number;
10
6
  export function createBlackBoxSolver(): number;
@@ -16,16 +12,20 @@ export function blake2s256(a: number, b: number, c: number): void;
16
12
  export function sha256(a: number, b: number, c: number): void;
17
13
  export function xor(a: number, b: number): number;
18
14
  export function and(a: number, b: number): number;
15
+ export function initLogLevel(a: number, b: number): void;
19
16
  export function decompressWitness(a: number, b: number, c: number): void;
20
17
  export function compressWitness(a: number, b: number): void;
21
18
  export function buildInfo(): number;
19
+ export function getPublicWitness(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 getReturnWitness(a: number, b: number, c: number, d: number): void;
22
22
  export function __wbg_trap_free(a: number): void;
23
23
  export function trap___wbgd_downcast_token(): number;
24
24
  export function __wbindgen_malloc(a: number): number;
25
25
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
26
26
  export const __wbindgen_export_2: WebAssembly.Table;
27
- export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3d2354449e918783(a: number, b: number, c: number): void;
27
+ export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h3da3e2c7f8a86974(a: number, b: number, c: number): void;
28
28
  export function __wbindgen_add_to_stack_pointer(a: number): number;
29
29
  export function __wbindgen_free(a: number, b: number): void;
30
30
  export function __wbindgen_exn_store(a: number): void;
31
- export function wasm_bindgen__convert__closures__invoke2_mut__ha676a05262f43687(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__h1d98448ca4fec2cc(a: number, b: number, c: number, d: number): void;