@noir-lang/acvm_js 0.47.0-7b77bbf.nightly → 0.47.0-b59a29e.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,67 +1,11 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  /**
4
- * Returns the `BuildInfo` object containing information about how the installed package was built.
5
- * @returns {BuildInfo} - Information on how the installed package was built.
6
- */
7
- export function buildInfo(): BuildInfo;
8
- /**
9
- * Compresses a `WitnessMap` into the binary format outputted by Nargo.
10
- *
11
- * @param {WitnessMap} witness_map - A witness map.
12
- * @returns {Uint8Array} A compressed witness map
13
- */
14
- export function compressWitness(witness_map: WitnessMap): Uint8Array;
15
- /**
16
- * Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
17
- * This should be used to only fetch the witness map for the main function.
18
- *
19
- * @param {Uint8Array} compressed_witness - A compressed witness.
20
- * @returns {WitnessMap} The decompressed witness map.
21
- */
22
- export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
23
- /**
24
- * Compresses a `WitnessStack` into the binary format outputted by Nargo.
25
- *
26
- * @param {WitnessStack} witness_stack - A witness stack.
27
- * @returns {Uint8Array} A compressed witness stack
28
- */
29
- export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
30
- /**
31
- * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
32
- *
33
- * @param {Uint8Array} compressed_witness - A compressed witness.
34
- * @returns {WitnessStack} The decompressed witness stack.
35
- */
36
- export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
37
- /**
38
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
39
- *
40
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
41
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
42
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
43
- * @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
44
- */
45
- export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
46
- /**
47
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
48
- * This method also extracts the public return values from the solved witness into its own return witness.
49
- *
50
- * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
51
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
52
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
53
- * @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.
54
- */
55
- export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
56
- /**
57
- * Executes an ACIR circuit to generate the solved witness from the initial witness.
4
+ * Sets the package's logging level.
58
5
  *
59
- * @param {Uint8Array} program - A serialized representation of an ACIR program
60
- * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
61
- * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
62
- * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
6
+ * @param {LogLevel} level - The maximum level of logging to be emitted.
63
7
  */
64
- export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
8
+ export function initLogLevel(filter: string): void;
65
9
  /**
66
10
  * Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
67
11
  *
@@ -146,11 +90,67 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
146
90
  */
147
91
  export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
148
92
  /**
149
- * Sets the package's logging level.
93
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
150
94
  *
151
- * @param {LogLevel} level - The maximum level of logging to be emitted.
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 {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
152
99
  */
153
- export function initLogLevel(filter: string): void;
100
+ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
101
+ /**
102
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
103
+ * This method also extracts the public return values from the solved witness into its own return witness.
104
+ *
105
+ * @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
106
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
107
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
108
+ * @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.
109
+ */
110
+ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
111
+ /**
112
+ * Executes an ACIR circuit to generate the solved witness from the initial witness.
113
+ *
114
+ * @param {Uint8Array} program - A serialized representation of an ACIR program
115
+ * @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
116
+ * @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
117
+ * @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
118
+ */
119
+ export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
120
+ /**
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
+ * Compresses a `WitnessMap` into the binary format outputted by Nargo.
127
+ *
128
+ * @param {WitnessMap} witness_map - A witness map.
129
+ * @returns {Uint8Array} A compressed witness map
130
+ */
131
+ export function compressWitness(witness_map: WitnessMap): Uint8Array;
132
+ /**
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.
135
+ *
136
+ * @param {Uint8Array} compressed_witness - A compressed witness.
137
+ * @returns {WitnessMap} The decompressed witness map.
138
+ */
139
+ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
140
+ /**
141
+ * Compresses a `WitnessStack` into the binary format outputted by Nargo.
142
+ *
143
+ * @param {WitnessStack} witness_stack - A witness stack.
144
+ * @returns {Uint8Array} A compressed witness stack
145
+ */
146
+ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
147
+ /**
148
+ * Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
149
+ *
150
+ * @param {Uint8Array} compressed_witness - A compressed witness.
151
+ * @returns {WitnessStack} The decompressed witness stack.
152
+ */
153
+ export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
154
154
 
155
155
  /**
156
156
  * @typedef {Object} BuildInfo - Information about how the installed package was built
@@ -166,14 +166,17 @@ export type BuildInfo = {
166
166
 
167
167
 
168
168
 
169
- export type RawAssertionPayload = {
170
- selector: string;
171
- data: string[];
172
- };
173
- export type ExecutionError = Error & {
174
- callStack?: string[];
175
- rawAssertionPayload?: RawAssertionPayload;
176
- };
169
+ export type ForeignCallInput = string[]
170
+ export type ForeignCallOutput = string | string[]
171
+
172
+ /**
173
+ * A callback which performs an foreign call and returns the response.
174
+ * @callback ForeignCallHandler
175
+ * @param {string} name - The identifier for the type of foreign call being performed.
176
+ * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
177
+ * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
178
+ */
179
+ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
177
180
 
178
181
 
179
182
 
@@ -192,6 +195,17 @@ export type SolvedAndReturnWitness = {
192
195
 
193
196
 
194
197
 
198
+ export type RawAssertionPayload = {
199
+ selector: string;
200
+ data: string[];
201
+ };
202
+ export type ExecutionError = Error & {
203
+ callStack?: string[];
204
+ rawAssertionPayload?: RawAssertionPayload;
205
+ };
206
+
207
+
208
+
195
209
  export type StackItem = {
196
210
  index: number;
197
211
  witness: WitnessMap;
@@ -200,17 +214,3 @@ export type StackItem = {
200
214
  export type WitnessStack = Array<StackItem>;
201
215
 
202
216
 
203
-
204
- export type ForeignCallInput = string[]
205
- export type ForeignCallOutput = string | string[]
206
-
207
- /**
208
- * A callback which performs an foreign call and returns the response.
209
- * @callback ForeignCallHandler
210
- * @param {string} name - The identifier for the type of foreign call being performed.
211
- * @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
212
- * @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
213
- */
214
- export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
215
-
216
-