@noir-lang/acvm_js 0.45.0 → 0.46.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
+ * Sets the package's logging level.
5
+ *
6
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
7
+ */
8
+ export function initLogLevel(filter: string): void;
9
+ /**
10
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
11
+ * @returns {BuildInfo} - Information on how the installed package was built.
12
+ */
13
+ export function buildInfo(): BuildInfo;
14
+ /**
4
15
  * Performs a bitwise AND operation between `lhs` and `rhs`
5
16
  * @param {string} lhs
6
17
  * @param {string} rhs
@@ -51,50 +62,6 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
51
62
  */
52
63
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
53
64
  /**
54
- * Returns the `BuildInfo` object containing information about how the installed package was built.
55
- * @returns {BuildInfo} - Information on how the installed package was built.
56
- */
57
- export function buildInfo(): BuildInfo;
58
- /**
59
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
60
- *
61
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
62
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
63
- * @returns {WitnessMap} A witness map containing the circuit's return values.
64
- * @param {Uint8Array} program
65
- * @param {WitnessMap} witness_map
66
- * @returns {WitnessMap}
67
- */
68
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
69
- /**
70
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
71
- *
72
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
73
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
74
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
75
- * @param {Uint8Array} program
76
- * @param {WitnessMap} solved_witness
77
- * @returns {WitnessMap}
78
- */
79
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
80
- /**
81
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
82
- *
83
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
84
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
85
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
86
- * @param {Uint8Array} program
87
- * @param {WitnessMap} solved_witness
88
- * @returns {WitnessMap}
89
- */
90
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
91
- /**
92
- * Sets the package's logging level.
93
- *
94
- * @param {LogLevel} level - The maximum level of logging to be emitted.
95
- */
96
- export function initLogLevel(filter: string): void;
97
- /**
98
65
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
99
66
  *
100
67
  * @param {WitnessMap} witness_map - A witness map.
@@ -163,12 +130,39 @@ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap,
163
130
  /**
164
131
  */
165
132
  export function executeProgramWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_executor: ForeignCallHandler): Promise<WitnessStack>;
166
-
167
- export type ExecutionError = Error & {
168
- callStack?: string[];
169
- };
170
-
171
-
133
+ /**
134
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
135
+ *
136
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
137
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
138
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
139
+ * @param {Uint8Array} program
140
+ * @param {WitnessMap} witness_map
141
+ * @returns {WitnessMap}
142
+ */
143
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
144
+ /**
145
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
146
+ *
147
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
148
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
149
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
150
+ * @param {Uint8Array} program
151
+ * @param {WitnessMap} solved_witness
152
+ * @returns {WitnessMap}
153
+ */
154
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
155
+ /**
156
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
157
+ *
158
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
159
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
160
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
161
+ * @param {Uint8Array} program
162
+ * @param {WitnessMap} solved_witness
163
+ * @returns {WitnessMap}
164
+ */
165
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
172
166
 
173
167
  // Map from witness index to hex string value of witness.
174
168
  export type WitnessMap = Map<number, string>;
@@ -213,6 +207,17 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
213
207
 
214
208
 
215
209
 
210
+ export type RawAssertionPayload = {
211
+ selector: string;
212
+ data: string[];
213
+ };
214
+ export type ExecutionError = Error & {
215
+ callStack?: string[];
216
+ rawAssertionPayload?: RawAssertionPayload;
217
+ };
218
+
219
+
220
+
216
221
  export type StackItem = {
217
222
  index: number;
218
223
  witness: WitnessMap;
package/nodejs/acvm_js.js CHANGED
@@ -23,28 +23,6 @@ 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
26
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
49
27
 
50
28
  cachedTextDecoder.decode();
@@ -127,6 +105,28 @@ function passStringToWasm0(arg, malloc, realloc) {
127
105
  return ptr;
128
106
  }
129
107
 
108
+ function isLikeNone(x) {
109
+ return x === undefined || x === null;
110
+ }
111
+
112
+ let cachedInt32Memory0 = null;
113
+
114
+ function getInt32Memory0() {
115
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
116
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
117
+ }
118
+ return cachedInt32Memory0;
119
+ }
120
+
121
+ let cachedFloat64Memory0 = null;
122
+
123
+ function getFloat64Memory0() {
124
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
125
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
126
+ }
127
+ return cachedFloat64Memory0;
128
+ }
129
+
130
130
  let cachedBigInt64Memory0 = null;
131
131
 
132
132
  function getBigInt64Memory0() {
@@ -229,6 +229,36 @@ function __wbg_adapter_52(arg0, arg1, arg2) {
229
229
  wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5258430255de068(arg0, arg1, addHeapObject(arg2));
230
230
  }
231
231
 
232
+ /**
233
+ * Sets the package's logging level.
234
+ *
235
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
236
+ */
237
+ module.exports.initLogLevel = function(filter) {
238
+ try {
239
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
240
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
241
+ const len0 = WASM_VECTOR_LEN;
242
+ wasm.initLogLevel(retptr, ptr0, len0);
243
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
244
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
245
+ if (r1) {
246
+ throw takeObject(r0);
247
+ }
248
+ } finally {
249
+ wasm.__wbindgen_add_to_stack_pointer(16);
250
+ }
251
+ };
252
+
253
+ /**
254
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
255
+ * @returns {BuildInfo} - Information on how the installed package was built.
256
+ */
257
+ module.exports.buildInfo = function() {
258
+ const ret = wasm.buildInfo();
259
+ return takeObject(ret);
260
+ };
261
+
232
262
  /**
233
263
  * Performs a bitwise AND operation between `lhs` and `rhs`
234
264
  * @param {string} lhs
@@ -367,120 +397,6 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
367
397
  return ret !== 0;
368
398
  };
369
399
 
370
- /**
371
- * Returns the `BuildInfo` object containing information about how the installed package was built.
372
- * @returns {BuildInfo} - Information on how the installed package was built.
373
- */
374
- module.exports.buildInfo = function() {
375
- const ret = wasm.buildInfo();
376
- return takeObject(ret);
377
- };
378
-
379
- /**
380
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
381
- *
382
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
383
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
384
- * @returns {WitnessMap} A witness map containing the circuit's return values.
385
- * @param {Uint8Array} program
386
- * @param {WitnessMap} witness_map
387
- * @returns {WitnessMap}
388
- */
389
- module.exports.getReturnWitness = function(program, witness_map) {
390
- try {
391
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
392
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
393
- const len0 = WASM_VECTOR_LEN;
394
- wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
395
- var r0 = getInt32Memory0()[retptr / 4 + 0];
396
- var r1 = getInt32Memory0()[retptr / 4 + 1];
397
- var r2 = getInt32Memory0()[retptr / 4 + 2];
398
- if (r2) {
399
- throw takeObject(r1);
400
- }
401
- return takeObject(r0);
402
- } finally {
403
- wasm.__wbindgen_add_to_stack_pointer(16);
404
- }
405
- };
406
-
407
- /**
408
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
409
- *
410
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
411
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
412
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
413
- * @param {Uint8Array} program
414
- * @param {WitnessMap} solved_witness
415
- * @returns {WitnessMap}
416
- */
417
- module.exports.getPublicParametersWitness = function(program, solved_witness) {
418
- try {
419
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
420
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
421
- const len0 = WASM_VECTOR_LEN;
422
- wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
423
- var r0 = getInt32Memory0()[retptr / 4 + 0];
424
- var r1 = getInt32Memory0()[retptr / 4 + 1];
425
- var r2 = getInt32Memory0()[retptr / 4 + 2];
426
- if (r2) {
427
- throw takeObject(r1);
428
- }
429
- return takeObject(r0);
430
- } finally {
431
- wasm.__wbindgen_add_to_stack_pointer(16);
432
- }
433
- };
434
-
435
- /**
436
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
437
- *
438
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
439
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
440
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
441
- * @param {Uint8Array} program
442
- * @param {WitnessMap} solved_witness
443
- * @returns {WitnessMap}
444
- */
445
- module.exports.getPublicWitness = function(program, solved_witness) {
446
- try {
447
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
448
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
449
- const len0 = WASM_VECTOR_LEN;
450
- wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
451
- var r0 = getInt32Memory0()[retptr / 4 + 0];
452
- var r1 = getInt32Memory0()[retptr / 4 + 1];
453
- var r2 = getInt32Memory0()[retptr / 4 + 2];
454
- if (r2) {
455
- throw takeObject(r1);
456
- }
457
- return takeObject(r0);
458
- } finally {
459
- wasm.__wbindgen_add_to_stack_pointer(16);
460
- }
461
- };
462
-
463
- /**
464
- * Sets the package's logging level.
465
- *
466
- * @param {LogLevel} level - The maximum level of logging to be emitted.
467
- */
468
- module.exports.initLogLevel = function(filter) {
469
- try {
470
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
471
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
472
- const len0 = WASM_VECTOR_LEN;
473
- wasm.initLogLevel(retptr, ptr0, len0);
474
- var r0 = getInt32Memory0()[retptr / 4 + 0];
475
- var r1 = getInt32Memory0()[retptr / 4 + 1];
476
- if (r1) {
477
- throw takeObject(r0);
478
- }
479
- } finally {
480
- wasm.__wbindgen_add_to_stack_pointer(16);
481
- }
482
- };
483
-
484
400
  /**
485
401
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
486
402
  *
@@ -663,6 +579,90 @@ module.exports.executeProgramWithBlackBoxSolver = function(solver, program, init
663
579
  return takeObject(ret);
664
580
  };
665
581
 
582
+ /**
583
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
584
+ *
585
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
586
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
587
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
588
+ * @param {Uint8Array} program
589
+ * @param {WitnessMap} witness_map
590
+ * @returns {WitnessMap}
591
+ */
592
+ module.exports.getReturnWitness = function(program, witness_map) {
593
+ try {
594
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
595
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
596
+ const len0 = WASM_VECTOR_LEN;
597
+ wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
598
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
599
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
600
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
601
+ if (r2) {
602
+ throw takeObject(r1);
603
+ }
604
+ return takeObject(r0);
605
+ } finally {
606
+ wasm.__wbindgen_add_to_stack_pointer(16);
607
+ }
608
+ };
609
+
610
+ /**
611
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
612
+ *
613
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
614
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
615
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
616
+ * @param {Uint8Array} program
617
+ * @param {WitnessMap} solved_witness
618
+ * @returns {WitnessMap}
619
+ */
620
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
621
+ try {
622
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
623
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
624
+ const len0 = WASM_VECTOR_LEN;
625
+ wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
626
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
627
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
628
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
629
+ if (r2) {
630
+ throw takeObject(r1);
631
+ }
632
+ return takeObject(r0);
633
+ } finally {
634
+ wasm.__wbindgen_add_to_stack_pointer(16);
635
+ }
636
+ };
637
+
638
+ /**
639
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
640
+ *
641
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
642
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
643
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
644
+ * @param {Uint8Array} program
645
+ * @param {WitnessMap} solved_witness
646
+ * @returns {WitnessMap}
647
+ */
648
+ module.exports.getPublicWitness = function(program, solved_witness) {
649
+ try {
650
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
651
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
652
+ const len0 = WASM_VECTOR_LEN;
653
+ wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
654
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
655
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
656
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
657
+ if (r2) {
658
+ throw takeObject(r1);
659
+ }
660
+ return takeObject(r0);
661
+ } finally {
662
+ wasm.__wbindgen_add_to_stack_pointer(16);
663
+ }
664
+ };
665
+
666
666
  function handleError(f, args) {
667
667
  try {
668
668
  return f.apply(this, args);
@@ -733,23 +733,6 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
733
733
  takeObject(arg0);
734
734
  };
735
735
 
736
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
737
- const obj = getObject(arg1);
738
- const ret = typeof(obj) === 'number' ? obj : undefined;
739
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
740
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
741
- };
742
-
743
- module.exports.__wbindgen_string_new = function(arg0, arg1) {
744
- const ret = getStringFromWasm0(arg0, arg1);
745
- return addHeapObject(ret);
746
- };
747
-
748
- module.exports.__wbindgen_is_undefined = function(arg0) {
749
- const ret = getObject(arg0) === undefined;
750
- return ret;
751
- };
752
-
753
736
  module.exports.__wbindgen_error_new = function(arg0, arg1) {
754
737
  const ret = new Error(getStringFromWasm0(arg0, arg1));
755
738
  return addHeapObject(ret);
@@ -760,12 +743,7 @@ module.exports.__wbindgen_object_clone_ref = function(arg0) {
760
743
  return addHeapObject(ret);
761
744
  };
762
745
 
763
- module.exports.__wbg_constructor_3c870f698332d32a = function(arg0) {
764
- const ret = new Error(takeObject(arg0));
765
- return addHeapObject(ret);
766
- };
767
-
768
- module.exports.__wbg_new_500c474da81d0c8a = function() {
746
+ module.exports.__wbg_new_6f6c75f9324b78e8 = function() {
769
747
  const ret = new Map();
770
748
  return addHeapObject(ret);
771
749
  };
@@ -775,6 +753,11 @@ module.exports.__wbindgen_number_new = function(arg0) {
775
753
  return addHeapObject(ret);
776
754
  };
777
755
 
756
+ module.exports.__wbindgen_string_new = function(arg0, arg1) {
757
+ const ret = getStringFromWasm0(arg0, arg1);
758
+ return addHeapObject(ret);
759
+ };
760
+
778
761
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
779
762
  const obj = getObject(arg1);
780
763
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -789,6 +772,11 @@ module.exports.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
789
772
  return addHeapObject(ret);
790
773
  };
791
774
 
775
+ module.exports.__wbg_constructor_81b34c49dcbdd2af = function(arg0) {
776
+ const ret = new Error(takeObject(arg0));
777
+ return addHeapObject(ret);
778
+ };
779
+
792
780
  module.exports.__wbindgen_cb_drop = function(arg0) {
793
781
  const obj = takeObject(arg0).original;
794
782
  if (obj.cnt-- == 1) {
@@ -799,9 +787,16 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
799
787
  return ret;
800
788
  };
801
789
 
802
- module.exports.__wbg_new_575b760e13535a20 = function() {
803
- const ret = new Array();
804
- return addHeapObject(ret);
790
+ module.exports.__wbindgen_is_undefined = function(arg0) {
791
+ const ret = getObject(arg0) === undefined;
792
+ return ret;
793
+ };
794
+
795
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
796
+ const obj = getObject(arg1);
797
+ const ret = typeof(obj) === 'number' ? obj : undefined;
798
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
799
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
805
800
  };
806
801
 
807
802
  module.exports.__wbindgen_is_array = function(arg0) {
@@ -814,6 +809,11 @@ module.exports.__wbindgen_is_string = function(arg0) {
814
809
  return ret;
815
810
  };
816
811
 
812
+ module.exports.__wbg_new_ee5ac63ff3b0fa4d = function() {
813
+ const ret = new Array();
814
+ return addHeapObject(ret);
815
+ };
816
+
817
817
  module.exports.__wbg_new_abda76e883ba8a5f = function() {
818
818
  const ret = new Error();
819
819
  return addHeapObject(ret);
@@ -1365,8 +1365,8 @@ module.exports.__wbindgen_function_table = function() {
1365
1365
  return addHeapObject(ret);
1366
1366
  };
1367
1367
 
1368
- module.exports.__wbindgen_closure_wrapper2097 = function(arg0, arg1, arg2) {
1369
- const ret = makeMutClosure(arg0, arg1, 698, __wbg_adapter_52);
1368
+ module.exports.__wbindgen_closure_wrapper2147 = function(arg0, arg1, arg2) {
1369
+ const ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_52);
1370
1370
  return addHeapObject(ret);
1371
1371
  };
1372
1372
 
Binary file
@@ -1,6 +1,8 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export function initLogLevel(a: number, b: number, c: number): void;
5
+ export function buildInfo(): number;
4
6
  export function and(a: number, b: number): number;
5
7
  export function xor(a: number, b: number): number;
6
8
  export function sha256(a: number, b: number, c: number): void;
@@ -8,11 +10,6 @@ export function blake2s256(a: number, b: number, c: number): void;
8
10
  export function keccak256(a: number, b: number, c: number): void;
9
11
  export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
10
12
  export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
11
- export function buildInfo(): number;
12
- export function getReturnWitness(a: number, b: number, c: number, d: number): void;
13
- export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
14
- export function getPublicWitness(a: number, b: number, c: number, d: number): void;
15
- export function initLogLevel(a: number, b: number, c: number): void;
16
13
  export function compressWitness(a: number, b: number): void;
17
14
  export function decompressWitness(a: number, b: number, c: number): void;
18
15
  export function compressWitnessStack(a: number, b: number): void;
@@ -24,6 +21,9 @@ export function executeCircuitWithReturnWitness(a: number, b: number, c: number,
24
21
  export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
25
22
  export function executeProgram(a: number, b: number, c: number, d: number): number;
26
23
  export function executeProgramWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
24
+ export function getReturnWitness(a: number, b: number, c: number, d: number): void;
25
+ export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
26
+ export function getPublicWitness(a: number, b: number, c: number, d: number): void;
27
27
  export function __wbg_trap_free(a: number): void;
28
28
  export function trap___wbg_wasmer_trap(): void;
29
29
  export function __wbindgen_malloc(a: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noir-lang/acvm_js",
3
- "version": "0.45.0",
3
+ "version": "0.46.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/web/acvm_js.d.ts CHANGED
@@ -1,6 +1,17 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
+ * Sets the package's logging level.
5
+ *
6
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
7
+ */
8
+ export function initLogLevel(filter: string): void;
9
+ /**
10
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
11
+ * @returns {BuildInfo} - Information on how the installed package was built.
12
+ */
13
+ export function buildInfo(): BuildInfo;
14
+ /**
4
15
  * Performs a bitwise AND operation between `lhs` and `rhs`
5
16
  * @param {string} lhs
6
17
  * @param {string} rhs
@@ -51,50 +62,6 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
51
62
  */
52
63
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
53
64
  /**
54
- * Returns the `BuildInfo` object containing information about how the installed package was built.
55
- * @returns {BuildInfo} - Information on how the installed package was built.
56
- */
57
- export function buildInfo(): BuildInfo;
58
- /**
59
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
60
- *
61
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
62
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
63
- * @returns {WitnessMap} A witness map containing the circuit's return values.
64
- * @param {Uint8Array} program
65
- * @param {WitnessMap} witness_map
66
- * @returns {WitnessMap}
67
- */
68
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
69
- /**
70
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
71
- *
72
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
73
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
74
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
75
- * @param {Uint8Array} program
76
- * @param {WitnessMap} solved_witness
77
- * @returns {WitnessMap}
78
- */
79
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
80
- /**
81
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
82
- *
83
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
84
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
85
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
86
- * @param {Uint8Array} program
87
- * @param {WitnessMap} solved_witness
88
- * @returns {WitnessMap}
89
- */
90
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
91
- /**
92
- * Sets the package's logging level.
93
- *
94
- * @param {LogLevel} level - The maximum level of logging to be emitted.
95
- */
96
- export function initLogLevel(filter: string): void;
97
- /**
98
65
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
99
66
  *
100
67
  * @param {WitnessMap} witness_map - A witness map.
@@ -163,12 +130,39 @@ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap,
163
130
  /**
164
131
  */
165
132
  export function executeProgramWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_executor: ForeignCallHandler): Promise<WitnessStack>;
166
-
167
- export type ExecutionError = Error & {
168
- callStack?: string[];
169
- };
170
-
171
-
133
+ /**
134
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
135
+ *
136
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
137
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
138
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
139
+ * @param {Uint8Array} program
140
+ * @param {WitnessMap} witness_map
141
+ * @returns {WitnessMap}
142
+ */
143
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
144
+ /**
145
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
146
+ *
147
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
148
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
149
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
150
+ * @param {Uint8Array} program
151
+ * @param {WitnessMap} solved_witness
152
+ * @returns {WitnessMap}
153
+ */
154
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
155
+ /**
156
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
157
+ *
158
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
159
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
160
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
161
+ * @param {Uint8Array} program
162
+ * @param {WitnessMap} solved_witness
163
+ * @returns {WitnessMap}
164
+ */
165
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
172
166
 
173
167
  // Map from witness index to hex string value of witness.
174
168
  export type WitnessMap = Map<number, string>;
@@ -213,6 +207,17 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
213
207
 
214
208
 
215
209
 
210
+ export type RawAssertionPayload = {
211
+ selector: string;
212
+ data: string[];
213
+ };
214
+ export type ExecutionError = Error & {
215
+ callStack?: string[];
216
+ rawAssertionPayload?: RawAssertionPayload;
217
+ };
218
+
219
+
220
+
216
221
  export type StackItem = {
217
222
  index: number;
218
223
  witness: WitnessMap;
@@ -231,6 +236,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
231
236
 
232
237
  export interface InitOutput {
233
238
  readonly memory: WebAssembly.Memory;
239
+ readonly initLogLevel: (a: number, b: number, c: number) => void;
240
+ readonly buildInfo: () => number;
234
241
  readonly and: (a: number, b: number) => number;
235
242
  readonly xor: (a: number, b: number) => number;
236
243
  readonly sha256: (a: number, b: number, c: number) => void;
@@ -238,11 +245,6 @@ export interface InitOutput {
238
245
  readonly keccak256: (a: number, b: number, c: number) => void;
239
246
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
240
247
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
241
- readonly buildInfo: () => number;
242
- readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
243
- readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
244
- readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
245
- readonly initLogLevel: (a: number, b: number, c: number) => void;
246
248
  readonly compressWitness: (a: number, b: number) => void;
247
249
  readonly decompressWitness: (a: number, b: number, c: number) => void;
248
250
  readonly compressWitnessStack: (a: number, b: number) => void;
@@ -254,6 +256,9 @@ export interface InitOutput {
254
256
  readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
255
257
  readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
256
258
  readonly executeProgramWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
259
+ readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
260
+ readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
261
+ readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
257
262
  readonly __wbg_trap_free: (a: number) => void;
258
263
  readonly trap___wbg_wasmer_trap: () => void;
259
264
  readonly __wbindgen_malloc: (a: number) => number;
package/web/acvm_js.js CHANGED
@@ -20,28 +20,6 @@ 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
23
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
46
24
 
47
25
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -124,6 +102,28 @@ function passStringToWasm0(arg, malloc, realloc) {
124
102
  return ptr;
125
103
  }
126
104
 
105
+ function isLikeNone(x) {
106
+ return x === undefined || x === null;
107
+ }
108
+
109
+ let cachedInt32Memory0 = null;
110
+
111
+ function getInt32Memory0() {
112
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
113
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
114
+ }
115
+ return cachedInt32Memory0;
116
+ }
117
+
118
+ let cachedFloat64Memory0 = null;
119
+
120
+ function getFloat64Memory0() {
121
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
122
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
123
+ }
124
+ return cachedFloat64Memory0;
125
+ }
126
+
127
127
  let cachedBigInt64Memory0 = null;
128
128
 
129
129
  function getBigInt64Memory0() {
@@ -226,6 +226,36 @@ function __wbg_adapter_52(arg0, arg1, arg2) {
226
226
  wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hc5258430255de068(arg0, arg1, addHeapObject(arg2));
227
227
  }
228
228
 
229
+ /**
230
+ * Sets the package's logging level.
231
+ *
232
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
233
+ */
234
+ export function initLogLevel(filter) {
235
+ try {
236
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
237
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
238
+ const len0 = WASM_VECTOR_LEN;
239
+ wasm.initLogLevel(retptr, ptr0, len0);
240
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
241
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
242
+ if (r1) {
243
+ throw takeObject(r0);
244
+ }
245
+ } finally {
246
+ wasm.__wbindgen_add_to_stack_pointer(16);
247
+ }
248
+ }
249
+
250
+ /**
251
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
252
+ * @returns {BuildInfo} - Information on how the installed package was built.
253
+ */
254
+ export function buildInfo() {
255
+ const ret = wasm.buildInfo();
256
+ return takeObject(ret);
257
+ }
258
+
229
259
  /**
230
260
  * Performs a bitwise AND operation between `lhs` and `rhs`
231
261
  * @param {string} lhs
@@ -364,120 +394,6 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
364
394
  return ret !== 0;
365
395
  }
366
396
 
367
- /**
368
- * Returns the `BuildInfo` object containing information about how the installed package was built.
369
- * @returns {BuildInfo} - Information on how the installed package was built.
370
- */
371
- export function buildInfo() {
372
- const ret = wasm.buildInfo();
373
- return takeObject(ret);
374
- }
375
-
376
- /**
377
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
378
- *
379
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
380
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
381
- * @returns {WitnessMap} A witness map containing the circuit's return values.
382
- * @param {Uint8Array} program
383
- * @param {WitnessMap} witness_map
384
- * @returns {WitnessMap}
385
- */
386
- export function getReturnWitness(program, witness_map) {
387
- try {
388
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
389
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
390
- const len0 = WASM_VECTOR_LEN;
391
- wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
392
- var r0 = getInt32Memory0()[retptr / 4 + 0];
393
- var r1 = getInt32Memory0()[retptr / 4 + 1];
394
- var r2 = getInt32Memory0()[retptr / 4 + 2];
395
- if (r2) {
396
- throw takeObject(r1);
397
- }
398
- return takeObject(r0);
399
- } finally {
400
- wasm.__wbindgen_add_to_stack_pointer(16);
401
- }
402
- }
403
-
404
- /**
405
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
406
- *
407
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
408
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
409
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
410
- * @param {Uint8Array} program
411
- * @param {WitnessMap} solved_witness
412
- * @returns {WitnessMap}
413
- */
414
- export function getPublicParametersWitness(program, solved_witness) {
415
- try {
416
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
417
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
418
- const len0 = WASM_VECTOR_LEN;
419
- wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
420
- var r0 = getInt32Memory0()[retptr / 4 + 0];
421
- var r1 = getInt32Memory0()[retptr / 4 + 1];
422
- var r2 = getInt32Memory0()[retptr / 4 + 2];
423
- if (r2) {
424
- throw takeObject(r1);
425
- }
426
- return takeObject(r0);
427
- } finally {
428
- wasm.__wbindgen_add_to_stack_pointer(16);
429
- }
430
- }
431
-
432
- /**
433
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
434
- *
435
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
436
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
437
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
438
- * @param {Uint8Array} program
439
- * @param {WitnessMap} solved_witness
440
- * @returns {WitnessMap}
441
- */
442
- export function getPublicWitness(program, solved_witness) {
443
- try {
444
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
445
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
446
- const len0 = WASM_VECTOR_LEN;
447
- wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
448
- var r0 = getInt32Memory0()[retptr / 4 + 0];
449
- var r1 = getInt32Memory0()[retptr / 4 + 1];
450
- var r2 = getInt32Memory0()[retptr / 4 + 2];
451
- if (r2) {
452
- throw takeObject(r1);
453
- }
454
- return takeObject(r0);
455
- } finally {
456
- wasm.__wbindgen_add_to_stack_pointer(16);
457
- }
458
- }
459
-
460
- /**
461
- * Sets the package's logging level.
462
- *
463
- * @param {LogLevel} level - The maximum level of logging to be emitted.
464
- */
465
- export function initLogLevel(filter) {
466
- try {
467
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
468
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
469
- const len0 = WASM_VECTOR_LEN;
470
- wasm.initLogLevel(retptr, ptr0, len0);
471
- var r0 = getInt32Memory0()[retptr / 4 + 0];
472
- var r1 = getInt32Memory0()[retptr / 4 + 1];
473
- if (r1) {
474
- throw takeObject(r0);
475
- }
476
- } finally {
477
- wasm.__wbindgen_add_to_stack_pointer(16);
478
- }
479
- }
480
-
481
397
  /**
482
398
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
483
399
  *
@@ -660,6 +576,90 @@ export function executeProgramWithBlackBoxSolver(solver, program, initial_witnes
660
576
  return takeObject(ret);
661
577
  }
662
578
 
579
+ /**
580
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
581
+ *
582
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
583
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
584
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
585
+ * @param {Uint8Array} program
586
+ * @param {WitnessMap} witness_map
587
+ * @returns {WitnessMap}
588
+ */
589
+ export function getReturnWitness(program, witness_map) {
590
+ try {
591
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
592
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
593
+ const len0 = WASM_VECTOR_LEN;
594
+ wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
595
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
596
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
597
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
598
+ if (r2) {
599
+ throw takeObject(r1);
600
+ }
601
+ return takeObject(r0);
602
+ } finally {
603
+ wasm.__wbindgen_add_to_stack_pointer(16);
604
+ }
605
+ }
606
+
607
+ /**
608
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
609
+ *
610
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
611
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
612
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
613
+ * @param {Uint8Array} program
614
+ * @param {WitnessMap} solved_witness
615
+ * @returns {WitnessMap}
616
+ */
617
+ export function getPublicParametersWitness(program, solved_witness) {
618
+ try {
619
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
620
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
621
+ const len0 = WASM_VECTOR_LEN;
622
+ wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
623
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
624
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
625
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
626
+ if (r2) {
627
+ throw takeObject(r1);
628
+ }
629
+ return takeObject(r0);
630
+ } finally {
631
+ wasm.__wbindgen_add_to_stack_pointer(16);
632
+ }
633
+ }
634
+
635
+ /**
636
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
637
+ *
638
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
639
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
640
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
641
+ * @param {Uint8Array} program
642
+ * @param {WitnessMap} solved_witness
643
+ * @returns {WitnessMap}
644
+ */
645
+ export function getPublicWitness(program, solved_witness) {
646
+ try {
647
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
648
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
649
+ const len0 = WASM_VECTOR_LEN;
650
+ wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
651
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
652
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
653
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
654
+ if (r2) {
655
+ throw takeObject(r1);
656
+ }
657
+ return takeObject(r0);
658
+ } finally {
659
+ wasm.__wbindgen_add_to_stack_pointer(16);
660
+ }
661
+ }
662
+
663
663
  function handleError(f, args) {
664
664
  try {
665
665
  return f.apply(this, args);
@@ -761,20 +761,6 @@ function __wbg_get_imports() {
761
761
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
762
762
  takeObject(arg0);
763
763
  };
764
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
765
- const obj = getObject(arg1);
766
- const ret = typeof(obj) === 'number' ? obj : undefined;
767
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
768
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
769
- };
770
- imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
771
- const ret = getStringFromWasm0(arg0, arg1);
772
- return addHeapObject(ret);
773
- };
774
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
775
- const ret = getObject(arg0) === undefined;
776
- return ret;
777
- };
778
764
  imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
779
765
  const ret = new Error(getStringFromWasm0(arg0, arg1));
780
766
  return addHeapObject(ret);
@@ -783,11 +769,7 @@ function __wbg_get_imports() {
783
769
  const ret = getObject(arg0);
784
770
  return addHeapObject(ret);
785
771
  };
786
- imports.wbg.__wbg_constructor_3c870f698332d32a = function(arg0) {
787
- const ret = new Error(takeObject(arg0));
788
- return addHeapObject(ret);
789
- };
790
- imports.wbg.__wbg_new_500c474da81d0c8a = function() {
772
+ imports.wbg.__wbg_new_6f6c75f9324b78e8 = function() {
791
773
  const ret = new Map();
792
774
  return addHeapObject(ret);
793
775
  };
@@ -795,6 +777,10 @@ function __wbg_get_imports() {
795
777
  const ret = arg0;
796
778
  return addHeapObject(ret);
797
779
  };
780
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
781
+ const ret = getStringFromWasm0(arg0, arg1);
782
+ return addHeapObject(ret);
783
+ };
798
784
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
799
785
  const obj = getObject(arg1);
800
786
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -807,6 +793,10 @@ function __wbg_get_imports() {
807
793
  const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
808
794
  return addHeapObject(ret);
809
795
  };
796
+ imports.wbg.__wbg_constructor_81b34c49dcbdd2af = function(arg0) {
797
+ const ret = new Error(takeObject(arg0));
798
+ return addHeapObject(ret);
799
+ };
810
800
  imports.wbg.__wbindgen_cb_drop = function(arg0) {
811
801
  const obj = takeObject(arg0).original;
812
802
  if (obj.cnt-- == 1) {
@@ -816,9 +806,15 @@ function __wbg_get_imports() {
816
806
  const ret = false;
817
807
  return ret;
818
808
  };
819
- imports.wbg.__wbg_new_575b760e13535a20 = function() {
820
- const ret = new Array();
821
- return addHeapObject(ret);
809
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
810
+ const ret = getObject(arg0) === undefined;
811
+ return ret;
812
+ };
813
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
814
+ const obj = getObject(arg1);
815
+ const ret = typeof(obj) === 'number' ? obj : undefined;
816
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
817
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
822
818
  };
823
819
  imports.wbg.__wbindgen_is_array = function(arg0) {
824
820
  const ret = Array.isArray(getObject(arg0));
@@ -828,6 +824,10 @@ function __wbg_get_imports() {
828
824
  const ret = typeof(getObject(arg0)) === 'string';
829
825
  return ret;
830
826
  };
827
+ imports.wbg.__wbg_new_ee5ac63ff3b0fa4d = function() {
828
+ const ret = new Array();
829
+ return addHeapObject(ret);
830
+ };
831
831
  imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
832
832
  const ret = new Error();
833
833
  return addHeapObject(ret);
@@ -1285,8 +1285,8 @@ function __wbg_get_imports() {
1285
1285
  const ret = wasm.__wbindgen_export_2;
1286
1286
  return addHeapObject(ret);
1287
1287
  };
1288
- imports.wbg.__wbindgen_closure_wrapper2097 = function(arg0, arg1, arg2) {
1289
- const ret = makeMutClosure(arg0, arg1, 698, __wbg_adapter_52);
1288
+ imports.wbg.__wbindgen_closure_wrapper2147 = function(arg0, arg1, arg2) {
1289
+ const ret = makeMutClosure(arg0, arg1, 720, __wbg_adapter_52);
1290
1290
  return addHeapObject(ret);
1291
1291
  };
1292
1292
 
Binary file
@@ -1,6 +1,8 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export function initLogLevel(a: number, b: number, c: number): void;
5
+ export function buildInfo(): number;
4
6
  export function and(a: number, b: number): number;
5
7
  export function xor(a: number, b: number): number;
6
8
  export function sha256(a: number, b: number, c: number): void;
@@ -8,11 +10,6 @@ export function blake2s256(a: number, b: number, c: number): void;
8
10
  export function keccak256(a: number, b: number, c: number): void;
9
11
  export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
10
12
  export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
11
- export function buildInfo(): number;
12
- export function getReturnWitness(a: number, b: number, c: number, d: number): void;
13
- export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
14
- export function getPublicWitness(a: number, b: number, c: number, d: number): void;
15
- export function initLogLevel(a: number, b: number, c: number): void;
16
13
  export function compressWitness(a: number, b: number): void;
17
14
  export function decompressWitness(a: number, b: number, c: number): void;
18
15
  export function compressWitnessStack(a: number, b: number): void;
@@ -24,6 +21,9 @@ export function executeCircuitWithReturnWitness(a: number, b: number, c: number,
24
21
  export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
25
22
  export function executeProgram(a: number, b: number, c: number, d: number): number;
26
23
  export function executeProgramWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
24
+ export function getReturnWitness(a: number, b: number, c: number, d: number): void;
25
+ export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
26
+ export function getPublicWitness(a: number, b: number, c: number, d: number): void;
27
27
  export function __wbg_trap_free(a: number): void;
28
28
  export function trap___wbg_wasmer_trap(): void;
29
29
  export function __wbindgen_malloc(a: number): number;