@noir-lang/acvm_js 0.47.0-e100017.nightly → 0.47.0-ec728dd.nightly

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,72 +1,45 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
5
- *
6
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
7
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
8
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
9
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
10
- */
11
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
12
- /**
13
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
14
- * This method also extracts the public return values from the solved witness into its own return witness.
4
+ * Sets the package's logging level.
15
5
  *
16
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
17
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
18
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
19
- * @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.
6
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
20
7
  */
21
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
8
+ export function initLogLevel(filter: string): void;
22
9
  /**
23
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
24
- *
25
- * @param {Uint8Array} program - A serialized representation of an ACIR program
26
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
27
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
28
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
10
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
11
+ * @returns {BuildInfo} - Information on how the installed package was built.
29
12
  */
30
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
13
+ export function buildInfo(): BuildInfo;
31
14
  /**
32
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
15
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
33
16
  *
34
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
35
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
36
- * @returns {WitnessMap} A witness map containing the circuit's return values.
37
- * @param {Uint8Array} program
38
- * @param {WitnessMap} witness_map
39
- * @returns {WitnessMap}
17
+ * @param {WitnessMap} witness_map - A witness map.
18
+ * @returns {Uint8Array} A compressed witness map
40
19
  */
41
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
20
+ export function compressWitness(witness_map: WitnessMap): Uint8Array;
42
21
  /**
43
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
22
+ * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
23
+ * This should be used to only fetch the witness map for the main function.
44
24
  *
45
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
46
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
47
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
48
- * @param {Uint8Array} program
49
- * @param {WitnessMap} solved_witness
50
- * @returns {WitnessMap}
25
+ * @param {Uint8Array} compressed_witness - A compressed witness.
26
+ * @returns {WitnessMap} The decompressed witness map.
51
27
  */
52
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
28
+ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
53
29
  /**
54
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
30
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
55
31
  *
56
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
57
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
58
- * @returns {WitnessMap} A witness map containing the circuit's public inputs.
59
- * @param {Uint8Array} program
60
- * @param {WitnessMap} solved_witness
61
- * @returns {WitnessMap}
32
+ * @param {WitnessStack} witness_stack - A witness stack.
33
+ * @returns {Uint8Array} A compressed witness stack
62
34
  */
63
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
35
+ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
64
36
  /**
65
- * Sets the package's logging level.
37
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
66
38
  *
67
- * @param {LogLevel} level - The maximum level of logging to be emitted.
39
+ * @param {Uint8Array} compressed_witness - A compressed witness.
40
+ * @returns {WitnessStack} The decompressed witness stack.
68
41
  */
69
- export function initLogLevel(filter: string): void;
42
+ export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
70
43
  /**
71
44
  * Performs a bitwise AND operation between `lhs` and `rhs`
72
45
  * @param {string} lhs
@@ -118,62 +91,77 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
118
91
  */
119
92
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
120
93
  /**
121
- * Returns the `BuildInfo` object containing information about how the installed package was built.
122
- * @returns {BuildInfo} - Information on how the installed package was built.
94
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
95
+ *
96
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
97
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
98
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
99
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
123
100
  */
124
- export function buildInfo(): BuildInfo;
101
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
125
102
  /**
126
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
103
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
104
+ * This method also extracts the public return values from the solved witness into its own return witness.
127
105
  *
128
- * @param {WitnessMap} witness_map - A witness map.
129
- * @returns {Uint8Array} A compressed witness map
106
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
107
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
108
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
109
+ * @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.
130
110
  */
131
- export function compressWitness(witness_map: WitnessMap): Uint8Array;
111
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
132
112
  /**
133
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
134
- * This should be used to only fetch the witness map for the main function.
113
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
135
114
  *
136
- * @param {Uint8Array} compressed_witness - A compressed witness.
137
- * @returns {WitnessMap} The decompressed witness map.
115
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
116
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
117
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
118
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
138
119
  */
139
- export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
120
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
140
121
  /**
141
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
122
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
142
123
  *
143
- * @param {WitnessStack} witness_stack - A witness stack.
144
- * @returns {Uint8Array} A compressed witness stack
124
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
125
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
126
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
127
+ * @param {Uint8Array} program
128
+ * @param {WitnessMap} witness_map
129
+ * @returns {WitnessMap}
145
130
  */
146
- export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
131
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
147
132
  /**
148
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
133
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
149
134
  *
150
- * @param {Uint8Array} compressed_witness - A compressed witness.
151
- * @returns {WitnessStack} The decompressed witness stack.
135
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
136
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
137
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
138
+ * @param {Uint8Array} program
139
+ * @param {WitnessMap} solved_witness
140
+ * @returns {WitnessMap}
152
141
  */
153
- export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
154
-
155
- export type RawAssertionPayload = {
156
- selector: string;
157
- data: string[];
158
- };
159
- export type ExecutionError = Error & {
160
- callStack?: string[];
161
- rawAssertionPayload?: RawAssertionPayload;
162
- };
163
-
164
-
165
-
166
- // Map from witness index to hex string value of witness.
167
- export type WitnessMap = Map<number, string>;
142
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
143
+ /**
144
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
145
+ *
146
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
147
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
148
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
149
+ * @param {Uint8Array} program
150
+ * @param {WitnessMap} solved_witness
151
+ * @returns {WitnessMap}
152
+ */
153
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
168
154
 
169
155
  /**
170
- * An execution result containing two witnesses.
171
- * 1. The full solved witness of the execution.
172
- * 2. The return witness which contains the given public return values within the full witness.
156
+ * @typedef {Object} BuildInfo - Information about how the installed package was built
157
+ * @property {string} gitHash - The hash of the git commit from which the package was built.
158
+ * @property {string} version - The version of the package at the built git commit.
159
+ * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
173
160
  */
174
- export type SolvedAndReturnWitness = {
175
- solvedWitness: WitnessMap;
176
- returnWitness: WitnessMap;
161
+ export type BuildInfo = {
162
+ gitHash: string;
163
+ version: string;
164
+ dirty: string;
177
165
  }
178
166
 
179
167
 
@@ -201,16 +189,28 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
201
189
 
202
190
 
203
191
 
192
+ export type RawAssertionPayload = {
193
+ selector: string;
194
+ data: string[];
195
+ };
196
+ export type ExecutionError = Error & {
197
+ callStack?: string[];
198
+ rawAssertionPayload?: RawAssertionPayload;
199
+ };
200
+
201
+
202
+
203
+ // Map from witness index to hex string value of witness.
204
+ export type WitnessMap = Map<number, string>;
205
+
204
206
  /**
205
- * @typedef {Object} BuildInfo - Information about how the installed package was built
206
- * @property {string} gitHash - The hash of the git commit from which the package was built.
207
- * @property {string} version - The version of the package at the built git commit.
208
- * @property {boolean} dirty - Whether the package contained uncommitted changes when built.
207
+ * An execution result containing two witnesses.
208
+ * 1. The full solved witness of the execution.
209
+ * 2. The return witness which contains the given public return values within the full witness.
209
210
  */
210
- export type BuildInfo = {
211
- gitHash: string;
212
- version: string;
213
- dirty: string;
211
+ export type SolvedAndReturnWitness = {
212
+ solvedWitness: WitnessMap;
213
+ returnWitness: WitnessMap;
214
214
  }
215
215
 
216
216