@noir-lang/acvm_js 0.48.0 → 0.49.0-21425de.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,73 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Sets the package's logging level.
5
- *
6
- * @param {LogLevel} level - The maximum level of logging to be emitted.
7
- */
8
- export function initLogLevel(filter: string): void;
9
- /**
10
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
11
- *
12
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
13
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
14
- * @returns {WitnessMap} A witness map containing the circuit's return values.
15
- * @param {Uint8Array} program
16
- * @param {WitnessMap} witness_map
17
- * @returns {WitnessMap}
18
- */
19
- export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
20
- /**
21
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
22
- *
23
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
24
- * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
25
- * @returns {WitnessMap} A witness map containing the circuit's public parameters.
26
- * @param {Uint8Array} program
27
- * @param {WitnessMap} solved_witness
28
- * @returns {WitnessMap}
29
- */
30
- export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
31
- /**
32
- * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
33
- *
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 public inputs.
37
- * @param {Uint8Array} program
38
- * @param {WitnessMap} solved_witness
39
- * @returns {WitnessMap}
40
- */
41
- export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
42
- /**
43
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
44
- *
45
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
46
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
47
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
48
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
49
- */
50
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
51
- /**
52
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
53
- * This method also extracts the public return values from the solved witness into its own return witness.
54
- *
55
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
56
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
57
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
58
- * @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.
59
- */
60
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
61
- /**
62
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
63
- *
64
- * @param {Uint8Array} program - A serialized representation of an ACIR program
65
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
66
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
67
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
68
- */
69
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
70
- /**
71
4
  * Performs a bitwise AND operation between `lhs` and `rhs`
72
5
  * @param {string} lhs
73
6
  * @param {string} rhs
@@ -118,11 +51,6 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
118
51
  */
119
52
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
120
53
  /**
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.
123
- */
124
- export function buildInfo(): BuildInfo;
125
- /**
126
54
  * Compresses a `WitnessMap` into the binary format outputted by Nargo.
127
55
  *
128
56
  * @param {WitnessMap} witness_map - A witness map.
@@ -151,24 +79,90 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
151
79
  * @returns {WitnessStack} The decompressed witness stack.
152
80
  */
153
81
  export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
82
+ /**
83
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
84
+ *
85
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
86
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
87
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
88
+ * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
89
+ */
90
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
91
+ /**
92
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
93
+ * This method also extracts the public return values from the solved witness into its own return witness.
94
+ *
95
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
96
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
97
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
98
+ * @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.
99
+ */
100
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
101
+ /**
102
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
103
+ *
104
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
105
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
106
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
107
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
108
+ */
109
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
110
+ /**
111
+ * Returns the `BuildInfo` object containing information about how the installed package was built.
112
+ * @returns {BuildInfo} - Information on how the installed package was built.
113
+ */
114
+ export function buildInfo(): BuildInfo;
115
+ /**
116
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
117
+ *
118
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
119
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
120
+ * @returns {WitnessMap} A witness map containing the circuit's return values.
121
+ * @param {Uint8Array} program
122
+ * @param {WitnessMap} witness_map
123
+ * @returns {WitnessMap}
124
+ */
125
+ export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
126
+ /**
127
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
128
+ *
129
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
130
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
131
+ * @returns {WitnessMap} A witness map containing the circuit's public parameters.
132
+ * @param {Uint8Array} program
133
+ * @param {WitnessMap} solved_witness
134
+ * @returns {WitnessMap}
135
+ */
136
+ export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
137
+ /**
138
+ * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
139
+ *
140
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
141
+ * @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
142
+ * @returns {WitnessMap} A witness map containing the circuit's public inputs.
143
+ * @param {Uint8Array} program
144
+ * @param {WitnessMap} solved_witness
145
+ * @returns {WitnessMap}
146
+ */
147
+ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
148
+ /**
149
+ * Sets the package's logging level.
150
+ *
151
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
152
+ */
153
+ export function initLogLevel(filter: string): void;
154
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
- export type StackItem = {
167
- index: number;
168
- witness: WitnessMap;
169
- }
155
+ export type ForeignCallInput = string[]
156
+ export type ForeignCallOutput = string | string[]
170
157
 
171
- export type WitnessStack = Array<StackItem>;
158
+ /**
159
+ * A callback which performs an foreign call and returns the response.
160
+ * @callback ForeignCallHandler
161
+ * @param {string} name - The identifier for the type of foreign call being performed.
162
+ * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
163
+ * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
164
+ */
165
+ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
172
166
 
173
167
 
174
168
 
@@ -186,17 +180,25 @@ export type BuildInfo = {
186
180
 
187
181
 
188
182
 
189
- export type ForeignCallInput = string[]
190
- export type ForeignCallOutput = string | string[]
183
+ export type RawAssertionPayload = {
184
+ selector: string;
185
+ data: string[];
186
+ };
191
187
 
192
- /**
193
- * A callback which performs an foreign call and returns the response.
194
- * @callback ForeignCallHandler
195
- * @param {string} name - The identifier for the type of foreign call being performed.
196
- * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
197
- * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
198
- */
199
- export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
188
+ export type ExecutionError = Error & {
189
+ callStack?: string[];
190
+ rawAssertionPayload?: RawAssertionPayload;
191
+ brilligFunctionId?: number;
192
+ };
193
+
194
+
195
+
196
+ export type StackItem = {
197
+ index: number;
198
+ witness: WitnessMap;
199
+ }
200
+
201
+ export type WitnessStack = Array<StackItem>;
200
202
 
201
203
 
202
204