@noir-lang/acvm_js 1.0.0-beta.0 → 1.0.0-beta.0-1e965bc.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 +81 -81
- package/nodejs/acvm_js.js +153 -153
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +9 -9
- package/package.json +1 -1
- package/web/acvm_js.d.ts +90 -90
- package/web/acvm_js.js +149 -149
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +9 -9
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,34 +1,49 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Sets the package's logging level.
|
|
5
5
|
*
|
|
6
|
-
* @param {
|
|
7
|
-
* @returns {Uint8Array} A compressed witness map
|
|
6
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
8
7
|
*/
|
|
9
|
-
export function
|
|
8
|
+
export function initLogLevel(filter: string): void;
|
|
10
9
|
/**
|
|
11
|
-
*
|
|
12
|
-
* This should be used to only fetch the witness map for the main function.
|
|
10
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
13
11
|
*
|
|
14
|
-
* @param {Uint8Array}
|
|
15
|
-
* @
|
|
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}
|
|
16
18
|
*/
|
|
17
|
-
export function
|
|
19
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
18
20
|
/**
|
|
19
|
-
*
|
|
21
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
20
22
|
*
|
|
21
|
-
* @param {
|
|
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}
|
|
23
29
|
*/
|
|
24
|
-
export function
|
|
30
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
25
31
|
/**
|
|
26
|
-
*
|
|
32
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
27
33
|
*
|
|
28
|
-
* @param {Uint8Array}
|
|
29
|
-
* @
|
|
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}
|
|
30
40
|
*/
|
|
31
|
-
export function
|
|
41
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
44
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
45
|
+
*/
|
|
46
|
+
export function buildInfo(): BuildInfo;
|
|
32
47
|
/**
|
|
33
48
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
34
49
|
*
|
|
@@ -103,61 +118,60 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
103
118
|
*/
|
|
104
119
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
105
120
|
/**
|
|
106
|
-
*
|
|
107
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
108
|
-
*/
|
|
109
|
-
export function buildInfo(): BuildInfo;
|
|
110
|
-
/**
|
|
111
|
-
* Sets the package's logging level.
|
|
121
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
112
122
|
*
|
|
113
|
-
* @param {
|
|
123
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
124
|
+
* @returns {Uint8Array} A compressed witness map
|
|
114
125
|
*/
|
|
115
|
-
export function
|
|
126
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
116
127
|
/**
|
|
117
|
-
*
|
|
128
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
129
|
+
* This should be used to only fetch the witness map for the main function.
|
|
118
130
|
*
|
|
119
|
-
* @param {Uint8Array}
|
|
120
|
-
* @
|
|
121
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
122
|
-
* @param {Uint8Array} program
|
|
123
|
-
* @param {WitnessMap} witness_map
|
|
124
|
-
* @returns {WitnessMap}
|
|
131
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
132
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
125
133
|
*/
|
|
126
|
-
export function
|
|
134
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
127
135
|
/**
|
|
128
|
-
*
|
|
136
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
129
137
|
*
|
|
130
|
-
* @param {
|
|
131
|
-
* @
|
|
132
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
133
|
-
* @param {Uint8Array} program
|
|
134
|
-
* @param {WitnessMap} solved_witness
|
|
135
|
-
* @returns {WitnessMap}
|
|
138
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
139
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
136
140
|
*/
|
|
137
|
-
export function
|
|
141
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
138
142
|
/**
|
|
139
|
-
*
|
|
143
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
140
144
|
*
|
|
141
|
-
* @param {Uint8Array}
|
|
142
|
-
* @
|
|
143
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
144
|
-
* @param {Uint8Array} program
|
|
145
|
-
* @param {WitnessMap} solved_witness
|
|
146
|
-
* @returns {WitnessMap}
|
|
145
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
146
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
147
147
|
*/
|
|
148
|
-
export function
|
|
148
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
149
|
+
|
|
150
|
+
export type RawAssertionPayload = {
|
|
151
|
+
selector: string;
|
|
152
|
+
data: string[];
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export type ExecutionError = Error & {
|
|
156
|
+
callStack?: string[];
|
|
157
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
158
|
+
brilligFunctionId?: number;
|
|
159
|
+
};
|
|
160
|
+
|
|
149
161
|
|
|
150
|
-
|
|
151
|
-
|
|
162
|
+
|
|
163
|
+
// Map from witness index to hex string value of witness.
|
|
164
|
+
export type WitnessMap = Map<number, string>;
|
|
152
165
|
|
|
153
166
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
167
|
+
* An execution result containing two witnesses.
|
|
168
|
+
* 1. The full solved witness of the execution.
|
|
169
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
170
|
+
*/
|
|
171
|
+
export type SolvedAndReturnWitness = {
|
|
172
|
+
solvedWitness: WitnessMap;
|
|
173
|
+
returnWitness: WitnessMap;
|
|
174
|
+
}
|
|
161
175
|
|
|
162
176
|
|
|
163
177
|
|
|
@@ -184,30 +198,16 @@ export type BuildInfo = {
|
|
|
184
198
|
|
|
185
199
|
|
|
186
200
|
|
|
187
|
-
export type
|
|
188
|
-
|
|
189
|
-
data: string[];
|
|
190
|
-
};
|
|
191
|
-
|
|
192
|
-
export type ExecutionError = Error & {
|
|
193
|
-
callStack?: string[];
|
|
194
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
195
|
-
brilligFunctionId?: number;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
// Map from witness index to hex string value of witness.
|
|
201
|
-
export type WitnessMap = Map<number, string>;
|
|
201
|
+
export type ForeignCallInput = string[]
|
|
202
|
+
export type ForeignCallOutput = string | string[]
|
|
202
203
|
|
|
203
204
|
/**
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
}
|
|
205
|
+
* A callback which performs an foreign call and returns the response.
|
|
206
|
+
* @callback ForeignCallHandler
|
|
207
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
208
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
209
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
210
|
+
*/
|
|
211
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
212
212
|
|
|
213
213
|
|