@noir-lang/acvm_js 1.0.0-beta.3-fdd2fe7.nightly → 1.0.0-beta.3-3239a4a.nightly

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
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
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
11
- *
12
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
13
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
14
- * @returns {WitnessMap} A witness map containing the circuit's return values.
15
- */
16
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
17
- /**
18
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
19
- *
20
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
21
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
22
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
23
- */
24
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
25
- /**
26
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
27
- *
28
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
29
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
30
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
31
- */
32
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
33
3
  /**
34
4
  * Returns the `BuildInfo` object containing information about how the installed package was built.
35
5
  * @returns {BuildInfo} - Information on how the installed package was built.
@@ -63,6 +33,30 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
63
33
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
64
34
  */
65
35
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
36
+ /**
37
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
38
+ *
39
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
40
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
41
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
42
+ */
43
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
44
+ /**
45
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
46
+ *
47
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
48
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
49
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
50
+ */
51
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
52
+ /**
53
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
54
+ *
55
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
56
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
57
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
58
+ */
59
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
66
60
  /**
67
61
  * Performs a bitwise AND operation between `lhs` and `rhs`
68
62
  */
@@ -116,21 +110,12 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
116
110
  * @returns {WitnessStack} The decompressed witness stack.
117
111
  */
118
112
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
119
-
120
- // Map from witness index to hex string value of witness.
121
- export type WitnessMap = Map<number, string>;
122
-
123
113
  /**
124
- * An execution result containing two witnesses.
125
- * 1. The full solved witness of the execution.
126
- * 2. The return witness which contains the given public return values within the full witness.
114
+ * Sets the package's logging level.
115
+ *
116
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
127
117
  */
128
- export type SolvedAndReturnWitness = {
129
- solvedWitness: WitnessMap;
130
- returnWitness: WitnessMap;
131
- }
132
-
133
-
118
+ export function initLogLevel(filter: string): void;
134
119
 
135
120
  /**
136
121
  * @typedef {Object} BuildInfo - Information about how the installed package was built
@@ -181,3 +166,18 @@ export type ForeignCallOutput = string | string[]
181
166
  export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
182
167
 
183
168
 
169
+
170
+ // Map from witness index to hex string value of witness.
171
+ export type WitnessMap = Map<number, string>;
172
+
173
+ /**
174
+ * An execution result containing two witnesses.
175
+ * 1. The full solved witness of the execution.
176
+ * 2. The return witness which contains the given public return values within the full witness.
177
+ */
178
+ export type SolvedAndReturnWitness = {
179
+ solvedWitness: WitnessMap;
180
+ returnWitness: WitnessMap;
181
+ }
182
+
183
+
package/nodejs/acvm_js.js CHANGED
@@ -201,24 +201,13 @@ function debugString(val) {
201
201
  // TODO we could test for more things here, like `Set`s and `Map`s.
202
202
  return className;
203
203
  }
204
-
205
- function takeFromExternrefTable0(idx) {
206
- const value = wasm.__wbindgen_export_2.get(idx);
207
- wasm.__externref_table_dealloc(idx);
208
- return value;
209
- }
210
204
  /**
211
- * Sets the package's logging level.
212
- *
213
- * @param {LogLevel} level - The maximum level of logging to be emitted.
205
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
206
+ * @returns {BuildInfo} - Information on how the installed package was built.
214
207
  */
215
- module.exports.initLogLevel = function(filter) {
216
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
217
- const len0 = WASM_VECTOR_LEN;
218
- const ret = wasm.initLogLevel(ptr0, len0);
219
- if (ret[1]) {
220
- throw takeFromExternrefTable0(ret[0]);
221
- }
208
+ module.exports.buildInfo = function() {
209
+ const ret = wasm.buildInfo();
210
+ return ret;
222
211
  };
223
212
 
224
213
  function passArray8ToWasm0(arg, malloc) {
@@ -227,6 +216,57 @@ function passArray8ToWasm0(arg, malloc) {
227
216
  WASM_VECTOR_LEN = arg.length;
228
217
  return ptr;
229
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
+ function takeFromExternrefTable0(idx) {
266
+ const value = wasm.__wbindgen_export_2.get(idx);
267
+ wasm.__externref_table_dealloc(idx);
268
+ return value;
269
+ }
230
270
  /**
231
271
  * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
232
272
  *
@@ -287,61 +327,6 @@ module.exports.getPublicWitness = function(program, solved_witness) {
287
327
  return takeFromExternrefTable0(ret[0]);
288
328
  };
289
329
 
290
- /**
291
- * Returns the `BuildInfo` object containing information about how the installed package was built.
292
- * @returns {BuildInfo} - Information on how the installed package was built.
293
- */
294
- module.exports.buildInfo = function() {
295
- const ret = wasm.buildInfo();
296
- return ret;
297
- };
298
-
299
- /**
300
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
301
- *
302
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
303
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
304
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
305
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
306
- */
307
- module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
308
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
309
- const len0 = WASM_VECTOR_LEN;
310
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
311
- return ret;
312
- };
313
-
314
- /**
315
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
316
- * This method also extracts the public return values from the solved witness into its own return witness.
317
- *
318
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
319
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
320
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
321
- * @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.
322
- */
323
- module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
324
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
325
- const len0 = WASM_VECTOR_LEN;
326
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
327
- return ret;
328
- };
329
-
330
- /**
331
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
332
- *
333
- * @param {Uint8Array} program - A serialized representation of an ACIR program
334
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
335
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
336
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
337
- */
338
- module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
339
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
340
- const len0 = WASM_VECTOR_LEN;
341
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
342
- return ret;
343
- };
344
-
345
330
  /**
346
331
  * Performs a bitwise AND operation between `lhs` and `rhs`
347
332
  * @param {string} lhs
@@ -526,16 +511,30 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
526
511
  return takeFromExternrefTable0(ret[0]);
527
512
  };
528
513
 
514
+ /**
515
+ * Sets the package's logging level.
516
+ *
517
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
518
+ */
519
+ module.exports.initLogLevel = function(filter) {
520
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
521
+ const len0 = WASM_VECTOR_LEN;
522
+ const ret = wasm.initLogLevel(ptr0, len0);
523
+ if (ret[1]) {
524
+ throw takeFromExternrefTable0(ret[0]);
525
+ }
526
+ };
527
+
529
528
  function __wbg_adapter_30(arg0, arg1, arg2) {
530
- wasm.closure269_externref_shim(arg0, arg1, arg2);
529
+ wasm.closure265_externref_shim(arg0, arg1, arg2);
531
530
  }
532
531
 
533
532
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
534
- wasm.closure834_externref_shim(arg0, arg1, arg2, arg3, arg4);
533
+ wasm.closure830_externref_shim(arg0, arg1, arg2, arg3, arg4);
535
534
  }
536
535
 
537
536
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
538
- wasm.closure838_externref_shim(arg0, arg1, arg2, arg3);
537
+ wasm.closure834_externref_shim(arg0, arg1, arg2, arg3);
539
538
  }
540
539
 
541
540
  module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
@@ -814,7 +813,7 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
814
813
  };
815
814
 
816
815
  module.exports.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
817
- const ret = makeMutClosure(arg0, arg1, 270, __wbg_adapter_30);
816
+ const ret = makeMutClosure(arg0, arg1, 266, __wbg_adapter_30);
818
817
  return ret;
819
818
  };
820
819
 
Binary file
@@ -1,14 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const initLogLevel: (a: number, b: number) => [number, number];
5
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
6
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
7
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
8
4
  export const buildInfo: () => any;
9
5
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
6
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
7
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
8
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
9
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
10
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
12
11
  export const and: (a: any, b: any) => any;
13
12
  export const xor: (a: any, b: any) => any;
14
13
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
@@ -19,6 +18,7 @@ export const compressWitness: (a: any) => [number, number, number, number];
19
18
  export const decompressWitness: (a: number, b: number) => [number, number, number];
20
19
  export const compressWitnessStack: (a: any) => [number, number, number, number];
21
20
  export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
21
+ export const initLogLevel: (a: number, b: number) => [number, number];
22
22
  export const __wbindgen_exn_store: (a: number) => void;
23
23
  export const __externref_table_alloc: () => number;
24
24
  export const __wbindgen_export_2: WebAssembly.Table;
@@ -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 closure269_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure834_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure838_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure265_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure830_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure834_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": "@noir-lang/acvm_js",
3
- "version": "1.0.0-beta.3-fdd2fe7.nightly",
3
+ "version": "1.0.0-beta.3-3239a4a.nightly",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/web/acvm_js.d.ts CHANGED
@@ -1,35 +1,5 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
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
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
11
- *
12
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
13
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
14
- * @returns {WitnessMap} A witness map containing the circuit's return values.
15
- */
16
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
17
- /**
18
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
19
- *
20
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
21
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
22
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
23
- */
24
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
25
- /**
26
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
27
- *
28
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
29
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
30
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
31
- */
32
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
33
3
  /**
34
4
  * Returns the `BuildInfo` object containing information about how the installed package was built.
35
5
  * @returns {BuildInfo} - Information on how the installed package was built.
@@ -63,6 +33,30 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
63
33
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
64
34
  */
65
35
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
36
+ /**
37
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
38
+ *
39
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
40
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
41
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
42
+ */
43
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
44
+ /**
45
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
46
+ *
47
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
48
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
49
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
50
+ */
51
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
52
+ /**
53
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
54
+ *
55
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
56
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
57
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
58
+ */
59
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
66
60
  /**
67
61
  * Performs a bitwise AND operation between `lhs` and `rhs`
68
62
  */
@@ -116,21 +110,12 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
116
110
  * @returns {WitnessStack} The decompressed witness stack.
117
111
  */
118
112
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
119
-
120
- // Map from witness index to hex string value of witness.
121
- export type WitnessMap = Map<number, string>;
122
-
123
113
  /**
124
- * An execution result containing two witnesses.
125
- * 1. The full solved witness of the execution.
126
- * 2. The return witness which contains the given public return values within the full witness.
114
+ * Sets the package's logging level.
115
+ *
116
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
127
117
  */
128
- export type SolvedAndReturnWitness = {
129
- solvedWitness: WitnessMap;
130
- returnWitness: WitnessMap;
131
- }
132
-
133
-
118
+ export function initLogLevel(filter: string): void;
134
119
 
135
120
  /**
136
121
  * @typedef {Object} BuildInfo - Information about how the installed package was built
@@ -182,18 +167,32 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
182
167
 
183
168
 
184
169
 
170
+ // Map from witness index to hex string value of witness.
171
+ export type WitnessMap = Map<number, string>;
172
+
173
+ /**
174
+ * An execution result containing two witnesses.
175
+ * 1. The full solved witness of the execution.
176
+ * 2. The return witness which contains the given public return values within the full witness.
177
+ */
178
+ export type SolvedAndReturnWitness = {
179
+ solvedWitness: WitnessMap;
180
+ returnWitness: WitnessMap;
181
+ }
182
+
183
+
184
+
185
185
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
186
186
 
187
187
  export interface InitOutput {
188
188
  readonly memory: WebAssembly.Memory;
189
- readonly initLogLevel: (a: number, b: number) => [number, number];
190
- readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
191
- readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
192
- readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
193
189
  readonly buildInfo: () => any;
194
190
  readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
195
191
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
196
192
  readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
193
+ readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
194
+ readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
195
+ readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
197
196
  readonly and: (a: any, b: any) => any;
198
197
  readonly xor: (a: any, b: any) => any;
199
198
  readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
@@ -204,6 +203,7 @@ export interface InitOutput {
204
203
  readonly decompressWitness: (a: number, b: number) => [number, number, number];
205
204
  readonly compressWitnessStack: (a: any) => [number, number, number, number];
206
205
  readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
206
+ readonly initLogLevel: (a: number, b: number) => [number, number];
207
207
  readonly __wbindgen_exn_store: (a: number) => void;
208
208
  readonly __externref_table_alloc: () => number;
209
209
  readonly __wbindgen_export_2: WebAssembly.Table;
@@ -212,9 +212,9 @@ export interface InitOutput {
212
212
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
213
213
  readonly __wbindgen_export_6: WebAssembly.Table;
214
214
  readonly __externref_table_dealloc: (a: number) => void;
215
- readonly closure269_externref_shim: (a: number, b: number, c: any) => void;
216
- readonly closure834_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
217
- readonly closure838_externref_shim: (a: number, b: number, c: any, d: any) => void;
215
+ readonly closure265_externref_shim: (a: number, b: number, c: any) => void;
216
+ readonly closure830_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
217
+ readonly closure834_externref_shim: (a: number, b: number, c: any, d: any) => void;
218
218
  readonly __wbindgen_start: () => void;
219
219
  }
220
220
 
package/web/acvm_js.js CHANGED
@@ -197,24 +197,13 @@ function debugString(val) {
197
197
  // TODO we could test for more things here, like `Set`s and `Map`s.
198
198
  return className;
199
199
  }
200
-
201
- function takeFromExternrefTable0(idx) {
202
- const value = wasm.__wbindgen_export_2.get(idx);
203
- wasm.__externref_table_dealloc(idx);
204
- return value;
205
- }
206
200
  /**
207
- * Sets the package's logging level.
208
- *
209
- * @param {LogLevel} level - The maximum level of logging to be emitted.
201
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
202
+ * @returns {BuildInfo} - Information on how the installed package was built.
210
203
  */
211
- export function initLogLevel(filter) {
212
- const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
213
- const len0 = WASM_VECTOR_LEN;
214
- const ret = wasm.initLogLevel(ptr0, len0);
215
- if (ret[1]) {
216
- throw takeFromExternrefTable0(ret[0]);
217
- }
204
+ export function buildInfo() {
205
+ const ret = wasm.buildInfo();
206
+ return ret;
218
207
  }
219
208
 
220
209
  function passArray8ToWasm0(arg, malloc) {
@@ -223,6 +212,57 @@ function passArray8ToWasm0(arg, malloc) {
223
212
  WASM_VECTOR_LEN = arg.length;
224
213
  return ptr;
225
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
+ function takeFromExternrefTable0(idx) {
262
+ const value = wasm.__wbindgen_export_2.get(idx);
263
+ wasm.__externref_table_dealloc(idx);
264
+ return value;
265
+ }
226
266
  /**
227
267
  * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
228
268
  *
@@ -283,61 +323,6 @@ export function getPublicWitness(program, solved_witness) {
283
323
  return takeFromExternrefTable0(ret[0]);
284
324
  }
285
325
 
286
- /**
287
- * Returns the `BuildInfo` object containing information about how the installed package was built.
288
- * @returns {BuildInfo} - Information on how the installed package was built.
289
- */
290
- export function buildInfo() {
291
- const ret = wasm.buildInfo();
292
- return ret;
293
- }
294
-
295
- /**
296
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
297
- *
298
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
299
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
300
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
301
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
302
- */
303
- export function executeCircuit(program, initial_witness, foreign_call_handler) {
304
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
305
- const len0 = WASM_VECTOR_LEN;
306
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
307
- return ret;
308
- }
309
-
310
- /**
311
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
312
- * This method also extracts the public return values from the solved witness into its own return witness.
313
- *
314
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
315
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
316
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
317
- * @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.
318
- */
319
- export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
320
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
321
- const len0 = WASM_VECTOR_LEN;
322
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
323
- return ret;
324
- }
325
-
326
- /**
327
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
328
- *
329
- * @param {Uint8Array} program - A serialized representation of an ACIR program
330
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
331
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
332
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
333
- */
334
- export function executeProgram(program, initial_witness, foreign_call_handler) {
335
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
336
- const len0 = WASM_VECTOR_LEN;
337
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
338
- return ret;
339
- }
340
-
341
326
  /**
342
327
  * Performs a bitwise AND operation between `lhs` and `rhs`
343
328
  * @param {string} lhs
@@ -522,16 +507,30 @@ export function decompressWitnessStack(compressed_witness) {
522
507
  return takeFromExternrefTable0(ret[0]);
523
508
  }
524
509
 
510
+ /**
511
+ * Sets the package's logging level.
512
+ *
513
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
514
+ */
515
+ export function initLogLevel(filter) {
516
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
517
+ const len0 = WASM_VECTOR_LEN;
518
+ const ret = wasm.initLogLevel(ptr0, len0);
519
+ if (ret[1]) {
520
+ throw takeFromExternrefTable0(ret[0]);
521
+ }
522
+ }
523
+
525
524
  function __wbg_adapter_30(arg0, arg1, arg2) {
526
- wasm.closure269_externref_shim(arg0, arg1, arg2);
525
+ wasm.closure265_externref_shim(arg0, arg1, arg2);
527
526
  }
528
527
 
529
528
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
530
- wasm.closure834_externref_shim(arg0, arg1, arg2, arg3, arg4);
529
+ wasm.closure830_externref_shim(arg0, arg1, arg2, arg3, arg4);
531
530
  }
532
531
 
533
532
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
534
- wasm.closure838_externref_shim(arg0, arg1, arg2, arg3);
533
+ wasm.closure834_externref_shim(arg0, arg1, arg2, arg3);
535
534
  }
536
535
 
537
536
  async function __wbg_load(module, imports) {
@@ -798,7 +797,7 @@ function __wbg_get_imports() {
798
797
  return ret;
799
798
  };
800
799
  imports.wbg.__wbindgen_closure_wrapper739 = function(arg0, arg1, arg2) {
801
- const ret = makeMutClosure(arg0, arg1, 270, __wbg_adapter_30);
800
+ const ret = makeMutClosure(arg0, arg1, 266, __wbg_adapter_30);
802
801
  return ret;
803
802
  };
804
803
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -1,14 +1,13 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
- export const initLogLevel: (a: number, b: number) => [number, number];
5
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
6
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
7
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
8
4
  export const buildInfo: () => any;
9
5
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
6
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
7
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
8
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
9
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
10
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
12
11
  export const and: (a: any, b: any) => any;
13
12
  export const xor: (a: any, b: any) => any;
14
13
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
@@ -19,6 +18,7 @@ export const compressWitness: (a: any) => [number, number, number, number];
19
18
  export const decompressWitness: (a: number, b: number) => [number, number, number];
20
19
  export const compressWitnessStack: (a: any) => [number, number, number, number];
21
20
  export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
21
+ export const initLogLevel: (a: number, b: number) => [number, number];
22
22
  export const __wbindgen_exn_store: (a: number) => void;
23
23
  export const __externref_table_alloc: () => number;
24
24
  export const __wbindgen_export_2: WebAssembly.Table;
@@ -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 closure269_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure834_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure838_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure265_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure830_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure834_externref_shim: (a: number, b: number, c: any, d: any) => void;
33
33
  export const __wbindgen_start: () => void;