@noir-lang/acvm_js 0.54.0 → 0.55.0
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 +88 -88
- package/nodejs/acvm_js.js +177 -177
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +14 -14
- package/package.json +1 -1
- package/web/acvm_js.d.ts +102 -102
- package/web/acvm_js.js +176 -176
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +14 -14
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,44 +1,62 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
5
5
|
*
|
|
6
|
-
* @param {
|
|
6
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
7
|
+
* @returns {Uint8Array} A compressed witness map
|
|
7
8
|
*/
|
|
8
|
-
export function
|
|
9
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
12
|
+
* This should be used to only fetch the witness map for the main function.
|
|
11
13
|
*
|
|
12
|
-
* @param {Uint8Array}
|
|
13
|
-
* @
|
|
14
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
15
|
-
* @param {Uint8Array} program
|
|
16
|
-
* @param {WitnessMap} witness_map
|
|
17
|
-
* @returns {WitnessMap}
|
|
14
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
15
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
18
16
|
*/
|
|
19
|
-
export function
|
|
17
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
20
18
|
/**
|
|
21
|
-
*
|
|
19
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
20
|
+
*
|
|
21
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
22
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
23
|
+
*/
|
|
24
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
25
|
+
/**
|
|
26
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
27
|
+
*
|
|
28
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
29
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
30
|
+
*/
|
|
31
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
32
|
+
/**
|
|
33
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
22
34
|
*
|
|
23
35
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
24
|
-
* @param {WitnessMap}
|
|
25
|
-
* @
|
|
26
|
-
* @
|
|
27
|
-
* @param {WitnessMap} solved_witness
|
|
28
|
-
* @returns {WitnessMap}
|
|
36
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
37
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
38
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
29
39
|
*/
|
|
30
|
-
export function
|
|
40
|
+
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
31
41
|
/**
|
|
32
|
-
*
|
|
42
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
43
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
33
44
|
*
|
|
34
45
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
35
|
-
* @param {WitnessMap}
|
|
36
|
-
* @
|
|
37
|
-
* @
|
|
38
|
-
* @param {WitnessMap} solved_witness
|
|
39
|
-
* @returns {WitnessMap}
|
|
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 {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.
|
|
40
49
|
*/
|
|
41
|
-
export function
|
|
50
|
+
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
51
|
+
/**
|
|
52
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
53
|
+
*
|
|
54
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
55
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
56
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
57
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
58
|
+
*/
|
|
59
|
+
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
42
60
|
/**
|
|
43
61
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
44
62
|
* @param {string} lhs
|
|
@@ -90,73 +108,56 @@ export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
90
108
|
*/
|
|
91
109
|
export function buildInfo(): BuildInfo;
|
|
92
110
|
/**
|
|
93
|
-
*
|
|
111
|
+
* Sets the package's logging level.
|
|
94
112
|
*
|
|
95
|
-
* @param {
|
|
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.
|
|
113
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
99
114
|
*/
|
|
100
|
-
export function
|
|
115
|
+
export function initLogLevel(filter: string): void;
|
|
101
116
|
/**
|
|
102
|
-
*
|
|
103
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
117
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
104
118
|
*
|
|
105
119
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
106
|
-
* @param {WitnessMap}
|
|
107
|
-
* @
|
|
108
|
-
* @
|
|
109
|
-
|
|
110
|
-
|
|
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
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
122
|
-
*
|
|
123
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
124
|
-
* @returns {Uint8Array} A compressed witness map
|
|
125
|
-
*/
|
|
126
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
127
|
-
/**
|
|
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.
|
|
130
|
-
*
|
|
131
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
132
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
120
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
121
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
122
|
+
* @param {Uint8Array} program
|
|
123
|
+
* @param {WitnessMap} witness_map
|
|
124
|
+
* @returns {WitnessMap}
|
|
133
125
|
*/
|
|
134
|
-
export function
|
|
126
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
135
127
|
/**
|
|
136
|
-
*
|
|
128
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
137
129
|
*
|
|
138
|
-
* @param {
|
|
139
|
-
* @
|
|
130
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
131
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
132
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
133
|
+
* @param {Uint8Array} program
|
|
134
|
+
* @param {WitnessMap} solved_witness
|
|
135
|
+
* @returns {WitnessMap}
|
|
140
136
|
*/
|
|
141
|
-
export function
|
|
137
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
142
138
|
/**
|
|
143
|
-
*
|
|
139
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
144
140
|
*
|
|
145
|
-
* @param {Uint8Array}
|
|
146
|
-
* @
|
|
141
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
142
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
143
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
144
|
+
* @param {Uint8Array} program
|
|
145
|
+
* @param {WitnessMap} solved_witness
|
|
146
|
+
* @returns {WitnessMap}
|
|
147
147
|
*/
|
|
148
|
-
export function
|
|
148
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
149
149
|
|
|
150
|
-
export type
|
|
151
|
-
|
|
152
|
-
data: string[];
|
|
153
|
-
};
|
|
150
|
+
export type ForeignCallInput = string[]
|
|
151
|
+
export type ForeignCallOutput = string | string[]
|
|
154
152
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
153
|
+
/**
|
|
154
|
+
* A callback which performs an foreign call and returns the response.
|
|
155
|
+
* @callback ForeignCallHandler
|
|
156
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
157
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
158
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
159
|
+
*/
|
|
160
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
160
161
|
|
|
161
162
|
|
|
162
163
|
|
|
@@ -183,17 +184,16 @@ export type BuildInfo = {
|
|
|
183
184
|
|
|
184
185
|
|
|
185
186
|
|
|
186
|
-
export type
|
|
187
|
-
|
|
187
|
+
export type RawAssertionPayload = {
|
|
188
|
+
selector: string;
|
|
189
|
+
data: string[];
|
|
190
|
+
};
|
|
188
191
|
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
195
|
-
*/
|
|
196
|
-
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
192
|
+
export type ExecutionError = Error & {
|
|
193
|
+
callStack?: string[];
|
|
194
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
195
|
+
brilligFunctionId?: number;
|
|
196
|
+
};
|
|
197
197
|
|
|
198
198
|
|
|
199
199
|
|
|
@@ -216,10 +216,13 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
216
216
|
|
|
217
217
|
export interface InitOutput {
|
|
218
218
|
readonly memory: WebAssembly.Memory;
|
|
219
|
-
readonly
|
|
220
|
-
readonly
|
|
221
|
-
readonly
|
|
222
|
-
readonly
|
|
219
|
+
readonly compressWitness: (a: number, b: number) => void;
|
|
220
|
+
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
221
|
+
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
222
|
+
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
223
|
+
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
224
|
+
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: number, d: number) => number;
|
|
225
|
+
readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
|
|
223
226
|
readonly and: (a: number, b: number) => number;
|
|
224
227
|
readonly xor: (a: number, b: number) => number;
|
|
225
228
|
readonly sha256_compression: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
@@ -227,22 +230,19 @@ export interface InitOutput {
|
|
|
227
230
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
228
231
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
229
232
|
readonly buildInfo: () => number;
|
|
230
|
-
readonly
|
|
231
|
-
readonly
|
|
232
|
-
readonly
|
|
233
|
-
readonly
|
|
234
|
-
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
235
|
-
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
236
|
-
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
233
|
+
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
234
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
235
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
236
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
237
237
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
238
238
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
239
239
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
240
|
-
readonly
|
|
240
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h624a3dfbf78ca22a: (a: number, b: number, c: number) => void;
|
|
241
241
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
242
242
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
243
|
-
readonly
|
|
243
|
+
readonly wasm_bindgen__convert__closures__invoke3_mut__h45040feada3ebb25: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
244
244
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
245
|
-
readonly
|
|
245
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h3f07259b3eb55784: (a: number, b: number, c: number, d: number) => void;
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|