@aztec/noir-acvm_js 0.0.1-fake-ceab37513c → 0.0.6-commit.a2d1860fe9

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,11 +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
3
  /**
10
4
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
11
5
  *
@@ -63,6 +57,30 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
63
57
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
64
58
  */
65
59
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
60
+ /**
61
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
62
+ *
63
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
64
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
65
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
66
+ */
67
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
68
+ /**
69
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
70
+ *
71
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
72
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
73
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
74
+ */
75
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
76
+ /**
77
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
78
+ *
79
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
80
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
81
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
82
+ */
83
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
66
84
  /**
67
85
  * Performs a bitwise AND operation between `lhs` and `rhs`
68
86
  */
@@ -93,29 +111,25 @@ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_byte
93
111
  */
94
112
  export function buildInfo(): BuildInfo;
95
113
  /**
96
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
97
- *
98
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
99
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
100
- * @returns {WitnessMap} A witness map containing the circuit's return values.
101
- */
102
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
103
- /**
104
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
105
- *
106
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
107
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
108
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
109
- */
110
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
111
- /**
112
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
114
+ * Sets the package's logging level.
113
115
  *
114
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
115
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
116
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
116
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
117
117
  */
118
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
118
+ export function initLogLevel(filter: string): void;
119
+
120
+ export type RawAssertionPayload = {
121
+ selector: string;
122
+ data: string[];
123
+ };
124
+
125
+ export type ExecutionError = Error & {
126
+ callStack?: string[];
127
+ rawAssertionPayload?: RawAssertionPayload;
128
+ acirFunctionId?: number;
129
+ brilligFunctionId?: number;
130
+ };
131
+
132
+
119
133
 
120
134
  export type StackItem = {
121
135
  index: number;
@@ -140,20 +154,6 @@ export type BuildInfo = {
140
154
 
141
155
 
142
156
 
143
- export type RawAssertionPayload = {
144
- selector: string;
145
- data: string[];
146
- };
147
-
148
- export type ExecutionError = Error & {
149
- callStack?: string[];
150
- rawAssertionPayload?: RawAssertionPayload;
151
- acirFunctionId?: number;
152
- brilligFunctionId?: number;
153
- };
154
-
155
-
156
-
157
157
  // Map from witness index to hex string value of witness.
158
158
  export type WitnessMap = Map<number, string>;
159
159
 
package/nodejs/acvm_js.js CHANGED
@@ -207,19 +207,6 @@ function takeFromExternrefTable0(idx) {
207
207
  wasm.__externref_table_dealloc(idx);
208
208
  return value;
209
209
  }
210
- /**
211
- * Sets the package's logging level.
212
- *
213
- * @param {LogLevel} level - The maximum level of logging to be emitted.
214
- */
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
- }
222
- };
223
210
 
224
211
  function getArrayU8FromWasm0(ptr, len) {
225
212
  ptr = ptr >>> 0;
@@ -342,6 +329,66 @@ module.exports.executeProgram = function(program, initial_witness, foreign_call_
342
329
  return ret;
343
330
  };
344
331
 
332
+ /**
333
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
334
+ *
335
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
336
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
337
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
338
+ * @param {Uint8Array} program
339
+ * @param {WitnessMap} witness_map
340
+ * @returns {WitnessMap}
341
+ */
342
+ module.exports.getReturnWitness = function(program, witness_map) {
343
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
344
+ const len0 = WASM_VECTOR_LEN;
345
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
346
+ if (ret[2]) {
347
+ throw takeFromExternrefTable0(ret[1]);
348
+ }
349
+ return takeFromExternrefTable0(ret[0]);
350
+ };
351
+
352
+ /**
353
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
354
+ *
355
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
356
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
357
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
358
+ * @param {Uint8Array} program
359
+ * @param {WitnessMap} solved_witness
360
+ * @returns {WitnessMap}
361
+ */
362
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
363
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
364
+ const len0 = WASM_VECTOR_LEN;
365
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
366
+ if (ret[2]) {
367
+ throw takeFromExternrefTable0(ret[1]);
368
+ }
369
+ return takeFromExternrefTable0(ret[0]);
370
+ };
371
+
372
+ /**
373
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
374
+ *
375
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
376
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
377
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
378
+ * @param {Uint8Array} program
379
+ * @param {WitnessMap} solved_witness
380
+ * @returns {WitnessMap}
381
+ */
382
+ module.exports.getPublicWitness = function(program, solved_witness) {
383
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
384
+ const len0 = WASM_VECTOR_LEN;
385
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
386
+ if (ret[2]) {
387
+ throw takeFromExternrefTable0(ret[1]);
388
+ }
389
+ return takeFromExternrefTable0(ret[0]);
390
+ };
391
+
345
392
  /**
346
393
  * Performs a bitwise AND operation between `lhs` and `rhs`
347
394
  * @param {string} lhs
@@ -467,75 +514,29 @@ module.exports.buildInfo = function() {
467
514
  };
468
515
 
469
516
  /**
470
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
471
- *
472
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
473
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
474
- * @returns {WitnessMap} A witness map containing the circuit's return values.
475
- * @param {Uint8Array} program
476
- * @param {WitnessMap} witness_map
477
- * @returns {WitnessMap}
478
- */
479
- module.exports.getReturnWitness = function(program, witness_map) {
480
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
481
- const len0 = WASM_VECTOR_LEN;
482
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
483
- if (ret[2]) {
484
- throw takeFromExternrefTable0(ret[1]);
485
- }
486
- return takeFromExternrefTable0(ret[0]);
487
- };
488
-
489
- /**
490
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
491
- *
492
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
493
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
494
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
495
- * @param {Uint8Array} program
496
- * @param {WitnessMap} solved_witness
497
- * @returns {WitnessMap}
498
- */
499
- module.exports.getPublicParametersWitness = function(program, solved_witness) {
500
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
501
- const len0 = WASM_VECTOR_LEN;
502
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
503
- if (ret[2]) {
504
- throw takeFromExternrefTable0(ret[1]);
505
- }
506
- return takeFromExternrefTable0(ret[0]);
507
- };
508
-
509
- /**
510
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
517
+ * Sets the package's logging level.
511
518
  *
512
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
513
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
514
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
515
- * @param {Uint8Array} program
516
- * @param {WitnessMap} solved_witness
517
- * @returns {WitnessMap}
519
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
518
520
  */
519
- module.exports.getPublicWitness = function(program, solved_witness) {
520
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
521
+ module.exports.initLogLevel = function(filter) {
522
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
521
523
  const len0 = WASM_VECTOR_LEN;
522
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
523
- if (ret[2]) {
524
- throw takeFromExternrefTable0(ret[1]);
524
+ const ret = wasm.initLogLevel(ptr0, len0);
525
+ if (ret[1]) {
526
+ throw takeFromExternrefTable0(ret[0]);
525
527
  }
526
- return takeFromExternrefTable0(ret[0]);
527
528
  };
528
529
 
529
530
  function __wbg_adapter_30(arg0, arg1, arg2) {
530
- wasm.closure571_externref_shim(arg0, arg1, arg2);
531
+ wasm.closure445_externref_shim(arg0, arg1, arg2);
531
532
  }
532
533
 
533
534
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
534
- wasm.closure1165_externref_shim(arg0, arg1, arg2, arg3, arg4);
535
+ wasm.closure924_externref_shim(arg0, arg1, arg2, arg3, arg4);
535
536
  }
536
537
 
537
538
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
538
- wasm.closure1169_externref_shim(arg0, arg1, arg2, arg3);
539
+ wasm.closure928_externref_shim(arg0, arg1, arg2, arg3);
539
540
  }
540
541
 
541
542
  module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
@@ -553,12 +554,12 @@ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(fun
553
554
  return ret;
554
555
  }, arguments) };
555
556
 
556
- module.exports.__wbg_constructor_78d4b46bae4ee3a6 = function(arg0) {
557
+ module.exports.__wbg_constructor_2b49e4454d172081 = function(arg0) {
557
558
  const ret = new Error(arg0);
558
559
  return ret;
559
560
  };
560
561
 
561
- module.exports.__wbg_constructor_e15d65f40a39eb05 = function(arg0) {
562
+ module.exports.__wbg_constructor_dddf0209b25406fd = function(arg0) {
562
563
  const ret = new Error(arg0);
563
564
  return ret;
564
565
  };
@@ -674,6 +675,11 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
674
675
  }
675
676
  };
676
677
 
678
+ module.exports.__wbg_new_2812f5f6a6bd8bcf = function() {
679
+ const ret = new Array();
680
+ return ret;
681
+ };
682
+
677
683
  module.exports.__wbg_new_5e0be73521bc8c17 = function() {
678
684
  const ret = new Map();
679
685
  return ret;
@@ -689,7 +695,7 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
689
695
  return ret;
690
696
  };
691
697
 
692
- module.exports.__wbg_new_95a101145c23dc1d = function() {
698
+ module.exports.__wbg_new_b110592360513189 = function() {
693
699
  const ret = new Map();
694
700
  return ret;
695
701
  };
@@ -699,11 +705,6 @@ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
699
705
  return ret;
700
706
  };
701
707
 
702
- module.exports.__wbg_new_d1312de2c48bf990 = function() {
703
- const ret = new Array();
704
- return ret;
705
- };
706
-
707
708
  module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
708
709
  const ret = new Function(getStringFromWasm0(arg0, arg1));
709
710
  return ret;
@@ -813,8 +814,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
813
814
  return ret;
814
815
  };
815
816
 
816
- module.exports.__wbindgen_closure_wrapper1986 = function(arg0, arg1, arg2) {
817
- const ret = makeMutClosure(arg0, arg1, 572, __wbg_adapter_30);
817
+ module.exports.__wbindgen_closure_wrapper1366 = function(arg0, arg1, arg2) {
818
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_30);
818
819
  return ret;
819
820
  };
820
821
 
Binary file
@@ -1,7 +1,6 @@
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
4
  export const compressWitness: (a: any) => [number, number, number, number];
6
5
  export const decompressWitness: (a: number, b: number) => [number, number, number];
7
6
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -9,6 +8,9 @@ export const decompressWitnessStack: (a: number, b: number) => [number, number,
9
8
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
9
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
10
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
11
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
12
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
13
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
12
14
  export const and: (a: any, b: any) => any;
13
15
  export const xor: (a: any, b: any) => any;
14
16
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
@@ -16,9 +18,7 @@ export const blake2s256: (a: number, b: number) => [number, number];
16
18
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
17
19
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
18
20
  export const buildInfo: () => any;
19
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
20
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
21
- export const getPublicWitness: (a: number, b: number, c: any) => [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 closure571_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure1165_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure1169_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure445_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure924_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure928_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-fake-ceab37513c",
3
+ "version": "0.0.6-commit.a2d1860fe9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,14 +38,14 @@
38
38
  },
39
39
  "devDependencies": {
40
40
  "@esm-bundle/chai": "^4.3.4-fix.0",
41
- "@web/dev-server-esbuild": "^0.3.6",
41
+ "@web/dev-server-esbuild": "^1.0.5",
42
42
  "@web/test-runner": "^0.20.2",
43
- "@web/test-runner-playwright": "^0.11.0",
44
- "chai": "^4.4.1",
45
- "eslint": "^9.28.0",
46
- "eslint-plugin-prettier": "^5.4.1",
47
- "mocha": "^11.5.0",
48
- "prettier": "3.5.3",
43
+ "@web/test-runner-playwright": "^0.11.1",
44
+ "chai": "^6.2.2",
45
+ "eslint": "^10.0.0",
46
+ "eslint-plugin-prettier": "^5.5.5",
47
+ "mocha": "^11.7.5",
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
@@ -1,11 +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
3
  /**
10
4
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
11
5
  *
@@ -63,6 +57,30 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
63
57
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
64
58
  */
65
59
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
60
+ /**
61
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
62
+ *
63
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
64
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
65
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
66
+ */
67
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
68
+ /**
69
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
70
+ *
71
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
72
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
73
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
74
+ */
75
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
76
+ /**
77
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
78
+ *
79
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
80
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
81
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
82
+ */
83
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
66
84
  /**
67
85
  * Performs a bitwise AND operation between `lhs` and `rhs`
68
86
  */
@@ -93,29 +111,25 @@ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_byte
93
111
  */
94
112
  export function buildInfo(): BuildInfo;
95
113
  /**
96
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
97
- *
98
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
99
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
100
- * @returns {WitnessMap} A witness map containing the circuit's return values.
101
- */
102
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
103
- /**
104
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
105
- *
106
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
107
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
108
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
109
- */
110
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
111
- /**
112
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
114
+ * Sets the package's logging level.
113
115
  *
114
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
115
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
116
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
116
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
117
117
  */
118
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
118
+ export function initLogLevel(filter: string): void;
119
+
120
+ export type RawAssertionPayload = {
121
+ selector: string;
122
+ data: string[];
123
+ };
124
+
125
+ export type ExecutionError = Error & {
126
+ callStack?: string[];
127
+ rawAssertionPayload?: RawAssertionPayload;
128
+ acirFunctionId?: number;
129
+ brilligFunctionId?: number;
130
+ };
131
+
132
+
119
133
 
120
134
  export type StackItem = {
121
135
  index: number;
@@ -140,20 +154,6 @@ export type BuildInfo = {
140
154
 
141
155
 
142
156
 
143
- export type RawAssertionPayload = {
144
- selector: string;
145
- data: string[];
146
- };
147
-
148
- export type ExecutionError = Error & {
149
- callStack?: string[];
150
- rawAssertionPayload?: RawAssertionPayload;
151
- acirFunctionId?: number;
152
- brilligFunctionId?: number;
153
- };
154
-
155
-
156
-
157
157
  // Map from witness index to hex string value of witness.
158
158
  export type WitnessMap = Map<number, string>;
159
159
 
@@ -187,7 +187,6 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
187
187
 
188
188
  export interface InitOutput {
189
189
  readonly memory: WebAssembly.Memory;
190
- readonly initLogLevel: (a: number, b: number) => [number, number];
191
190
  readonly compressWitness: (a: any) => [number, number, number, number];
192
191
  readonly decompressWitness: (a: number, b: number) => [number, number, number];
193
192
  readonly compressWitnessStack: (a: any) => [number, number, number, number];
@@ -195,6 +194,9 @@ export interface InitOutput {
195
194
  readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
196
195
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
197
196
  readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
197
+ readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
198
+ readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
199
+ readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
198
200
  readonly and: (a: any, b: any) => any;
199
201
  readonly xor: (a: any, b: any) => any;
200
202
  readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
@@ -202,9 +204,7 @@ export interface InitOutput {
202
204
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
203
205
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
204
206
  readonly buildInfo: () => any;
205
- readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
206
- readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
207
- readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
207
+ readonly initLogLevel: (a: number, b: number) => [number, number];
208
208
  readonly __wbindgen_exn_store: (a: number) => void;
209
209
  readonly __externref_table_alloc: () => number;
210
210
  readonly __wbindgen_export_2: WebAssembly.Table;
@@ -213,9 +213,9 @@ 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 closure571_externref_shim: (a: number, b: number, c: any) => void;
217
- readonly closure1165_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
218
- readonly closure1169_externref_shim: (a: number, b: number, c: any, d: any) => void;
216
+ readonly closure445_externref_shim: (a: number, b: number, c: any) => void;
217
+ readonly closure924_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
218
+ readonly closure928_externref_shim: (a: number, b: number, c: any, d: any) => void;
219
219
  readonly __wbindgen_start: () => void;
220
220
  }
221
221
 
package/web/acvm_js.js CHANGED
@@ -203,19 +203,6 @@ function takeFromExternrefTable0(idx) {
203
203
  wasm.__externref_table_dealloc(idx);
204
204
  return value;
205
205
  }
206
- /**
207
- * Sets the package's logging level.
208
- *
209
- * @param {LogLevel} level - The maximum level of logging to be emitted.
210
- */
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
- }
218
- }
219
206
 
220
207
  function getArrayU8FromWasm0(ptr, len) {
221
208
  ptr = ptr >>> 0;
@@ -338,6 +325,66 @@ export function executeProgram(program, initial_witness, foreign_call_handler) {
338
325
  return ret;
339
326
  }
340
327
 
328
+ /**
329
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
330
+ *
331
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
332
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
333
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
334
+ * @param {Uint8Array} program
335
+ * @param {WitnessMap} witness_map
336
+ * @returns {WitnessMap}
337
+ */
338
+ export function getReturnWitness(program, witness_map) {
339
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
340
+ const len0 = WASM_VECTOR_LEN;
341
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
342
+ if (ret[2]) {
343
+ throw takeFromExternrefTable0(ret[1]);
344
+ }
345
+ return takeFromExternrefTable0(ret[0]);
346
+ }
347
+
348
+ /**
349
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
350
+ *
351
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
352
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
353
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
354
+ * @param {Uint8Array} program
355
+ * @param {WitnessMap} solved_witness
356
+ * @returns {WitnessMap}
357
+ */
358
+ export function getPublicParametersWitness(program, solved_witness) {
359
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
360
+ const len0 = WASM_VECTOR_LEN;
361
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
362
+ if (ret[2]) {
363
+ throw takeFromExternrefTable0(ret[1]);
364
+ }
365
+ return takeFromExternrefTable0(ret[0]);
366
+ }
367
+
368
+ /**
369
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
370
+ *
371
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
372
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
373
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
374
+ * @param {Uint8Array} program
375
+ * @param {WitnessMap} solved_witness
376
+ * @returns {WitnessMap}
377
+ */
378
+ export function getPublicWitness(program, solved_witness) {
379
+ const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
380
+ const len0 = WASM_VECTOR_LEN;
381
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
382
+ if (ret[2]) {
383
+ throw takeFromExternrefTable0(ret[1]);
384
+ }
385
+ return takeFromExternrefTable0(ret[0]);
386
+ }
387
+
341
388
  /**
342
389
  * Performs a bitwise AND operation between `lhs` and `rhs`
343
390
  * @param {string} lhs
@@ -463,75 +510,29 @@ export function buildInfo() {
463
510
  }
464
511
 
465
512
  /**
466
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
467
- *
468
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
469
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
470
- * @returns {WitnessMap} A witness map containing the circuit's return values.
471
- * @param {Uint8Array} program
472
- * @param {WitnessMap} witness_map
473
- * @returns {WitnessMap}
474
- */
475
- export function getReturnWitness(program, witness_map) {
476
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
477
- const len0 = WASM_VECTOR_LEN;
478
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
479
- if (ret[2]) {
480
- throw takeFromExternrefTable0(ret[1]);
481
- }
482
- return takeFromExternrefTable0(ret[0]);
483
- }
484
-
485
- /**
486
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
487
- *
488
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
489
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
490
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
491
- * @param {Uint8Array} program
492
- * @param {WitnessMap} solved_witness
493
- * @returns {WitnessMap}
494
- */
495
- export function getPublicParametersWitness(program, solved_witness) {
496
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
497
- const len0 = WASM_VECTOR_LEN;
498
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
499
- if (ret[2]) {
500
- throw takeFromExternrefTable0(ret[1]);
501
- }
502
- return takeFromExternrefTable0(ret[0]);
503
- }
504
-
505
- /**
506
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
513
+ * Sets the package's logging level.
507
514
  *
508
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
509
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
510
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
511
- * @param {Uint8Array} program
512
- * @param {WitnessMap} solved_witness
513
- * @returns {WitnessMap}
515
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
514
516
  */
515
- export function getPublicWitness(program, solved_witness) {
516
- const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
517
+ export function initLogLevel(filter) {
518
+ const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
517
519
  const len0 = WASM_VECTOR_LEN;
518
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
519
- if (ret[2]) {
520
- throw takeFromExternrefTable0(ret[1]);
520
+ const ret = wasm.initLogLevel(ptr0, len0);
521
+ if (ret[1]) {
522
+ throw takeFromExternrefTable0(ret[0]);
521
523
  }
522
- return takeFromExternrefTable0(ret[0]);
523
524
  }
524
525
 
525
526
  function __wbg_adapter_30(arg0, arg1, arg2) {
526
- wasm.closure571_externref_shim(arg0, arg1, arg2);
527
+ wasm.closure445_externref_shim(arg0, arg1, arg2);
527
528
  }
528
529
 
529
530
  function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
530
- wasm.closure1165_externref_shim(arg0, arg1, arg2, arg3, arg4);
531
+ wasm.closure924_externref_shim(arg0, arg1, arg2, arg3, arg4);
531
532
  }
532
533
 
533
534
  function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
534
- wasm.closure1169_externref_shim(arg0, arg1, arg2, arg3);
535
+ wasm.closure928_externref_shim(arg0, arg1, arg2, arg3);
535
536
  }
536
537
 
537
538
  async function __wbg_load(module, imports) {
@@ -580,11 +581,11 @@ function __wbg_get_imports() {
580
581
  const ret = arg0.call(arg1, arg2, arg3);
581
582
  return ret;
582
583
  }, arguments) };
583
- imports.wbg.__wbg_constructor_78d4b46bae4ee3a6 = function(arg0) {
584
+ imports.wbg.__wbg_constructor_2b49e4454d172081 = function(arg0) {
584
585
  const ret = new Error(arg0);
585
586
  return ret;
586
587
  };
587
- imports.wbg.__wbg_constructor_e15d65f40a39eb05 = function(arg0) {
588
+ imports.wbg.__wbg_constructor_dddf0209b25406fd = function(arg0) {
588
589
  const ret = new Error(arg0);
589
590
  return ret;
590
591
  };
@@ -685,6 +686,10 @@ function __wbg_get_imports() {
685
686
  state0.a = state0.b = 0;
686
687
  }
687
688
  };
689
+ imports.wbg.__wbg_new_2812f5f6a6bd8bcf = function() {
690
+ const ret = new Array();
691
+ return ret;
692
+ };
688
693
  imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
689
694
  const ret = new Map();
690
695
  return ret;
@@ -697,7 +702,7 @@ function __wbg_get_imports() {
697
702
  const ret = new Error();
698
703
  return ret;
699
704
  };
700
- imports.wbg.__wbg_new_95a101145c23dc1d = function() {
705
+ imports.wbg.__wbg_new_b110592360513189 = function() {
701
706
  const ret = new Map();
702
707
  return ret;
703
708
  };
@@ -705,10 +710,6 @@ function __wbg_get_imports() {
705
710
  const ret = new Error(getStringFromWasm0(arg0, arg1));
706
711
  return ret;
707
712
  };
708
- imports.wbg.__wbg_new_d1312de2c48bf990 = function() {
709
- const ret = new Array();
710
- return ret;
711
- };
712
713
  imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
713
714
  const ret = new Function(getStringFromWasm0(arg0, arg1));
714
715
  return ret;
@@ -797,8 +798,8 @@ function __wbg_get_imports() {
797
798
  const ret = false;
798
799
  return ret;
799
800
  };
800
- imports.wbg.__wbindgen_closure_wrapper1986 = function(arg0, arg1, arg2) {
801
- const ret = makeMutClosure(arg0, arg1, 572, __wbg_adapter_30);
801
+ imports.wbg.__wbindgen_closure_wrapper1366 = function(arg0, arg1, arg2) {
802
+ const ret = makeMutClosure(arg0, arg1, 446, __wbg_adapter_30);
802
803
  return ret;
803
804
  };
804
805
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
Binary file
@@ -1,7 +1,6 @@
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
4
  export const compressWitness: (a: any) => [number, number, number, number];
6
5
  export const decompressWitness: (a: number, b: number) => [number, number, number];
7
6
  export const compressWitnessStack: (a: any) => [number, number, number, number];
@@ -9,6 +8,9 @@ export const decompressWitnessStack: (a: number, b: number) => [number, number,
9
8
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
10
9
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
11
10
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
11
+ export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
12
+ export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
13
+ export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
12
14
  export const and: (a: any, b: any) => any;
13
15
  export const xor: (a: any, b: any) => any;
14
16
  export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
@@ -16,9 +18,7 @@ export const blake2s256: (a: number, b: number) => [number, number];
16
18
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
17
19
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
18
20
  export const buildInfo: () => any;
19
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
20
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
21
- export const getPublicWitness: (a: number, b: number, c: any) => [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 closure571_externref_shim: (a: number, b: number, c: any) => void;
31
- export const closure1165_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
- export const closure1169_externref_shim: (a: number, b: number, c: any, d: any) => void;
30
+ export const closure445_externref_shim: (a: number, b: number, c: any) => void;
31
+ export const closure924_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
32
+ export const closure928_externref_shim: (a: number, b: number, c: any, d: any) => void;
33
33
  export const __wbindgen_start: () => void;