@noir-lang/acvm_js 0.28.0 → 0.29.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,29 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
5
- *
6
- * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
7
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
8
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
9
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
10
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
11
- */
12
- export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
13
- /**
14
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
15
- *
16
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
17
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
18
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
19
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
20
- */
21
- export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
22
- /**
23
- * @returns {Promise<WasmBlackBoxFunctionSolver>}
24
- */
25
- export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
26
- /**
27
4
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
28
5
  *
29
6
  * @param {Uint8Array} compressed_witness - A compressed witness.
@@ -38,6 +15,11 @@ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
38
15
  */
39
16
  export function compressWitness(witness_map: WitnessMap): Uint8Array;
40
17
  /**
18
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
19
+ * @returns {BuildInfo} - Information on how the installed package was built.
20
+ */
21
+ export function buildInfo(): BuildInfo;
22
+ /**
41
23
  * Verifies a ECDSA signature over the secp256r1 curve.
42
24
  * @param {Uint8Array} hashed_msg
43
25
  * @param {Uint8Array} public_key_x_bytes
@@ -89,10 +71,28 @@ export function xor(lhs: string, rhs: string): string;
89
71
  */
90
72
  export function and(lhs: string, rhs: string): string;
91
73
  /**
92
- * Returns the `BuildInfo` object containing information about how the installed package was built.
93
- * @returns {BuildInfo} - Information on how the installed package was built.
74
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
75
+ *
76
+ * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
77
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
78
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
79
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
80
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
94
81
  */
95
- export function buildInfo(): BuildInfo;
82
+ export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
83
+ /**
84
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
85
+ *
86
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
87
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
88
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
89
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
90
+ */
91
+ export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
92
+ /**
93
+ * @returns {Promise<WasmBlackBoxFunctionSolver>}
94
+ */
95
+ export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
96
96
  /**
97
97
  * Sets the package's logging level.
98
98
  *
@@ -161,16 +161,16 @@ export type BuildInfo = {
161
161
 
162
162
 
163
163
 
164
- export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
165
-
166
-
167
-
168
164
  export type ExecutionError = Error & {
169
165
  callStack?: string[];
170
166
  };
171
167
 
172
168
 
173
169
 
170
+ export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
171
+
172
+
173
+
174
174
  // Map from witness index to hex string value of witness.
175
175
  export type WitnessMap = Map<number, string>;
176
176
 
package/nodejs/acvm_js.js CHANGED
@@ -3,28 +3,12 @@ imports['__wbindgen_placeholder__'] = module.exports;
3
3
  let wasm;
4
4
  const { TextDecoder, TextEncoder } = require(`util`);
5
5
 
6
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
7
-
8
- cachedTextDecoder.decode();
9
-
10
- let cachedUint8Memory0 = null;
11
-
12
- function getUint8Memory0() {
13
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
14
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
15
- }
16
- return cachedUint8Memory0;
17
- }
18
-
19
- function getStringFromWasm0(ptr, len) {
20
- ptr = ptr >>> 0;
21
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
22
- }
23
-
24
6
  const heap = new Array(128).fill(undefined);
25
7
 
26
8
  heap.push(undefined, null, true, false);
27
9
 
10
+ function getObject(idx) { return heap[idx]; }
11
+
28
12
  let heap_next = heap.length;
29
13
 
30
14
  function addHeapObject(obj) {
@@ -36,8 +20,6 @@ function addHeapObject(obj) {
36
20
  return idx;
37
21
  }
38
22
 
39
- function getObject(idx) { return heap[idx]; }
40
-
41
23
  function dropObject(idx) {
42
24
  if (idx < 132) return;
43
25
  heap[idx] = heap_next;
@@ -50,6 +32,24 @@ function takeObject(idx) {
50
32
  return ret;
51
33
  }
52
34
 
35
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
36
+
37
+ cachedTextDecoder.decode();
38
+
39
+ let cachedUint8Memory0 = null;
40
+
41
+ function getUint8Memory0() {
42
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
43
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
44
+ }
45
+ return cachedUint8Memory0;
46
+ }
47
+
48
+ function getStringFromWasm0(ptr, len) {
49
+ ptr = ptr >>> 0;
50
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
51
+ }
52
+
53
53
  function isLikeNone(x) {
54
54
  return x === undefined || x === null;
55
55
  }
@@ -226,14 +226,7 @@ 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__h1dfec0dba43a4c9e(arg0, arg1, addHeapObject(arg2));
230
- }
231
-
232
- function _assertClass(instance, klass) {
233
- if (!(instance instanceof klass)) {
234
- throw new Error(`expected instance of ${klass.name}`);
235
- }
236
- return instance.ptr;
229
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb1f60a5b015b6c5(arg0, arg1, addHeapObject(arg2));
237
230
  }
238
231
 
239
232
  function passArray8ToWasm0(arg, malloc) {
@@ -242,46 +235,6 @@ function passArray8ToWasm0(arg, malloc) {
242
235
  WASM_VECTOR_LEN = arg.length;
243
236
  return ptr;
244
237
  }
245
- /**
246
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
247
- *
248
- * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
249
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
250
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
251
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
252
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
253
- */
254
- module.exports.executeCircuitWithBlackBoxSolver = function(solver, circuit, initial_witness, foreign_call_handler) {
255
- _assertClass(solver, WasmBlackBoxFunctionSolver);
256
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
257
- const len0 = WASM_VECTOR_LEN;
258
- const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
259
- return takeObject(ret);
260
- };
261
-
262
- /**
263
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
264
- *
265
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
266
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
267
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
268
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
269
- */
270
- module.exports.executeCircuit = function(circuit, initial_witness, foreign_call_handler) {
271
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
272
- const len0 = WASM_VECTOR_LEN;
273
- const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
274
- return takeObject(ret);
275
- };
276
-
277
- /**
278
- * @returns {Promise<WasmBlackBoxFunctionSolver>}
279
- */
280
- module.exports.createBlackBoxSolver = function() {
281
- const ret = wasm.createBlackBoxSolver();
282
- return takeObject(ret);
283
- };
284
-
285
238
  /**
286
239
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
287
240
  *
@@ -335,6 +288,15 @@ module.exports.compressWitness = function(witness_map) {
335
288
  }
336
289
  };
337
290
 
291
+ /**
292
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
293
+ * @returns {BuildInfo} - Information on how the installed package was built.
294
+ */
295
+ module.exports.buildInfo = function() {
296
+ const ret = wasm.buildInfo();
297
+ return takeObject(ret);
298
+ };
299
+
338
300
  /**
339
301
  * Verifies a ECDSA signature over the secp256r1 curve.
340
302
  * @param {Uint8Array} hashed_msg
@@ -463,12 +425,49 @@ module.exports.and = function(lhs, rhs) {
463
425
  return takeObject(ret);
464
426
  };
465
427
 
428
+ function _assertClass(instance, klass) {
429
+ if (!(instance instanceof klass)) {
430
+ throw new Error(`expected instance of ${klass.name}`);
431
+ }
432
+ return instance.ptr;
433
+ }
466
434
  /**
467
- * Returns the `BuildInfo` object containing information about how the installed package was built.
468
- * @returns {BuildInfo} - Information on how the installed package was built.
435
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
436
+ *
437
+ * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
438
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
439
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
440
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
441
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
469
442
  */
470
- module.exports.buildInfo = function() {
471
- const ret = wasm.buildInfo();
443
+ module.exports.executeCircuitWithBlackBoxSolver = function(solver, circuit, initial_witness, foreign_call_handler) {
444
+ _assertClass(solver, WasmBlackBoxFunctionSolver);
445
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
446
+ const len0 = WASM_VECTOR_LEN;
447
+ const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
448
+ return takeObject(ret);
449
+ };
450
+
451
+ /**
452
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
453
+ *
454
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
455
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
456
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
457
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
458
+ */
459
+ module.exports.executeCircuit = function(circuit, initial_witness, foreign_call_handler) {
460
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
461
+ const len0 = WASM_VECTOR_LEN;
462
+ const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
463
+ return takeObject(ret);
464
+ };
465
+
466
+ /**
467
+ * @returns {Promise<WasmBlackBoxFunctionSolver>}
468
+ */
469
+ module.exports.createBlackBoxSolver = function() {
470
+ const ret = wasm.createBlackBoxSolver();
472
471
  return takeObject(ret);
473
472
  };
474
473
 
@@ -573,7 +572,7 @@ function handleError(f, args) {
573
572
  }
574
573
  }
575
574
  function __wbg_adapter_155(arg0, arg1, arg2, arg3) {
576
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h43234701b229d587(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
575
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h72933b4dbc34aade(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
577
576
  }
578
577
 
579
578
  /**
@@ -627,11 +626,6 @@ class WasmBlackBoxFunctionSolver {
627
626
  }
628
627
  module.exports.WasmBlackBoxFunctionSolver = WasmBlackBoxFunctionSolver;
629
628
 
630
- module.exports.__wbindgen_error_new = function(arg0, arg1) {
631
- const ret = new Error(getStringFromWasm0(arg0, arg1));
632
- return addHeapObject(ret);
633
- };
634
-
635
629
  module.exports.__wbindgen_object_clone_ref = function(arg0) {
636
630
  const ret = getObject(arg0);
637
631
  return addHeapObject(ret);
@@ -641,6 +635,21 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
641
635
  takeObject(arg0);
642
636
  };
643
637
 
638
+ module.exports.__wbindgen_error_new = function(arg0, arg1) {
639
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
640
+ return addHeapObject(ret);
641
+ };
642
+
643
+ module.exports.__wbindgen_is_string = function(arg0) {
644
+ const ret = typeof(getObject(arg0)) === 'string';
645
+ return ret;
646
+ };
647
+
648
+ module.exports.__wbindgen_is_array = function(arg0) {
649
+ const ret = Array.isArray(getObject(arg0));
650
+ return ret;
651
+ };
652
+
644
653
  module.exports.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
645
654
  const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
646
655
  return addHeapObject(ret);
@@ -663,9 +672,9 @@ module.exports.__wbindgen_number_get = function(arg0, arg1) {
663
672
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
664
673
  };
665
674
 
666
- module.exports.__wbindgen_is_array = function(arg0) {
667
- const ret = Array.isArray(getObject(arg0));
668
- return ret;
675
+ module.exports.__wbg_constructor_cdd6dc055ac30922 = function(arg0) {
676
+ const ret = new Error(takeObject(arg0));
677
+ return addHeapObject(ret);
669
678
  };
670
679
 
671
680
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
@@ -677,11 +686,6 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
677
686
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
678
687
  };
679
688
 
680
- module.exports.__wbg_constructor_bd5b3ba6619fce81 = function(arg0) {
681
- const ret = new Error(takeObject(arg0));
682
- return addHeapObject(ret);
683
- };
684
-
685
689
  module.exports.__wbindgen_cb_drop = function(arg0) {
686
690
  const obj = takeObject(arg0).original;
687
691
  if (obj.cnt-- == 1) {
@@ -692,7 +696,7 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
692
696
  return ret;
693
697
  };
694
698
 
695
- module.exports.__wbg_new_d6cb182577c81490 = function() {
699
+ module.exports.__wbg_new_df67af045c277099 = function() {
696
700
  const ret = new Map();
697
701
  return addHeapObject(ret);
698
702
  };
@@ -702,11 +706,6 @@ module.exports.__wbindgen_number_new = function(arg0) {
702
706
  return addHeapObject(ret);
703
707
  };
704
708
 
705
- module.exports.__wbindgen_is_string = function(arg0) {
706
- const ret = typeof(getObject(arg0)) === 'string';
707
- return ret;
708
- };
709
-
710
709
  module.exports.__wbg_new_abda76e883ba8a5f = function() {
711
710
  const ret = new Error();
712
711
  return addHeapObject(ret);
@@ -737,9 +736,9 @@ module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
737
736
  return addHeapObject(ret);
738
737
  };
739
738
 
740
- module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
741
- const ret = getObject(arg0) === getObject(arg1);
742
- return ret;
739
+ module.exports.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
740
+ const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
741
+ return addHeapObject(ret);
743
742
  };
744
743
 
745
744
  module.exports.__wbindgen_ge = function(arg0, arg1) {
@@ -752,6 +751,11 @@ module.exports.__wbindgen_is_bigint = function(arg0) {
752
751
  return ret;
753
752
  };
754
753
 
754
+ module.exports.__wbindgen_jsval_eq = function(arg0, arg1) {
755
+ const ret = getObject(arg0) === getObject(arg1);
756
+ return ret;
757
+ };
758
+
755
759
  module.exports.__wbindgen_bigint_from_u64 = function(arg0) {
756
760
  const ret = BigInt.asUintN(64, arg0);
757
761
  return addHeapObject(ret);
@@ -762,11 +766,6 @@ module.exports.__wbindgen_shr = function(arg0, arg1) {
762
766
  return addHeapObject(ret);
763
767
  };
764
768
 
765
- module.exports.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
766
- const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
767
- return addHeapObject(ret);
768
- };
769
-
770
769
  module.exports.__wbindgen_is_object = function(arg0) {
771
770
  const val = getObject(arg0);
772
771
  const ret = typeof(val) === 'object' && val !== null;
@@ -799,6 +798,14 @@ module.exports.__wbindgen_is_symbol = function(arg0) {
799
798
  return ret;
800
799
  };
801
800
 
801
+ module.exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
802
+ getObject(arg0).getRandomValues(getObject(arg1));
803
+ }, arguments) };
804
+
805
+ module.exports.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
806
+ getObject(arg0).randomFillSync(takeObject(arg1));
807
+ }, arguments) };
808
+
802
809
  module.exports.__wbg_crypto_c48a774b022d20ac = function(arg0) {
803
810
  const ret = getObject(arg0).crypto;
804
811
  return addHeapObject(ret);
@@ -829,14 +836,6 @@ module.exports.__wbg_require_8f08ceecec0f4fee = function() { return handleError(
829
836
  return addHeapObject(ret);
830
837
  }, arguments) };
831
838
 
832
- module.exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
833
- getObject(arg0).getRandomValues(getObject(arg1));
834
- }, arguments) };
835
-
836
- module.exports.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
837
- getObject(arg0).randomFillSync(takeObject(arg1));
838
- }, arguments) };
839
-
840
839
  module.exports.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
841
840
  console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
842
841
  };
@@ -1190,8 +1189,8 @@ module.exports.__wbindgen_function_table = function() {
1190
1189
  return addHeapObject(ret);
1191
1190
  };
1192
1191
 
1193
- module.exports.__wbindgen_closure_wrapper614 = function(arg0, arg1, arg2) {
1194
- const ret = makeMutClosure(arg0, arg1, 193, __wbg_adapter_54);
1192
+ module.exports.__wbindgen_closure_wrapper618 = function(arg0, arg1, arg2) {
1193
+ const ret = makeMutClosure(arg0, arg1, 196, __wbg_adapter_54);
1195
1194
  return addHeapObject(ret);
1196
1195
  };
1197
1196
 
Binary file
@@ -1,12 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
5
- export function executeCircuit(a: number, b: number, c: number, d: number): number;
6
- export function createBlackBoxSolver(): number;
7
- export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
8
4
  export function decompressWitness(a: number, b: number, c: number): void;
9
5
  export function compressWitness(a: number, b: number): void;
6
+ export function buildInfo(): number;
10
7
  export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
11
8
  export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
12
9
  export function keccak256(a: number, b: number, c: number): void;
@@ -14,7 +11,10 @@ export function blake2s256(a: number, b: number, c: number): void;
14
11
  export function sha256(a: number, b: number, c: number): void;
15
12
  export function xor(a: number, b: number): number;
16
13
  export function and(a: number, b: number): number;
17
- export function buildInfo(): number;
14
+ export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
15
+ export function executeCircuit(a: number, b: number, c: number, d: number): number;
16
+ export function createBlackBoxSolver(): number;
17
+ export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
18
18
  export function initLogLevel(a: number): void;
19
19
  export function getPublicWitness(a: number, b: number, c: number, d: number): void;
20
20
  export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
@@ -24,8 +24,8 @@ 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__h1dfec0dba43a4c9e(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__heb1f60a5b015b6c5(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__h43234701b229d587(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__h72933b4dbc34aade(a: number, b: number, c: number, d: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noir-lang/acvm_js",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/noir-lang/acvm.git"
@@ -27,8 +27,11 @@
27
27
  "test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
28
28
  "test:browser": "web-test-runner",
29
29
  "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
30
- "which": "which yarn",
31
- "clean": "chmod u+w web nodejs || true && rm -rf web nodejs"
30
+ "publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
31
+ "nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
32
+ "clean": "chmod u+w web nodejs || true && rm -rf web nodejs",
33
+ "build:nix": "nix build -L .#acvm_js",
34
+ "install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/acvm_js/nodejs ./ && cp -rL ./result/acvm_js/web ./"
32
35
  },
33
36
  "devDependencies": {
34
37
  "@esm-bundle/chai": "^4.3.4-fix.0",
package/web/acvm_js.d.ts CHANGED
@@ -1,29 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
5
- *
6
- * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
7
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
8
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
9
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
10
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
11
- */
12
- export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
13
- /**
14
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
15
- *
16
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
17
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
18
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
19
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
20
- */
21
- export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
22
- /**
23
- * @returns {Promise<WasmBlackBoxFunctionSolver>}
24
- */
25
- export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
26
- /**
27
4
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
28
5
  *
29
6
  * @param {Uint8Array} compressed_witness - A compressed witness.
@@ -38,6 +15,11 @@ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
38
15
  */
39
16
  export function compressWitness(witness_map: WitnessMap): Uint8Array;
40
17
  /**
18
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
19
+ * @returns {BuildInfo} - Information on how the installed package was built.
20
+ */
21
+ export function buildInfo(): BuildInfo;
22
+ /**
41
23
  * Verifies a ECDSA signature over the secp256r1 curve.
42
24
  * @param {Uint8Array} hashed_msg
43
25
  * @param {Uint8Array} public_key_x_bytes
@@ -89,10 +71,28 @@ export function xor(lhs: string, rhs: string): string;
89
71
  */
90
72
  export function and(lhs: string, rhs: string): string;
91
73
  /**
92
- * Returns the `BuildInfo` object containing information about how the installed package was built.
93
- * @returns {BuildInfo} - Information on how the installed package was built.
74
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
75
+ *
76
+ * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
77
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
78
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
79
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
80
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
94
81
  */
95
- export function buildInfo(): BuildInfo;
82
+ export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
83
+ /**
84
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
85
+ *
86
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
87
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
88
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
89
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
90
+ */
91
+ export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
92
+ /**
93
+ * @returns {Promise<WasmBlackBoxFunctionSolver>}
94
+ */
95
+ export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
96
96
  /**
97
97
  * Sets the package's logging level.
98
98
  *
@@ -161,16 +161,16 @@ export type BuildInfo = {
161
161
 
162
162
 
163
163
 
164
- export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
165
-
166
-
167
-
168
164
  export type ExecutionError = Error & {
169
165
  callStack?: string[];
170
166
  };
171
167
 
172
168
 
173
169
 
170
+ export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
171
+
172
+
173
+
174
174
  // Map from witness index to hex string value of witness.
175
175
  export type WitnessMap = Map<number, string>;
176
176
 
@@ -195,12 +195,9 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
195
195
 
196
196
  export interface InitOutput {
197
197
  readonly memory: WebAssembly.Memory;
198
- readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
199
- readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
200
- readonly createBlackBoxSolver: () => number;
201
- readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
202
198
  readonly decompressWitness: (a: number, b: number, c: number) => void;
203
199
  readonly compressWitness: (a: number, b: number) => void;
200
+ readonly buildInfo: () => number;
204
201
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
205
202
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
206
203
  readonly keccak256: (a: number, b: number, c: number) => void;
@@ -208,7 +205,10 @@ export interface InitOutput {
208
205
  readonly sha256: (a: number, b: number, c: number) => void;
209
206
  readonly xor: (a: number, b: number) => number;
210
207
  readonly and: (a: number, b: number) => number;
211
- readonly buildInfo: () => number;
208
+ readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
209
+ readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
210
+ readonly createBlackBoxSolver: () => number;
211
+ readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
212
212
  readonly initLogLevel: (a: number) => void;
213
213
  readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
214
214
  readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
@@ -218,11 +218,11 @@ export interface InitOutput {
218
218
  readonly __wbindgen_malloc: (a: number) => number;
219
219
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
220
220
  readonly __wbindgen_export_2: WebAssembly.Table;
221
- readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h1dfec0dba43a4c9e: (a: number, b: number, c: number) => void;
221
+ readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb1f60a5b015b6c5: (a: number, b: number, c: number) => void;
222
222
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
223
223
  readonly __wbindgen_free: (a: number, b: number) => void;
224
224
  readonly __wbindgen_exn_store: (a: number) => void;
225
- readonly wasm_bindgen__convert__closures__invoke2_mut__h43234701b229d587: (a: number, b: number, c: number, d: number) => void;
225
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h72933b4dbc34aade: (a: number, b: number, c: number, d: number) => void;
226
226
  }
227
227
 
228
228
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/web/acvm_js.js CHANGED
@@ -1,27 +1,11 @@
1
1
  let wasm;
2
2
 
3
- const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
4
-
5
- if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
6
-
7
- let cachedUint8Memory0 = null;
8
-
9
- function getUint8Memory0() {
10
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
11
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
12
- }
13
- return cachedUint8Memory0;
14
- }
15
-
16
- function getStringFromWasm0(ptr, len) {
17
- ptr = ptr >>> 0;
18
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
19
- }
20
-
21
3
  const heap = new Array(128).fill(undefined);
22
4
 
23
5
  heap.push(undefined, null, true, false);
24
6
 
7
+ function getObject(idx) { return heap[idx]; }
8
+
25
9
  let heap_next = heap.length;
26
10
 
27
11
  function addHeapObject(obj) {
@@ -33,8 +17,6 @@ function addHeapObject(obj) {
33
17
  return idx;
34
18
  }
35
19
 
36
- function getObject(idx) { return heap[idx]; }
37
-
38
20
  function dropObject(idx) {
39
21
  if (idx < 132) return;
40
22
  heap[idx] = heap_next;
@@ -47,6 +29,24 @@ function takeObject(idx) {
47
29
  return ret;
48
30
  }
49
31
 
32
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
33
+
34
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
35
+
36
+ let cachedUint8Memory0 = null;
37
+
38
+ function getUint8Memory0() {
39
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
40
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
41
+ }
42
+ return cachedUint8Memory0;
43
+ }
44
+
45
+ function getStringFromWasm0(ptr, len) {
46
+ ptr = ptr >>> 0;
47
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
48
+ }
49
+
50
50
  function isLikeNone(x) {
51
51
  return x === undefined || x === null;
52
52
  }
@@ -223,14 +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__h1dfec0dba43a4c9e(arg0, arg1, addHeapObject(arg2));
227
- }
228
-
229
- function _assertClass(instance, klass) {
230
- if (!(instance instanceof klass)) {
231
- throw new Error(`expected instance of ${klass.name}`);
232
- }
233
- return instance.ptr;
226
+ wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb1f60a5b015b6c5(arg0, arg1, addHeapObject(arg2));
234
227
  }
235
228
 
236
229
  function passArray8ToWasm0(arg, malloc) {
@@ -239,46 +232,6 @@ function passArray8ToWasm0(arg, malloc) {
239
232
  WASM_VECTOR_LEN = arg.length;
240
233
  return ptr;
241
234
  }
242
- /**
243
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
244
- *
245
- * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
246
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
247
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
248
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
249
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
250
- */
251
- export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) {
252
- _assertClass(solver, WasmBlackBoxFunctionSolver);
253
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
254
- const len0 = WASM_VECTOR_LEN;
255
- const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
256
- return takeObject(ret);
257
- }
258
-
259
- /**
260
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
261
- *
262
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
263
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
264
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
265
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
266
- */
267
- export function executeCircuit(circuit, initial_witness, foreign_call_handler) {
268
- const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
269
- const len0 = WASM_VECTOR_LEN;
270
- const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
271
- return takeObject(ret);
272
- }
273
-
274
- /**
275
- * @returns {Promise<WasmBlackBoxFunctionSolver>}
276
- */
277
- export function createBlackBoxSolver() {
278
- const ret = wasm.createBlackBoxSolver();
279
- return takeObject(ret);
280
- }
281
-
282
235
  /**
283
236
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
284
237
  *
@@ -332,6 +285,15 @@ export function compressWitness(witness_map) {
332
285
  }
333
286
  }
334
287
 
288
+ /**
289
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
290
+ * @returns {BuildInfo} - Information on how the installed package was built.
291
+ */
292
+ export function buildInfo() {
293
+ const ret = wasm.buildInfo();
294
+ return takeObject(ret);
295
+ }
296
+
335
297
  /**
336
298
  * Verifies a ECDSA signature over the secp256r1 curve.
337
299
  * @param {Uint8Array} hashed_msg
@@ -460,12 +422,49 @@ export function and(lhs, rhs) {
460
422
  return takeObject(ret);
461
423
  }
462
424
 
425
+ function _assertClass(instance, klass) {
426
+ if (!(instance instanceof klass)) {
427
+ throw new Error(`expected instance of ${klass.name}`);
428
+ }
429
+ return instance.ptr;
430
+ }
463
431
  /**
464
- * Returns the `BuildInfo` object containing information about how the installed package was built.
465
- * @returns {BuildInfo} - Information on how the installed package was built.
432
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
433
+ *
434
+ * @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
435
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
436
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
437
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
438
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
466
439
  */
467
- export function buildInfo() {
468
- const ret = wasm.buildInfo();
440
+ export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) {
441
+ _assertClass(solver, WasmBlackBoxFunctionSolver);
442
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
443
+ const len0 = WASM_VECTOR_LEN;
444
+ const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
445
+ return takeObject(ret);
446
+ }
447
+
448
+ /**
449
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
450
+ *
451
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
452
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
453
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
454
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
455
+ */
456
+ export function executeCircuit(circuit, initial_witness, foreign_call_handler) {
457
+ const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
458
+ const len0 = WASM_VECTOR_LEN;
459
+ const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
460
+ return takeObject(ret);
461
+ }
462
+
463
+ /**
464
+ * @returns {Promise<WasmBlackBoxFunctionSolver>}
465
+ */
466
+ export function createBlackBoxSolver() {
467
+ const ret = wasm.createBlackBoxSolver();
469
468
  return takeObject(ret);
470
469
  }
471
470
 
@@ -570,7 +569,7 @@ function handleError(f, args) {
570
569
  }
571
570
  }
572
571
  function __wbg_adapter_155(arg0, arg1, arg2, arg3) {
573
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h43234701b229d587(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
572
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h72933b4dbc34aade(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
574
573
  }
575
574
 
576
575
  /**
@@ -656,10 +655,6 @@ async function __wbg_load(module, imports) {
656
655
  function __wbg_get_imports() {
657
656
  const imports = {};
658
657
  imports.wbg = {};
659
- imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
660
- const ret = new Error(getStringFromWasm0(arg0, arg1));
661
- return addHeapObject(ret);
662
- };
663
658
  imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
664
659
  const ret = getObject(arg0);
665
660
  return addHeapObject(ret);
@@ -667,6 +662,18 @@ function __wbg_get_imports() {
667
662
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
668
663
  takeObject(arg0);
669
664
  };
665
+ imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
666
+ const ret = new Error(getStringFromWasm0(arg0, arg1));
667
+ return addHeapObject(ret);
668
+ };
669
+ imports.wbg.__wbindgen_is_string = function(arg0) {
670
+ const ret = typeof(getObject(arg0)) === 'string';
671
+ return ret;
672
+ };
673
+ imports.wbg.__wbindgen_is_array = function(arg0) {
674
+ const ret = Array.isArray(getObject(arg0));
675
+ return ret;
676
+ };
670
677
  imports.wbg.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
671
678
  const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
672
679
  return addHeapObject(ret);
@@ -685,9 +692,9 @@ function __wbg_get_imports() {
685
692
  getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
686
693
  getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
687
694
  };
688
- imports.wbg.__wbindgen_is_array = function(arg0) {
689
- const ret = Array.isArray(getObject(arg0));
690
- return ret;
695
+ imports.wbg.__wbg_constructor_cdd6dc055ac30922 = function(arg0) {
696
+ const ret = new Error(takeObject(arg0));
697
+ return addHeapObject(ret);
691
698
  };
692
699
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
693
700
  const obj = getObject(arg1);
@@ -697,10 +704,6 @@ function __wbg_get_imports() {
697
704
  getInt32Memory0()[arg0 / 4 + 1] = len1;
698
705
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
699
706
  };
700
- imports.wbg.__wbg_constructor_bd5b3ba6619fce81 = function(arg0) {
701
- const ret = new Error(takeObject(arg0));
702
- return addHeapObject(ret);
703
- };
704
707
  imports.wbg.__wbindgen_cb_drop = function(arg0) {
705
708
  const obj = takeObject(arg0).original;
706
709
  if (obj.cnt-- == 1) {
@@ -710,7 +713,7 @@ function __wbg_get_imports() {
710
713
  const ret = false;
711
714
  return ret;
712
715
  };
713
- imports.wbg.__wbg_new_d6cb182577c81490 = function() {
716
+ imports.wbg.__wbg_new_df67af045c277099 = function() {
714
717
  const ret = new Map();
715
718
  return addHeapObject(ret);
716
719
  };
@@ -718,10 +721,6 @@ function __wbg_get_imports() {
718
721
  const ret = arg0;
719
722
  return addHeapObject(ret);
720
723
  };
721
- imports.wbg.__wbindgen_is_string = function(arg0) {
722
- const ret = typeof(getObject(arg0)) === 'string';
723
- return ret;
724
- };
725
724
  imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
726
725
  const ret = new Error();
727
726
  return addHeapObject(ret);
@@ -748,9 +747,9 @@ function __wbg_get_imports() {
748
747
  const ret = arg0;
749
748
  return addHeapObject(ret);
750
749
  };
751
- imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
752
- const ret = getObject(arg0) === getObject(arg1);
753
- return ret;
750
+ imports.wbg.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
751
+ const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
752
+ return addHeapObject(ret);
754
753
  };
755
754
  imports.wbg.__wbindgen_ge = function(arg0, arg1) {
756
755
  const ret = getObject(arg0) >= getObject(arg1);
@@ -760,6 +759,10 @@ function __wbg_get_imports() {
760
759
  const ret = typeof(getObject(arg0)) === 'bigint';
761
760
  return ret;
762
761
  };
762
+ imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
763
+ const ret = getObject(arg0) === getObject(arg1);
764
+ return ret;
765
+ };
763
766
  imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
764
767
  const ret = BigInt.asUintN(64, arg0);
765
768
  return addHeapObject(ret);
@@ -768,10 +771,6 @@ function __wbg_get_imports() {
768
771
  const ret = getObject(arg0) >> getObject(arg1);
769
772
  return addHeapObject(ret);
770
773
  };
771
- imports.wbg.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
772
- const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
773
- return addHeapObject(ret);
774
- };
775
774
  imports.wbg.__wbindgen_is_object = function(arg0) {
776
775
  const val = getObject(arg0);
777
776
  const ret = typeof(val) === 'object' && val !== null;
@@ -799,6 +798,12 @@ function __wbg_get_imports() {
799
798
  const ret = typeof(getObject(arg0)) === 'symbol';
800
799
  return ret;
801
800
  };
801
+ imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
802
+ getObject(arg0).getRandomValues(getObject(arg1));
803
+ }, arguments) };
804
+ imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
805
+ getObject(arg0).randomFillSync(takeObject(arg1));
806
+ }, arguments) };
802
807
  imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
803
808
  const ret = getObject(arg0).crypto;
804
809
  return addHeapObject(ret);
@@ -823,12 +828,6 @@ function __wbg_get_imports() {
823
828
  const ret = module.require;
824
829
  return addHeapObject(ret);
825
830
  }, arguments) };
826
- imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
827
- getObject(arg0).getRandomValues(getObject(arg1));
828
- }, arguments) };
829
- imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
830
- getObject(arg0).randomFillSync(takeObject(arg1));
831
- }, arguments) };
832
831
  imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
833
832
  console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
834
833
  };
@@ -1120,8 +1119,8 @@ function __wbg_get_imports() {
1120
1119
  const ret = wasm.__wbindgen_export_2;
1121
1120
  return addHeapObject(ret);
1122
1121
  };
1123
- imports.wbg.__wbindgen_closure_wrapper614 = function(arg0, arg1, arg2) {
1124
- const ret = makeMutClosure(arg0, arg1, 193, __wbg_adapter_54);
1122
+ imports.wbg.__wbindgen_closure_wrapper618 = function(arg0, arg1, arg2) {
1123
+ const ret = makeMutClosure(arg0, arg1, 196, __wbg_adapter_54);
1125
1124
  return addHeapObject(ret);
1126
1125
  };
1127
1126
 
Binary file
@@ -1,12 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
5
- export function executeCircuit(a: number, b: number, c: number, d: number): number;
6
- export function createBlackBoxSolver(): number;
7
- export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
8
4
  export function decompressWitness(a: number, b: number, c: number): void;
9
5
  export function compressWitness(a: number, b: number): void;
6
+ export function buildInfo(): number;
10
7
  export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
11
8
  export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
12
9
  export function keccak256(a: number, b: number, c: number): void;
@@ -14,7 +11,10 @@ export function blake2s256(a: number, b: number, c: number): void;
14
11
  export function sha256(a: number, b: number, c: number): void;
15
12
  export function xor(a: number, b: number): number;
16
13
  export function and(a: number, b: number): number;
17
- export function buildInfo(): number;
14
+ export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
15
+ export function executeCircuit(a: number, b: number, c: number, d: number): number;
16
+ export function createBlackBoxSolver(): number;
17
+ export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
18
18
  export function initLogLevel(a: number): void;
19
19
  export function getPublicWitness(a: number, b: number, c: number, d: number): void;
20
20
  export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
@@ -24,8 +24,8 @@ 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__h1dfec0dba43a4c9e(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__heb1f60a5b015b6c5(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__h43234701b229d587(a: number, b: number, c: number, d: number): void;
31
+ export function wasm_bindgen__convert__closures__invoke2_mut__h72933b4dbc34aade(a: number, b: number, c: number, d: number): void;