@aztec/noir-acvm_js 4.0.0-nightly.20260125 → 4.0.0-nightly.20260127

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.
@@ -58,36 +58,6 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
58
58
  * Verifies a ECDSA signature over the secp256r1 curve.
59
59
  */
60
60
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
61
- /**
62
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
63
- *
64
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
65
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
66
- * @returns {WitnessMap} A witness map containing the circuit's return values.
67
- */
68
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
69
- /**
70
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
71
- *
72
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
73
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
74
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
75
- */
76
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
77
- /**
78
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
79
- *
80
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
81
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
82
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
83
- */
84
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
85
- /**
86
- * Sets the package's logging level.
87
- *
88
- * @param {LogLevel} level - The maximum level of logging to be emitted.
89
- */
90
- export function initLogLevel(filter: string): void;
91
61
  /**
92
62
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
93
63
  *
@@ -116,6 +86,36 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
116
86
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
117
87
  */
118
88
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
89
+ /**
90
+ * Sets the package's logging level.
91
+ *
92
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
93
+ */
94
+ export function initLogLevel(filter: string): void;
95
+ /**
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.
113
+ *
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.
117
+ */
118
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
119
119
 
120
120
  export type StackItem = {
121
121
  index: number;
@@ -140,6 +140,20 @@ export type BuildInfo = {
140
140
 
141
141
 
142
142
 
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
+
143
157
  // Map from witness index to hex string value of witness.
144
158
  export type WitnessMap = Map<number, string>;
145
159
 
@@ -155,20 +169,6 @@ export type SolvedAndReturnWitness = {
155
169
 
156
170
 
157
171
 
158
- export type RawAssertionPayload = {
159
- selector: string;
160
- data: string[];
161
- };
162
-
163
- export type ExecutionError = Error & {
164
- callStack?: string[];
165
- rawAssertionPayload?: RawAssertionPayload;
166
- acirFunctionId?: number;
167
- brilligFunctionId?: number;
168
- };
169
-
170
-
171
-
172
172
  export type ForeignCallInput = string[]
173
173
  export type ForeignCallOutput = string | string[]
174
174
 
package/nodejs/acvm_js.js CHANGED
@@ -407,63 +407,49 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
407
407
  };
408
408
 
409
409
  /**
410
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
410
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
411
411
  *
412
412
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
413
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
414
- * @returns {WitnessMap} A witness map containing the circuit's return values.
415
- * @param {Uint8Array} program
416
- * @param {WitnessMap} witness_map
417
- * @returns {WitnessMap}
413
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
414
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
415
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
418
416
  */
419
- module.exports.getReturnWitness = function(program, witness_map) {
417
+ module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
420
418
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
421
419
  const len0 = WASM_VECTOR_LEN;
422
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
423
- if (ret[2]) {
424
- throw takeFromExternrefTable0(ret[1]);
425
- }
426
- return takeFromExternrefTable0(ret[0]);
420
+ const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
421
+ return ret;
427
422
  };
428
423
 
429
424
  /**
430
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
425
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
426
+ * This method also extracts the public return values from the solved witness into its own return witness.
431
427
  *
432
428
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
433
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
434
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
435
- * @param {Uint8Array} program
436
- * @param {WitnessMap} solved_witness
437
- * @returns {WitnessMap}
429
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
430
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
431
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
438
432
  */
439
- module.exports.getPublicParametersWitness = function(program, solved_witness) {
433
+ module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
440
434
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
441
435
  const len0 = WASM_VECTOR_LEN;
442
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
443
- if (ret[2]) {
444
- throw takeFromExternrefTable0(ret[1]);
445
- }
446
- return takeFromExternrefTable0(ret[0]);
436
+ const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
437
+ return ret;
447
438
  };
448
439
 
449
440
  /**
450
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
441
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
451
442
  *
452
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
453
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
454
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
455
- * @param {Uint8Array} program
456
- * @param {WitnessMap} solved_witness
457
- * @returns {WitnessMap}
443
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
444
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
445
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
446
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
458
447
  */
459
- module.exports.getPublicWitness = function(program, solved_witness) {
448
+ module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
460
449
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
461
450
  const len0 = WASM_VECTOR_LEN;
462
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
463
- if (ret[2]) {
464
- throw takeFromExternrefTable0(ret[1]);
465
- }
466
- return takeFromExternrefTable0(ret[0]);
451
+ const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
452
+ return ret;
467
453
  };
468
454
 
469
455
  /**
@@ -481,49 +467,63 @@ module.exports.initLogLevel = function(filter) {
481
467
  };
482
468
 
483
469
  /**
484
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
470
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
485
471
  *
486
472
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
487
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
488
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
489
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
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}
490
478
  */
491
- module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
479
+ module.exports.getReturnWitness = function(program, witness_map) {
492
480
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
493
481
  const len0 = WASM_VECTOR_LEN;
494
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
495
- return ret;
482
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
483
+ if (ret[2]) {
484
+ throw takeFromExternrefTable0(ret[1]);
485
+ }
486
+ return takeFromExternrefTable0(ret[0]);
496
487
  };
497
488
 
498
489
  /**
499
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
500
- * This method also extracts the public return values from the solved witness into its own return witness.
490
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
501
491
  *
502
492
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
503
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
504
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
505
- * @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.
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}
506
498
  */
507
- module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
499
+ module.exports.getPublicParametersWitness = function(program, solved_witness) {
508
500
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
509
501
  const len0 = WASM_VECTOR_LEN;
510
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
511
- return ret;
502
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
503
+ if (ret[2]) {
504
+ throw takeFromExternrefTable0(ret[1]);
505
+ }
506
+ return takeFromExternrefTable0(ret[0]);
512
507
  };
513
508
 
514
509
  /**
515
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
510
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
516
511
  *
517
- * @param {Uint8Array} program - A serialized representation of an ACIR program
518
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
519
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
520
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
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}
521
518
  */
522
- module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
519
+ module.exports.getPublicWitness = function(program, solved_witness) {
523
520
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
524
521
  const len0 = WASM_VECTOR_LEN;
525
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
526
- return ret;
522
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
523
+ if (ret[2]) {
524
+ throw takeFromExternrefTable0(ret[1]);
525
+ }
526
+ return takeFromExternrefTable0(ret[0]);
527
527
  };
528
528
 
529
529
  function __wbg_adapter_30(arg0, arg1, arg2) {
@@ -813,7 +813,7 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
813
813
  return ret;
814
814
  };
815
815
 
816
- module.exports.__wbindgen_closure_wrapper1446 = function(arg0, arg1, arg2) {
816
+ module.exports.__wbindgen_closure_wrapper1445 = function(arg0, arg1, arg2) {
817
817
  const ret = makeMutClosure(arg0, arg1, 449, __wbg_adapter_30);
818
818
  return ret;
819
819
  };
Binary file
@@ -12,13 +12,13 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
12
12
  export const blake2s256: (a: number, b: number) => [number, number];
13
13
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
14
14
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
15
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
16
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
17
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
18
- export const initLogLevel: (a: number, b: number) => [number, number];
19
15
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
20
16
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
21
17
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
18
+ export const initLogLevel: (a: number, b: number) => [number, number];
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];
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/noir-acvm_js",
3
- "version": "4.0.0-nightly.20260125",
3
+ "version": "4.0.0-nightly.20260127",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
package/web/acvm_js.d.ts CHANGED
@@ -58,36 +58,6 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
58
58
  * Verifies a ECDSA signature over the secp256r1 curve.
59
59
  */
60
60
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
61
- /**
62
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
63
- *
64
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
65
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
66
- * @returns {WitnessMap} A witness map containing the circuit's return values.
67
- */
68
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
69
- /**
70
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
71
- *
72
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
73
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
74
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
75
- */
76
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
77
- /**
78
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
79
- *
80
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
81
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
82
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
83
- */
84
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
85
- /**
86
- * Sets the package's logging level.
87
- *
88
- * @param {LogLevel} level - The maximum level of logging to be emitted.
89
- */
90
- export function initLogLevel(filter: string): void;
91
61
  /**
92
62
  * Executes an ACIR circuit to generate the solved witness from the initial witness.
93
63
  *
@@ -116,6 +86,36 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
116
86
  * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
117
87
  */
118
88
  export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
89
+ /**
90
+ * Sets the package's logging level.
91
+ *
92
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
93
+ */
94
+ export function initLogLevel(filter: string): void;
95
+ /**
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.
113
+ *
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.
117
+ */
118
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
119
119
 
120
120
  export type StackItem = {
121
121
  index: number;
@@ -140,6 +140,20 @@ export type BuildInfo = {
140
140
 
141
141
 
142
142
 
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
+
143
157
  // Map from witness index to hex string value of witness.
144
158
  export type WitnessMap = Map<number, string>;
145
159
 
@@ -155,20 +169,6 @@ export type SolvedAndReturnWitness = {
155
169
 
156
170
 
157
171
 
158
- export type RawAssertionPayload = {
159
- selector: string;
160
- data: string[];
161
- };
162
-
163
- export type ExecutionError = Error & {
164
- callStack?: string[];
165
- rawAssertionPayload?: RawAssertionPayload;
166
- acirFunctionId?: number;
167
- brilligFunctionId?: number;
168
- };
169
-
170
-
171
-
172
172
  export type ForeignCallInput = string[]
173
173
  export type ForeignCallOutput = string | string[]
174
174
 
@@ -198,13 +198,13 @@ export interface InitOutput {
198
198
  readonly blake2s256: (a: number, b: number) => [number, number];
199
199
  readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
200
200
  readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
201
- readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
202
- readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
203
- readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
204
- readonly initLogLevel: (a: number, b: number) => [number, number];
205
201
  readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
206
202
  readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
207
203
  readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
204
+ readonly initLogLevel: (a: number, b: number) => [number, number];
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];
208
208
  readonly __wbindgen_exn_store: (a: number) => void;
209
209
  readonly __externref_table_alloc: () => number;
210
210
  readonly __wbindgen_export_2: WebAssembly.Table;
package/web/acvm_js.js CHANGED
@@ -403,63 +403,49 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
403
403
  }
404
404
 
405
405
  /**
406
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
406
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
407
407
  *
408
408
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
409
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
410
- * @returns {WitnessMap} A witness map containing the circuit's return values.
411
- * @param {Uint8Array} program
412
- * @param {WitnessMap} witness_map
413
- * @returns {WitnessMap}
409
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
410
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
411
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
414
412
  */
415
- export function getReturnWitness(program, witness_map) {
413
+ export function executeCircuit(program, initial_witness, foreign_call_handler) {
416
414
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
417
415
  const len0 = WASM_VECTOR_LEN;
418
- const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
419
- if (ret[2]) {
420
- throw takeFromExternrefTable0(ret[1]);
421
- }
422
- return takeFromExternrefTable0(ret[0]);
416
+ const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
417
+ return ret;
423
418
  }
424
419
 
425
420
  /**
426
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
421
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
422
+ * This method also extracts the public return values from the solved witness into its own return witness.
427
423
  *
428
424
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
429
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
430
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
431
- * @param {Uint8Array} program
432
- * @param {WitnessMap} solved_witness
433
- * @returns {WitnessMap}
425
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
426
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
427
+ * @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
434
428
  */
435
- export function getPublicParametersWitness(program, solved_witness) {
429
+ export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
436
430
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
437
431
  const len0 = WASM_VECTOR_LEN;
438
- const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
439
- if (ret[2]) {
440
- throw takeFromExternrefTable0(ret[1]);
441
- }
442
- return takeFromExternrefTable0(ret[0]);
432
+ const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
433
+ return ret;
443
434
  }
444
435
 
445
436
  /**
446
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
437
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
447
438
  *
448
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
449
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
450
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
451
- * @param {Uint8Array} program
452
- * @param {WitnessMap} solved_witness
453
- * @returns {WitnessMap}
439
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
440
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
441
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
442
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
454
443
  */
455
- export function getPublicWitness(program, solved_witness) {
444
+ export function executeProgram(program, initial_witness, foreign_call_handler) {
456
445
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
457
446
  const len0 = WASM_VECTOR_LEN;
458
- const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
459
- if (ret[2]) {
460
- throw takeFromExternrefTable0(ret[1]);
461
- }
462
- return takeFromExternrefTable0(ret[0]);
447
+ const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
448
+ return ret;
463
449
  }
464
450
 
465
451
  /**
@@ -477,49 +463,63 @@ export function initLogLevel(filter) {
477
463
  }
478
464
 
479
465
  /**
480
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
466
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
481
467
  *
482
468
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
483
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
484
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
485
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
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}
486
474
  */
487
- export function executeCircuit(program, initial_witness, foreign_call_handler) {
475
+ export function getReturnWitness(program, witness_map) {
488
476
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
489
477
  const len0 = WASM_VECTOR_LEN;
490
- const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
491
- return ret;
478
+ const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
479
+ if (ret[2]) {
480
+ throw takeFromExternrefTable0(ret[1]);
481
+ }
482
+ return takeFromExternrefTable0(ret[0]);
492
483
  }
493
484
 
494
485
  /**
495
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
496
- * This method also extracts the public return values from the solved witness into its own return witness.
486
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
497
487
  *
498
488
  * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
499
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
500
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
501
- * @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.
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}
502
494
  */
503
- export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
495
+ export function getPublicParametersWitness(program, solved_witness) {
504
496
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
505
497
  const len0 = WASM_VECTOR_LEN;
506
- const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
507
- return ret;
498
+ const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
499
+ if (ret[2]) {
500
+ throw takeFromExternrefTable0(ret[1]);
501
+ }
502
+ return takeFromExternrefTable0(ret[0]);
508
503
  }
509
504
 
510
505
  /**
511
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
506
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
512
507
  *
513
- * @param {Uint8Array} program - A serialized representation of an ACIR program
514
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
515
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
516
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
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}
517
514
  */
518
- export function executeProgram(program, initial_witness, foreign_call_handler) {
515
+ export function getPublicWitness(program, solved_witness) {
519
516
  const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
520
517
  const len0 = WASM_VECTOR_LEN;
521
- const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
522
- return ret;
518
+ const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
519
+ if (ret[2]) {
520
+ throw takeFromExternrefTable0(ret[1]);
521
+ }
522
+ return takeFromExternrefTable0(ret[0]);
523
523
  }
524
524
 
525
525
  function __wbg_adapter_30(arg0, arg1, arg2) {
@@ -797,7 +797,7 @@ function __wbg_get_imports() {
797
797
  const ret = false;
798
798
  return ret;
799
799
  };
800
- imports.wbg.__wbindgen_closure_wrapper1446 = function(arg0, arg1, arg2) {
800
+ imports.wbg.__wbindgen_closure_wrapper1445 = function(arg0, arg1, arg2) {
801
801
  const ret = makeMutClosure(arg0, arg1, 449, __wbg_adapter_30);
802
802
  return ret;
803
803
  };
Binary file
@@ -12,13 +12,13 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
12
12
  export const blake2s256: (a: number, b: number) => [number, number];
13
13
  export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
14
14
  export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
15
- export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
16
- export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
17
- export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
18
- export const initLogLevel: (a: number, b: number) => [number, number];
19
15
  export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
20
16
  export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
21
17
  export const executeProgram: (a: number, b: number, c: any, d: any) => any;
18
+ export const initLogLevel: (a: number, b: number) => [number, number];
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];
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;