@aztec/noir-acvm_js 3.0.0-rc.5 → 4.0.0-nightly.20260107

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,5 +1,39 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
5
+ * @returns {BuildInfo} - Information on how the installed package was built.
6
+ */
7
+ export function buildInfo(): BuildInfo;
8
+ /**
9
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
10
+ *
11
+ * @param {WitnessMap} witness_map - A witness map.
12
+ * @returns {Uint8Array} A compressed witness map
13
+ */
14
+ export function compressWitness(witness_map: WitnessMap): Uint8Array;
15
+ /**
16
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
17
+ * This should be used to only fetch the witness map for the main function.
18
+ *
19
+ * @param {Uint8Array} compressed_witness - A compressed witness.
20
+ * @returns {WitnessMap} The decompressed witness map.
21
+ */
22
+ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
23
+ /**
24
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
25
+ *
26
+ * @param {WitnessStack} witness_stack - A witness stack.
27
+ * @returns {Uint8Array} A compressed witness stack
28
+ */
29
+ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
30
+ /**
31
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
32
+ *
33
+ * @param {Uint8Array} compressed_witness - A compressed witness.
34
+ * @returns {WitnessStack} The decompressed witness stack.
35
+ */
36
+ export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
3
37
  /**
4
38
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
5
39
  *
@@ -58,40 +92,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
58
92
  * @returns {WitnessMap} A witness map containing the circuit's public inputs.
59
93
  */
60
94
  export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
61
- /**
62
- * Returns the `BuildInfo` object containing information about how the installed package was built.
63
- * @returns {BuildInfo} - Information on how the installed package was built.
64
- */
65
- export function buildInfo(): BuildInfo;
66
- /**
67
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
68
- *
69
- * @param {WitnessMap} witness_map - A witness map.
70
- * @returns {Uint8Array} A compressed witness map
71
- */
72
- export function compressWitness(witness_map: WitnessMap): Uint8Array;
73
- /**
74
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
75
- * This should be used to only fetch the witness map for the main function.
76
- *
77
- * @param {Uint8Array} compressed_witness - A compressed witness.
78
- * @returns {WitnessMap} The decompressed witness map.
79
- */
80
- export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
81
- /**
82
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
83
- *
84
- * @param {WitnessStack} witness_stack - A witness stack.
85
- * @returns {Uint8Array} A compressed witness stack
86
- */
87
- export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
88
- /**
89
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
90
- *
91
- * @param {Uint8Array} compressed_witness - A compressed witness.
92
- * @returns {WitnessStack} The decompressed witness stack.
93
- */
94
- export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
95
95
  /**
96
96
  * Performs a bitwise AND operation between `lhs` and `rhs`
97
97
  */
@@ -117,6 +117,20 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
117
117
  */
118
118
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
119
119
 
120
+ /**
121
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
122
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
123
+ * @property {string} version - The version of the package at the built git commit.
124
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
125
+ */
126
+ export type BuildInfo = {
127
+ gitHash: string;
128
+ version: string;
129
+ dirty: string;
130
+ }
131
+
132
+
133
+
120
134
  // Map from witness index to hex string value of witness.
121
135
  export type WitnessMap = Map<number, string>;
122
136
 
@@ -168,17 +182,3 @@ export type ExecutionError = Error & {
168
182
  };
169
183
 
170
184
 
171
-
172
- /**
173
- * @typedef {Object} BuildInfo - Information about how the installed package was built
174
- * @property {string} gitHash - The hash of the git commit from which the package was built.
175
- * @property {string} version - The version of the package at the built git commit.
176
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
177
- */
178
- export type BuildInfo = {
179
- gitHash: string;
180
- version: string;
181
- dirty: string;
182
- }
183
-
184
-
package/nodejs/acvm_js.js CHANGED
@@ -201,6 +201,40 @@ 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
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
206
+ * @returns {BuildInfo} - Information on how the installed package was built.
207
+ */
208
+ module.exports.buildInfo = function() {
209
+ const ret = wasm.buildInfo();
210
+ return ret;
211
+ };
212
+
213
+ function takeFromExternrefTable0(idx) {
214
+ const value = wasm.__wbindgen_export_2.get(idx);
215
+ wasm.__externref_table_dealloc(idx);
216
+ return value;
217
+ }
218
+
219
+ function getArrayU8FromWasm0(ptr, len) {
220
+ ptr = ptr >>> 0;
221
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
222
+ }
223
+ /**
224
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
225
+ *
226
+ * @param {WitnessMap} witness_map - A witness map.
227
+ * @returns {Uint8Array} A compressed witness map
228
+ */
229
+ module.exports.compressWitness = function(witness_map) {
230
+ const ret = wasm.compressWitness(witness_map);
231
+ if (ret[3]) {
232
+ throw takeFromExternrefTable0(ret[2]);
233
+ }
234
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
235
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
236
+ return v1;
237
+ };
204
238
 
205
239
  function passArray8ToWasm0(arg, malloc) {
206
240
  const ptr = malloc(arg.length * 1, 1) >>> 0;
@@ -208,6 +242,55 @@ function passArray8ToWasm0(arg, malloc) {
208
242
  WASM_VECTOR_LEN = arg.length;
209
243
  return ptr;
210
244
  }
245
+ /**
246
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
247
+ * This should be used to only fetch the witness map for the main function.
248
+ *
249
+ * @param {Uint8Array} compressed_witness - A compressed witness.
250
+ * @returns {WitnessMap} The decompressed witness map.
251
+ */
252
+ module.exports.decompressWitness = function(compressed_witness) {
253
+ const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
254
+ const len0 = WASM_VECTOR_LEN;
255
+ const ret = wasm.decompressWitness(ptr0, len0);
256
+ if (ret[2]) {
257
+ throw takeFromExternrefTable0(ret[1]);
258
+ }
259
+ return takeFromExternrefTable0(ret[0]);
260
+ };
261
+
262
+ /**
263
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
264
+ *
265
+ * @param {WitnessStack} witness_stack - A witness stack.
266
+ * @returns {Uint8Array} A compressed witness stack
267
+ */
268
+ module.exports.compressWitnessStack = function(witness_stack) {
269
+ const ret = wasm.compressWitnessStack(witness_stack);
270
+ if (ret[3]) {
271
+ throw takeFromExternrefTable0(ret[2]);
272
+ }
273
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
274
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
275
+ return v1;
276
+ };
277
+
278
+ /**
279
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
280
+ *
281
+ * @param {Uint8Array} compressed_witness - A compressed witness.
282
+ * @returns {WitnessStack} The decompressed witness stack.
283
+ */
284
+ module.exports.decompressWitnessStack = function(compressed_witness) {
285
+ const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
286
+ const len0 = WASM_VECTOR_LEN;
287
+ const ret = wasm.decompressWitnessStack(ptr0, len0);
288
+ if (ret[2]) {
289
+ throw takeFromExternrefTable0(ret[1]);
290
+ }
291
+ return takeFromExternrefTable0(ret[0]);
292
+ };
293
+
211
294
  /**
212
295
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
213
296
  *
@@ -254,11 +337,6 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
254
337
  return ret;
255
338
  };
256
339
 
257
- function takeFromExternrefTable0(idx) {
258
- const value = wasm.__wbindgen_export_2.get(idx);
259
- wasm.__externref_table_dealloc(idx);
260
- return value;
261
- }
262
340
  /**
263
341
  * Sets the package's logging level.
264
342
  *
@@ -333,84 +411,6 @@ module.exports.getPublicWitness = function(program, solved_witness) {
333
411
  return takeFromExternrefTable0(ret[0]);
334
412
  };
335
413
 
336
- /**
337
- * Returns the `BuildInfo` object containing information about how the installed package was built.
338
- * @returns {BuildInfo} - Information on how the installed package was built.
339
- */
340
- module.exports.buildInfo = function() {
341
- const ret = wasm.buildInfo();
342
- return ret;
343
- };
344
-
345
- function getArrayU8FromWasm0(ptr, len) {
346
- ptr = ptr >>> 0;
347
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
348
- }
349
- /**
350
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
351
- *
352
- * @param {WitnessMap} witness_map - A witness map.
353
- * @returns {Uint8Array} A compressed witness map
354
- */
355
- module.exports.compressWitness = function(witness_map) {
356
- const ret = wasm.compressWitness(witness_map);
357
- if (ret[3]) {
358
- throw takeFromExternrefTable0(ret[2]);
359
- }
360
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
361
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
362
- return v1;
363
- };
364
-
365
- /**
366
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
367
- * This should be used to only fetch the witness map for the main function.
368
- *
369
- * @param {Uint8Array} compressed_witness - A compressed witness.
370
- * @returns {WitnessMap} The decompressed witness map.
371
- */
372
- module.exports.decompressWitness = function(compressed_witness) {
373
- const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
374
- const len0 = WASM_VECTOR_LEN;
375
- const ret = wasm.decompressWitness(ptr0, len0);
376
- if (ret[2]) {
377
- throw takeFromExternrefTable0(ret[1]);
378
- }
379
- return takeFromExternrefTable0(ret[0]);
380
- };
381
-
382
- /**
383
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
384
- *
385
- * @param {WitnessStack} witness_stack - A witness stack.
386
- * @returns {Uint8Array} A compressed witness stack
387
- */
388
- module.exports.compressWitnessStack = function(witness_stack) {
389
- const ret = wasm.compressWitnessStack(witness_stack);
390
- if (ret[3]) {
391
- throw takeFromExternrefTable0(ret[2]);
392
- }
393
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
394
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
395
- return v1;
396
- };
397
-
398
- /**
399
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
400
- *
401
- * @param {Uint8Array} compressed_witness - A compressed witness.
402
- * @returns {WitnessStack} The decompressed witness stack.
403
- */
404
- module.exports.decompressWitnessStack = function(compressed_witness) {
405
- const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
406
- const len0 = WASM_VECTOR_LEN;
407
- const ret = wasm.decompressWitnessStack(ptr0, len0);
408
- if (ret[2]) {
409
- throw takeFromExternrefTable0(ret[1]);
410
- }
411
- return takeFromExternrefTable0(ret[0]);
412
- };
413
-
414
414
  /**
415
415
  * Performs a bitwise AND operation between `lhs` and `rhs`
416
416
  * @param {string} lhs
@@ -553,12 +553,12 @@ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(fun
553
553
  return ret;
554
554
  }, arguments) };
555
555
 
556
- module.exports.__wbg_constructor_c63bcfd244db473f = function(arg0) {
556
+ module.exports.__wbg_constructor_3aef6db465a4d40f = function(arg0) {
557
557
  const ret = new Error(arg0);
558
558
  return ret;
559
559
  };
560
560
 
561
- module.exports.__wbg_constructor_e54436b6bd1581f7 = function(arg0) {
561
+ module.exports.__wbg_constructor_9cd41836d6991f28 = function(arg0) {
562
562
  const ret = new Error(arg0);
563
563
  return ret;
564
564
  };
@@ -674,11 +674,6 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
674
674
  }
675
675
  };
676
676
 
677
- module.exports.__wbg_new_36c79b224aeafbf0 = function() {
678
- const ret = new Array();
679
- return ret;
680
- };
681
-
682
677
  module.exports.__wbg_new_5e0be73521bc8c17 = function() {
683
678
  const ret = new Map();
684
679
  return ret;
@@ -694,8 +689,8 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
694
689
  return ret;
695
690
  };
696
691
 
697
- module.exports.__wbg_new_c08cf36011667e78 = function() {
698
- const ret = new Map();
692
+ module.exports.__wbg_new_8e773a1674584163 = function() {
693
+ const ret = new Array();
699
694
  return ret;
700
695
  };
701
696
 
@@ -704,6 +699,11 @@ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
704
699
  return ret;
705
700
  };
706
701
 
702
+ module.exports.__wbg_new_dd245daac54dc568 = function() {
703
+ const ret = new Map();
704
+ return ret;
705
+ };
706
+
707
707
  module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
708
708
  const ret = new Function(getStringFromWasm0(arg0, arg1));
709
709
  return ret;
@@ -813,7 +813,7 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
813
813
  return ret;
814
814
  };
815
815
 
816
- module.exports.__wbindgen_closure_wrapper1970 = function(arg0, arg1, arg2) {
816
+ module.exports.__wbindgen_closure_wrapper1971 = function(arg0, arg1, arg2) {
817
817
  const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
818
818
  return ret;
819
819
  };
Binary file
@@ -1,6 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const buildInfo: () => any;
5
+ export const compressWitness: (a: any) => [number, number, number, number];
6
+ export const decompressWitness: (a: number, b: number) => [number, number, number];
7
+ export const compressWitnessStack: (a: any) => [number, number, number, number];
8
+ export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
4
9
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
5
10
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
6
11
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
@@ -8,11 +13,6 @@ export const initLogLevel: (a: number, b: number) => [number, number];
8
13
  export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
9
14
  export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
10
15
  export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
11
- export const buildInfo: () => any;
12
- export const compressWitness: (a: any) => [number, number, number, number];
13
- export const decompressWitness: (a: number, b: number) => [number, number, number];
14
- export const compressWitnessStack: (a: any) => [number, number, number, number];
15
- export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
16
16
  export const and: (a: any, b: any) => any;
17
17
  export const xor: (a: any, b: any) => any;
18
18
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/noir-acvm_js",
3
- "version": "3.0.0-rc.5",
3
+ "version": "4.0.0-nightly.20260107",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -41,11 +41,11 @@
41
41
  "@web/dev-server-esbuild": "^1.0.4",
42
42
  "@web/test-runner": "^0.20.2",
43
43
  "@web/test-runner-playwright": "^0.11.1",
44
- "chai": "^4.4.1",
45
- "eslint": "^9.28.0",
46
- "eslint-plugin-prettier": "^5.4.1",
44
+ "chai": "^4.5.0",
45
+ "eslint": "^9.39.1",
46
+ "eslint-plugin-prettier": "^5.5.4",
47
47
  "mocha": "^11.5.0",
48
- "prettier": "3.5.3",
48
+ "prettier": "3.7.3",
49
49
  "ts-node": "^10.9.2",
50
50
  "typescript": "^5.8.3"
51
51
  }
package/web/acvm_js.d.ts CHANGED
@@ -1,5 +1,39 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
5
+ * @returns {BuildInfo} - Information on how the installed package was built.
6
+ */
7
+ export function buildInfo(): BuildInfo;
8
+ /**
9
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
10
+ *
11
+ * @param {WitnessMap} witness_map - A witness map.
12
+ * @returns {Uint8Array} A compressed witness map
13
+ */
14
+ export function compressWitness(witness_map: WitnessMap): Uint8Array;
15
+ /**
16
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
17
+ * This should be used to only fetch the witness map for the main function.
18
+ *
19
+ * @param {Uint8Array} compressed_witness - A compressed witness.
20
+ * @returns {WitnessMap} The decompressed witness map.
21
+ */
22
+ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
23
+ /**
24
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
25
+ *
26
+ * @param {WitnessStack} witness_stack - A witness stack.
27
+ * @returns {Uint8Array} A compressed witness stack
28
+ */
29
+ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
30
+ /**
31
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
32
+ *
33
+ * @param {Uint8Array} compressed_witness - A compressed witness.
34
+ * @returns {WitnessStack} The decompressed witness stack.
35
+ */
36
+ export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
3
37
  /**
4
38
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
5
39
  *
@@ -58,40 +92,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
58
92
  * @returns {WitnessMap} A witness map containing the circuit's public inputs.
59
93
  */
60
94
  export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
61
- /**
62
- * Returns the `BuildInfo` object containing information about how the installed package was built.
63
- * @returns {BuildInfo} - Information on how the installed package was built.
64
- */
65
- export function buildInfo(): BuildInfo;
66
- /**
67
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
68
- *
69
- * @param {WitnessMap} witness_map - A witness map.
70
- * @returns {Uint8Array} A compressed witness map
71
- */
72
- export function compressWitness(witness_map: WitnessMap): Uint8Array;
73
- /**
74
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
75
- * This should be used to only fetch the witness map for the main function.
76
- *
77
- * @param {Uint8Array} compressed_witness - A compressed witness.
78
- * @returns {WitnessMap} The decompressed witness map.
79
- */
80
- export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
81
- /**
82
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
83
- *
84
- * @param {WitnessStack} witness_stack - A witness stack.
85
- * @returns {Uint8Array} A compressed witness stack
86
- */
87
- export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
88
- /**
89
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
90
- *
91
- * @param {Uint8Array} compressed_witness - A compressed witness.
92
- * @returns {WitnessStack} The decompressed witness stack.
93
- */
94
- export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
95
95
  /**
96
96
  * Performs a bitwise AND operation between `lhs` and `rhs`
97
97
  */
@@ -117,6 +117,20 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
117
117
  */
118
118
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
119
119
 
120
+ /**
121
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
122
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
123
+ * @property {string} version - The version of the package at the built git commit.
124
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
125
+ */
126
+ export type BuildInfo = {
127
+ gitHash: string;
128
+ version: string;
129
+ dirty: string;
130
+ }
131
+
132
+
133
+
120
134
  // Map from witness index to hex string value of witness.
121
135
  export type WitnessMap = Map<number, string>;
122
136
 
@@ -169,24 +183,15 @@ export type ExecutionError = Error & {
169
183
 
170
184
 
171
185
 
172
- /**
173
- * @typedef {Object} BuildInfo - Information about how the installed package was built
174
- * @property {string} gitHash - The hash of the git commit from which the package was built.
175
- * @property {string} version - The version of the package at the built git commit.
176
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
177
- */
178
- export type BuildInfo = {
179
- gitHash: string;
180
- version: string;
181
- dirty: string;
182
- }
183
-
184
-
185
-
186
186
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
187
187
 
188
188
  export interface InitOutput {
189
189
  readonly memory: WebAssembly.Memory;
190
+ readonly buildInfo: () => any;
191
+ readonly compressWitness: (a: any) => [number, number, number, number];
192
+ readonly decompressWitness: (a: number, b: number) => [number, number, number];
193
+ readonly compressWitnessStack: (a: any) => [number, number, number, number];
194
+ readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
190
195
  readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
191
196
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
192
197
  readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
@@ -194,11 +199,6 @@ export interface InitOutput {
194
199
  readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
195
200
  readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
196
201
  readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
197
- readonly buildInfo: () => any;
198
- readonly compressWitness: (a: any) => [number, number, number, number];
199
- readonly decompressWitness: (a: number, b: number) => [number, number, number];
200
- readonly compressWitnessStack: (a: any) => [number, number, number, number];
201
- readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
202
202
  readonly and: (a: any, b: any) => any;
203
203
  readonly xor: (a: any, b: any) => any;
204
204
  readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
package/web/acvm_js.js CHANGED
@@ -197,6 +197,40 @@ 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
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
202
+ * @returns {BuildInfo} - Information on how the installed package was built.
203
+ */
204
+ export function buildInfo() {
205
+ const ret = wasm.buildInfo();
206
+ return ret;
207
+ }
208
+
209
+ function takeFromExternrefTable0(idx) {
210
+ const value = wasm.__wbindgen_export_2.get(idx);
211
+ wasm.__externref_table_dealloc(idx);
212
+ return value;
213
+ }
214
+
215
+ function getArrayU8FromWasm0(ptr, len) {
216
+ ptr = ptr >>> 0;
217
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
218
+ }
219
+ /**
220
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
221
+ *
222
+ * @param {WitnessMap} witness_map - A witness map.
223
+ * @returns {Uint8Array} A compressed witness map
224
+ */
225
+ export function compressWitness(witness_map) {
226
+ const ret = wasm.compressWitness(witness_map);
227
+ if (ret[3]) {
228
+ throw takeFromExternrefTable0(ret[2]);
229
+ }
230
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
231
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
232
+ return v1;
233
+ }
200
234
 
201
235
  function passArray8ToWasm0(arg, malloc) {
202
236
  const ptr = malloc(arg.length * 1, 1) >>> 0;
@@ -204,6 +238,55 @@ function passArray8ToWasm0(arg, malloc) {
204
238
  WASM_VECTOR_LEN = arg.length;
205
239
  return ptr;
206
240
  }
241
+ /**
242
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
243
+ * This should be used to only fetch the witness map for the main function.
244
+ *
245
+ * @param {Uint8Array} compressed_witness - A compressed witness.
246
+ * @returns {WitnessMap} The decompressed witness map.
247
+ */
248
+ export function decompressWitness(compressed_witness) {
249
+ const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
250
+ const len0 = WASM_VECTOR_LEN;
251
+ const ret = wasm.decompressWitness(ptr0, len0);
252
+ if (ret[2]) {
253
+ throw takeFromExternrefTable0(ret[1]);
254
+ }
255
+ return takeFromExternrefTable0(ret[0]);
256
+ }
257
+
258
+ /**
259
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
260
+ *
261
+ * @param {WitnessStack} witness_stack - A witness stack.
262
+ * @returns {Uint8Array} A compressed witness stack
263
+ */
264
+ export function compressWitnessStack(witness_stack) {
265
+ const ret = wasm.compressWitnessStack(witness_stack);
266
+ if (ret[3]) {
267
+ throw takeFromExternrefTable0(ret[2]);
268
+ }
269
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
270
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
271
+ return v1;
272
+ }
273
+
274
+ /**
275
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
276
+ *
277
+ * @param {Uint8Array} compressed_witness - A compressed witness.
278
+ * @returns {WitnessStack} The decompressed witness stack.
279
+ */
280
+ export function decompressWitnessStack(compressed_witness) {
281
+ const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
282
+ const len0 = WASM_VECTOR_LEN;
283
+ const ret = wasm.decompressWitnessStack(ptr0, len0);
284
+ if (ret[2]) {
285
+ throw takeFromExternrefTable0(ret[1]);
286
+ }
287
+ return takeFromExternrefTable0(ret[0]);
288
+ }
289
+
207
290
  /**
208
291
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
209
292
  *
@@ -250,11 +333,6 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
250
333
  return ret;
251
334
  }
252
335
 
253
- function takeFromExternrefTable0(idx) {
254
- const value = wasm.__wbindgen_export_2.get(idx);
255
- wasm.__externref_table_dealloc(idx);
256
- return value;
257
- }
258
336
  /**
259
337
  * Sets the package's logging level.
260
338
  *
@@ -329,84 +407,6 @@ export function getPublicWitness(program, solved_witness) {
329
407
  return takeFromExternrefTable0(ret[0]);
330
408
  }
331
409
 
332
- /**
333
- * Returns the `BuildInfo` object containing information about how the installed package was built.
334
- * @returns {BuildInfo} - Information on how the installed package was built.
335
- */
336
- export function buildInfo() {
337
- const ret = wasm.buildInfo();
338
- return ret;
339
- }
340
-
341
- function getArrayU8FromWasm0(ptr, len) {
342
- ptr = ptr >>> 0;
343
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
344
- }
345
- /**
346
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
347
- *
348
- * @param {WitnessMap} witness_map - A witness map.
349
- * @returns {Uint8Array} A compressed witness map
350
- */
351
- export function compressWitness(witness_map) {
352
- const ret = wasm.compressWitness(witness_map);
353
- if (ret[3]) {
354
- throw takeFromExternrefTable0(ret[2]);
355
- }
356
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
357
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
358
- return v1;
359
- }
360
-
361
- /**
362
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
363
- * This should be used to only fetch the witness map for the main function.
364
- *
365
- * @param {Uint8Array} compressed_witness - A compressed witness.
366
- * @returns {WitnessMap} The decompressed witness map.
367
- */
368
- export function decompressWitness(compressed_witness) {
369
- const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
370
- const len0 = WASM_VECTOR_LEN;
371
- const ret = wasm.decompressWitness(ptr0, len0);
372
- if (ret[2]) {
373
- throw takeFromExternrefTable0(ret[1]);
374
- }
375
- return takeFromExternrefTable0(ret[0]);
376
- }
377
-
378
- /**
379
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
380
- *
381
- * @param {WitnessStack} witness_stack - A witness stack.
382
- * @returns {Uint8Array} A compressed witness stack
383
- */
384
- export function compressWitnessStack(witness_stack) {
385
- const ret = wasm.compressWitnessStack(witness_stack);
386
- if (ret[3]) {
387
- throw takeFromExternrefTable0(ret[2]);
388
- }
389
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
390
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
391
- return v1;
392
- }
393
-
394
- /**
395
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
396
- *
397
- * @param {Uint8Array} compressed_witness - A compressed witness.
398
- * @returns {WitnessStack} The decompressed witness stack.
399
- */
400
- export function decompressWitnessStack(compressed_witness) {
401
- const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
402
- const len0 = WASM_VECTOR_LEN;
403
- const ret = wasm.decompressWitnessStack(ptr0, len0);
404
- if (ret[2]) {
405
- throw takeFromExternrefTable0(ret[1]);
406
- }
407
- return takeFromExternrefTable0(ret[0]);
408
- }
409
-
410
410
  /**
411
411
  * Performs a bitwise AND operation between `lhs` and `rhs`
412
412
  * @param {string} lhs
@@ -580,11 +580,11 @@ function __wbg_get_imports() {
580
580
  const ret = arg0.call(arg1, arg2, arg3);
581
581
  return ret;
582
582
  }, arguments) };
583
- imports.wbg.__wbg_constructor_c63bcfd244db473f = function(arg0) {
583
+ imports.wbg.__wbg_constructor_3aef6db465a4d40f = function(arg0) {
584
584
  const ret = new Error(arg0);
585
585
  return ret;
586
586
  };
587
- imports.wbg.__wbg_constructor_e54436b6bd1581f7 = function(arg0) {
587
+ imports.wbg.__wbg_constructor_9cd41836d6991f28 = function(arg0) {
588
588
  const ret = new Error(arg0);
589
589
  return ret;
590
590
  };
@@ -685,10 +685,6 @@ function __wbg_get_imports() {
685
685
  state0.a = state0.b = 0;
686
686
  }
687
687
  };
688
- imports.wbg.__wbg_new_36c79b224aeafbf0 = function() {
689
- const ret = new Array();
690
- return ret;
691
- };
692
688
  imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
693
689
  const ret = new Map();
694
690
  return ret;
@@ -701,14 +697,18 @@ function __wbg_get_imports() {
701
697
  const ret = new Error();
702
698
  return ret;
703
699
  };
704
- imports.wbg.__wbg_new_c08cf36011667e78 = function() {
705
- const ret = new Map();
700
+ imports.wbg.__wbg_new_8e773a1674584163 = function() {
701
+ const ret = new Array();
706
702
  return ret;
707
703
  };
708
704
  imports.wbg.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
709
705
  const ret = new Error(getStringFromWasm0(arg0, arg1));
710
706
  return ret;
711
707
  };
708
+ imports.wbg.__wbg_new_dd245daac54dc568 = function() {
709
+ const ret = new Map();
710
+ return ret;
711
+ };
712
712
  imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
713
713
  const ret = new Function(getStringFromWasm0(arg0, arg1));
714
714
  return ret;
@@ -797,7 +797,7 @@ function __wbg_get_imports() {
797
797
  const ret = false;
798
798
  return ret;
799
799
  };
800
- imports.wbg.__wbindgen_closure_wrapper1970 = function(arg0, arg1, arg2) {
800
+ imports.wbg.__wbindgen_closure_wrapper1971 = function(arg0, arg1, arg2) {
801
801
  const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
802
802
  return ret;
803
803
  };
Binary file
@@ -1,6 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const buildInfo: () => any;
5
+ export const compressWitness: (a: any) => [number, number, number, number];
6
+ export const decompressWitness: (a: number, b: number) => [number, number, number];
7
+ export const compressWitnessStack: (a: any) => [number, number, number, number];
8
+ export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
4
9
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
5
10
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
6
11
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
@@ -8,11 +13,6 @@ export const initLogLevel: (a: number, b: number) => [number, number];
8
13
  export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
9
14
  export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
10
15
  export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
11
- export const buildInfo: () => any;
12
- export const compressWitness: (a: any) => [number, number, number, number];
13
- export const decompressWitness: (a: number, b: number) => [number, number, number];
14
- export const compressWitnessStack: (a: any) => [number, number, number, number];
15
- export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
16
16
  export const and: (a: any, b: any) => any;
17
17
  export const xor: (a: any, b: any) => any;
18
18
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];