@aztec/noir-acvm_js 0.0.1-commit.d431d1c → 0.0.1-commit.e310a4c8

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.
@@ -5,34 +5,6 @@
5
5
  * @returns {BuildInfo} - Information on how the installed package was built.
6
6
  */
7
7
  export function buildInfo(): BuildInfo;
8
- /**
9
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
10
- *
11
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
12
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
13
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
14
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
15
- */
16
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
17
- /**
18
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
19
- * This method also extracts the public return values from the solved witness into its own return witness.
20
- *
21
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
22
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
23
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
24
- * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
25
- */
26
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
27
- /**
28
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
29
- *
30
- * @param {Uint8Array} program - A serialized representation of an ACIR program
31
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
32
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
33
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
34
- */
35
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
36
8
  /**
37
9
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
38
10
  *
@@ -86,6 +58,34 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
86
58
  * Verifies a ECDSA signature over the secp256r1 curve.
87
59
  */
88
60
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
61
+ /**
62
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
63
+ *
64
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
65
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
66
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
67
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
68
+ */
69
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
70
+ /**
71
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
72
+ * This method also extracts the public return values from the solved witness into its own return witness.
73
+ *
74
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
75
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
76
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
77
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
78
+ */
79
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
80
+ /**
81
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
82
+ *
83
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
84
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
85
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
86
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
87
+ */
88
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
89
89
  /**
90
90
  * Sets the package's logging level.
91
91
  *
package/nodejs/acvm_js.js CHANGED
@@ -210,58 +210,6 @@ module.exports.buildInfo = function() {
210
210
  return ret;
211
211
  };
212
212
 
213
- function passArray8ToWasm0(arg, malloc) {
214
- const ptr = malloc(arg.length * 1, 1) >>> 0;
215
- getUint8ArrayMemory0().set(arg, ptr / 1);
216
- WASM_VECTOR_LEN = arg.length;
217
- return ptr;
218
- }
219
- /**
220
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
221
- *
222
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
223
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
224
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
225
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
226
- */
227
- module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
228
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
229
- const len0 = WASM_VECTOR_LEN;
230
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
231
- return ret;
232
- };
233
-
234
- /**
235
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
236
- * This method also extracts the public return values from the solved witness into its own return witness.
237
- *
238
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
239
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
240
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
241
- * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
242
- */
243
- module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
244
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
245
- const len0 = WASM_VECTOR_LEN;
246
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
247
- return ret;
248
- };
249
-
250
- /**
251
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
252
- *
253
- * @param {Uint8Array} program - A serialized representation of an ACIR program
254
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
255
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
256
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
257
- */
258
- module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
259
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
260
- const len0 = WASM_VECTOR_LEN;
261
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
262
- return ret;
263
- };
264
-
265
213
  function takeFromExternrefTable0(idx) {
266
214
  const value = wasm.__wbindgen_export_2.get(idx);
267
215
  wasm.__externref_table_dealloc(idx);
@@ -288,6 +236,12 @@ module.exports.compressWitness = function(witness_map) {
288
236
  return v1;
289
237
  };
290
238
 
239
+ function passArray8ToWasm0(arg, malloc) {
240
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
241
+ getUint8ArrayMemory0().set(arg, ptr / 1);
242
+ WASM_VECTOR_LEN = arg.length;
243
+ return ptr;
244
+ }
291
245
  /**
292
246
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
293
247
  * This should be used to only fetch the witness map for the main function.
@@ -452,6 +406,52 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
452
406
  return ret !== 0;
453
407
  };
454
408
 
409
+ /**
410
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
411
+ *
412
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
413
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
414
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
415
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
416
+ */
417
+ module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
418
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
419
+ const len0 = WASM_VECTOR_LEN;
420
+ const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
421
+ return ret;
422
+ };
423
+
424
+ /**
425
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
426
+ * This method also extracts the public return values from the solved witness into its own return witness.
427
+ *
428
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
429
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
430
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
431
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
432
+ */
433
+ module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
434
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
435
+ const len0 = WASM_VECTOR_LEN;
436
+ const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
437
+ return ret;
438
+ };
439
+
440
+ /**
441
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
442
+ *
443
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
444
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
445
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
446
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
447
+ */
448
+ module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
449
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
450
+ const len0 = WASM_VECTOR_LEN;
451
+ const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
452
+ return ret;
453
+ };
454
+
455
455
  /**
456
456
  * Sets the package's logging level.
457
457
  *
@@ -527,7 +527,7 @@ module.exports.getPublicWitness = function(program, solved_witness) {
527
527
  };
528
528
 
529
529
  function __wbg_adapter_30(arg0, arg1, arg2) {
530
- wasm.closure447_externref_shim(arg0, arg1, arg2);
530
+ wasm.closure448_externref_shim(arg0, arg1, arg2);
531
531
  }
532
532
 
533
533
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
@@ -813,8 +813,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
813
813
  return ret;
814
814
  };
815
815
 
816
- module.exports.__wbindgen_closure_wrapper1443 = function(arg0, arg1, arg2) {
817
- const ret = makeMutClosure(arg0, arg1, 448, __wbg_adapter_30);
816
+ module.exports.__wbindgen_closure_wrapper1445 = function(arg0, arg1, arg2) {
817
+ const ret = makeMutClosure(arg0, arg1, 449, __wbg_adapter_30);
818
818
  return ret;
819
819
  };
820
820
 
Binary file
@@ -2,9 +2,6 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const buildInfo: () => any;
5
- export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
6
- export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
7
- export const executeProgram: (a: number, b: number, c: any, d: any) => any;
8
5
  export const compressWitness: (a: any) => [number, number, number, number];
9
6
  export const decompressWitness: (a: number, b: number) => [number, number, number];
10
7
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -15,6 +12,9 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
15
12
  export const blake2s256: (a: number, b: number) => [number, number];
16
13
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
17
14
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
15
+ export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
16
+ export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
17
+ export const executeProgram: (a: number, b: number, c: any, d: any) => any;
18
18
  export const initLogLevel: (a: number, b: number) => [number, number];
19
19
  export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
20
20
  export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
27
27
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
28
28
  export const __wbindgen_export_6: WebAssembly.Table;
29
29
  export const __externref_table_dealloc: (a: number) => void;
30
- export const closure447_externref_shim: (a: number, b: number, c: any) => void;
30
+ export const closure448_externref_shim: (a: number, b: number, c: any) => void;
31
31
  export const closure932_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
32
  export const closure936_externref_shim: (a: number, b: number, c: any, d: any) => void;
33
33
  export const __wbindgen_start: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/noir-acvm_js",
3
- "version": "0.0.1-commit.d431d1c",
3
+ "version": "0.0.1-commit.e310a4c8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -43,9 +43,9 @@
43
43
  "@web/test-runner-playwright": "^0.11.1",
44
44
  "chai": "^6.2.2",
45
45
  "eslint": "^9.39.2",
46
- "eslint-plugin-prettier": "^5.5.4",
46
+ "eslint-plugin-prettier": "^5.5.5",
47
47
  "mocha": "^11.7.5",
48
- "prettier": "3.7.4",
48
+ "prettier": "3.8.1",
49
49
  "ts-node": "^10.9.2",
50
50
  "typescript": "^5.8.3"
51
51
  }
package/web/acvm_js.d.ts CHANGED
@@ -5,34 +5,6 @@
5
5
  * @returns {BuildInfo} - Information on how the installed package was built.
6
6
  */
7
7
  export function buildInfo(): BuildInfo;
8
- /**
9
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
10
- *
11
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
12
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
13
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
14
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
15
- */
16
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
17
- /**
18
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
19
- * This method also extracts the public return values from the solved witness into its own return witness.
20
- *
21
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
22
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
23
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
24
- * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
25
- */
26
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
27
- /**
28
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
29
- *
30
- * @param {Uint8Array} program - A serialized representation of an ACIR program
31
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
32
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
33
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
34
- */
35
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
36
8
  /**
37
9
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
38
10
  *
@@ -86,6 +58,34 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
86
58
  * Verifies a ECDSA signature over the secp256r1 curve.
87
59
  */
88
60
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
61
+ /**
62
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
63
+ *
64
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
65
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
66
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
67
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
68
+ */
69
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
70
+ /**
71
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
72
+ * This method also extracts the public return values from the solved witness into its own return witness.
73
+ *
74
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
75
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
76
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
77
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
78
+ */
79
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
80
+ /**
81
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
82
+ *
83
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
84
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
85
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
86
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
87
+ */
88
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
89
89
  /**
90
90
  * Sets the package's logging level.
91
91
  *
@@ -188,9 +188,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
188
188
  export interface InitOutput {
189
189
  readonly memory: WebAssembly.Memory;
190
190
  readonly buildInfo: () => any;
191
- readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
192
- readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
193
- readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
194
191
  readonly compressWitness: (a: any) => [number, number, number, number];
195
192
  readonly decompressWitness: (a: number, b: number) => [number, number, number];
196
193
  readonly compressWitnessStack: (a: any) => [number, number, number, number];
@@ -201,6 +198,9 @@ export interface InitOutput {
201
198
  readonly blake2s256: (a: number, b: number) => [number, number];
202
199
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
203
200
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
201
+ readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
202
+ readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
203
+ readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
204
204
  readonly initLogLevel: (a: number, b: number) => [number, number];
205
205
  readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
206
206
  readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
@@ -213,7 +213,7 @@ export interface InitOutput {
213
213
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
214
214
  readonly __wbindgen_export_6: WebAssembly.Table;
215
215
  readonly __externref_table_dealloc: (a: number) => void;
216
- readonly closure447_externref_shim: (a: number, b: number, c: any) => void;
216
+ readonly closure448_externref_shim: (a: number, b: number, c: any) => void;
217
217
  readonly closure932_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
218
218
  readonly closure936_externref_shim: (a: number, b: number, c: any, d: any) => void;
219
219
  readonly __wbindgen_start: () => void;
package/web/acvm_js.js CHANGED
@@ -206,58 +206,6 @@ export function buildInfo() {
206
206
  return ret;
207
207
  }
208
208
 
209
- function passArray8ToWasm0(arg, malloc) {
210
- const ptr = malloc(arg.length * 1, 1) >>> 0;
211
- getUint8ArrayMemory0().set(arg, ptr / 1);
212
- WASM_VECTOR_LEN = arg.length;
213
- return ptr;
214
- }
215
- /**
216
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
217
- *
218
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
219
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
220
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
221
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
222
- */
223
- export function executeCircuit(program, initial_witness, foreign_call_handler) {
224
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
225
- const len0 = WASM_VECTOR_LEN;
226
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
227
- return ret;
228
- }
229
-
230
- /**
231
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
232
- * This method also extracts the public return values from the solved witness into its own return witness.
233
- *
234
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
235
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
236
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
237
- * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
238
- */
239
- export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
240
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
241
- const len0 = WASM_VECTOR_LEN;
242
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
243
- return ret;
244
- }
245
-
246
- /**
247
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
248
- *
249
- * @param {Uint8Array} program - A serialized representation of an ACIR program
250
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
251
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
252
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
253
- */
254
- export function executeProgram(program, initial_witness, foreign_call_handler) {
255
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
256
- const len0 = WASM_VECTOR_LEN;
257
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
258
- return ret;
259
- }
260
-
261
209
  function takeFromExternrefTable0(idx) {
262
210
  const value = wasm.__wbindgen_export_2.get(idx);
263
211
  wasm.__externref_table_dealloc(idx);
@@ -284,6 +232,12 @@ export function compressWitness(witness_map) {
284
232
  return v1;
285
233
  }
286
234
 
235
+ function passArray8ToWasm0(arg, malloc) {
236
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
237
+ getUint8ArrayMemory0().set(arg, ptr / 1);
238
+ WASM_VECTOR_LEN = arg.length;
239
+ return ptr;
240
+ }
287
241
  /**
288
242
  * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
289
243
  * This should be used to only fetch the witness map for the main function.
@@ -448,6 +402,52 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
448
402
  return ret !== 0;
449
403
  }
450
404
 
405
+ /**
406
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
407
+ *
408
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
409
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
410
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
411
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
412
+ */
413
+ export function executeCircuit(program, initial_witness, foreign_call_handler) {
414
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
415
+ const len0 = WASM_VECTOR_LEN;
416
+ const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
417
+ return ret;
418
+ }
419
+
420
+ /**
421
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
422
+ * This method also extracts the public return values from the solved witness into its own return witness.
423
+ *
424
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
425
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
426
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
427
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
428
+ */
429
+ export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
430
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
431
+ const len0 = WASM_VECTOR_LEN;
432
+ const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
433
+ return ret;
434
+ }
435
+
436
+ /**
437
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
438
+ *
439
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
440
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
441
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
442
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
443
+ */
444
+ export function executeProgram(program, initial_witness, foreign_call_handler) {
445
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
446
+ const len0 = WASM_VECTOR_LEN;
447
+ const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
448
+ return ret;
449
+ }
450
+
451
451
  /**
452
452
  * Sets the package's logging level.
453
453
  *
@@ -523,7 +523,7 @@ export function getPublicWitness(program, solved_witness) {
523
523
  }
524
524
 
525
525
  function __wbg_adapter_30(arg0, arg1, arg2) {
526
- wasm.closure447_externref_shim(arg0, arg1, arg2);
526
+ wasm.closure448_externref_shim(arg0, arg1, arg2);
527
527
  }
528
528
 
529
529
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
@@ -797,8 +797,8 @@ function __wbg_get_imports() {
797
797
  const ret = false;
798
798
  return ret;
799
799
  };
800
- imports.wbg.__wbindgen_closure_wrapper1443 = function(arg0, arg1, arg2) {
801
- const ret = makeMutClosure(arg0, arg1, 448, __wbg_adapter_30);
800
+ imports.wbg.__wbindgen_closure_wrapper1445 = function(arg0, arg1, arg2) {
801
+ const ret = makeMutClosure(arg0, arg1, 449, __wbg_adapter_30);
802
802
  return ret;
803
803
  };
804
804
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -2,9 +2,6 @@
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
4
  export const buildInfo: () => any;
5
- export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
6
- export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
7
- export const executeProgram: (a: number, b: number, c: any, d: any) => any;
8
5
  export const compressWitness: (a: any) => [number, number, number, number];
9
6
  export const decompressWitness: (a: number, b: number) => [number, number, number];
10
7
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -15,6 +12,9 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
15
12
  export const blake2s256: (a: number, b: number) => [number, number];
16
13
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
17
14
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
15
+ export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
16
+ export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
17
+ export const executeProgram: (a: number, b: number, c: any, d: any) => any;
18
18
  export const initLogLevel: (a: number, b: number) => [number, number];
19
19
  export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
20
20
  export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
27
27
  export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
28
28
  export const __wbindgen_export_6: WebAssembly.Table;
29
29
  export const __externref_table_dealloc: (a: number) => void;
30
- export const closure447_externref_shim: (a: number, b: number, c: any) => void;
30
+ export const closure448_externref_shim: (a: number, b: number, c: any) => void;
31
31
  export const closure932_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
32
  export const closure936_externref_shim: (a: number, b: number, c: any, d: any) => void;
33
33
  export const __wbindgen_start: () => void;