@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.
- package/nodejs/acvm_js.d.ts +98 -98
- package/nodejs/acvm_js.js +200 -200
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +11 -11
- package/package.json +1 -1
- package/web/acvm_js.d.ts +109 -109
- package/web/acvm_js.js +197 -197
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +11 -11
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,72 +1,45 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
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 {
|
|
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
|
|
8
|
+
export function initLogLevel(filter: string): void;
|
|
22
9
|
/**
|
|
23
|
-
*
|
|
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
|
|
13
|
+
export function buildInfo(): BuildInfo;
|
|
31
14
|
/**
|
|
32
|
-
*
|
|
15
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
33
16
|
*
|
|
34
|
-
* @param {
|
|
35
|
-
* @
|
|
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
|
|
20
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
42
21
|
/**
|
|
43
|
-
*
|
|
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}
|
|
46
|
-
* @
|
|
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
|
|
28
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
53
29
|
/**
|
|
54
|
-
*
|
|
30
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
55
31
|
*
|
|
56
|
-
* @param {
|
|
57
|
-
* @
|
|
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
|
|
35
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
64
36
|
/**
|
|
65
|
-
*
|
|
37
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
66
38
|
*
|
|
67
|
-
* @param {
|
|
39
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
40
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
68
41
|
*/
|
|
69
|
-
export function
|
|
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
|
-
*
|
|
122
|
-
*
|
|
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
|
|
101
|
+
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
125
102
|
/**
|
|
126
|
-
*
|
|
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 {
|
|
129
|
-
* @
|
|
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
|
|
111
|
+
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
132
112
|
/**
|
|
133
|
-
*
|
|
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}
|
|
137
|
-
* @
|
|
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
|
|
120
|
+
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
140
121
|
/**
|
|
141
|
-
*
|
|
122
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
142
123
|
*
|
|
143
|
-
* @param {
|
|
144
|
-
* @
|
|
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
|
|
131
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
147
132
|
/**
|
|
148
|
-
*
|
|
133
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
149
134
|
*
|
|
150
|
-
* @param {Uint8Array}
|
|
151
|
-
* @
|
|
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
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
171
|
-
|
|
172
|
-
|
|
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
|
|
175
|
-
|
|
176
|
-
|
|
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
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
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
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
dirty: string;
|
|
211
|
+
export type SolvedAndReturnWitness = {
|
|
212
|
+
solvedWitness: WitnessMap;
|
|
213
|
+
returnWitness: WitnessMap;
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
|