@noir-lang/acvm_js 0.45.0 → 0.46.0-23a6477.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 +76 -71
- package/nodejs/acvm_js.js +171 -553
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +12 -14
- package/package.json +1 -1
- package/web/acvm_js.d.ts +88 -85
- package/web/acvm_js.js +169 -489
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +12 -14
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -8,15 +8,6 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
8
8
|
export function keccak256(a: number, b: number, c: number): void;
|
|
9
9
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
10
10
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
11
|
-
export function buildInfo(): number;
|
|
12
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
13
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
14
|
-
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
15
|
-
export function initLogLevel(a: number, b: number, c: number): void;
|
|
16
|
-
export function compressWitness(a: number, b: number): void;
|
|
17
|
-
export function decompressWitness(a: number, b: number, c: number): void;
|
|
18
|
-
export function compressWitnessStack(a: number, b: number): void;
|
|
19
|
-
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
20
11
|
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
21
12
|
export function createBlackBoxSolver(): number;
|
|
22
13
|
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
@@ -24,14 +15,21 @@ export function executeCircuitWithReturnWitness(a: number, b: number, c: number,
|
|
|
24
15
|
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
25
16
|
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
26
17
|
export function executeProgramWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
27
|
-
export function
|
|
28
|
-
export function
|
|
18
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
19
|
+
export function buildInfo(): number;
|
|
20
|
+
export function compressWitness(a: number, b: number): void;
|
|
21
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
22
|
+
export function compressWitnessStack(a: number, b: number): void;
|
|
23
|
+
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
24
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
25
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
26
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
29
27
|
export function __wbindgen_malloc(a: number): number;
|
|
30
28
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
31
29
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
32
|
-
export function
|
|
30
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380(a: number, b: number, c: number): void;
|
|
33
31
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
34
32
|
export function __wbindgen_free(a: number, b: number): void;
|
|
33
|
+
export function wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa(a: number, b: number, c: number, d: number, e: number): void;
|
|
35
34
|
export function __wbindgen_exn_store(a: number): void;
|
|
36
|
-
export function
|
|
37
|
-
export function wasm_bindgen__convert__closures__invoke2_mut__h188e918906ff9a40(a: number, b: number, c: number, d: number): void;
|
|
35
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7(a: number, b: number, c: number, d: number): void;
|
package/package.json
CHANGED
package/web/acvm_js.d.ts
CHANGED
|
@@ -51,43 +51,45 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
51
51
|
*/
|
|
52
52
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
54
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
56
55
|
*/
|
|
57
|
-
export function
|
|
56
|
+
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
58
57
|
/**
|
|
59
|
-
*
|
|
58
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
60
59
|
*
|
|
61
60
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
62
|
-
* @param {WitnessMap}
|
|
63
|
-
* @
|
|
64
|
-
* @
|
|
65
|
-
* @param {WitnessMap} witness_map
|
|
66
|
-
* @returns {WitnessMap}
|
|
61
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
62
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
63
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
67
64
|
*/
|
|
68
|
-
export function
|
|
65
|
+
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
69
66
|
/**
|
|
70
|
-
*
|
|
67
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
68
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
71
69
|
*
|
|
70
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
72
71
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
73
|
-
* @param {WitnessMap}
|
|
74
|
-
* @
|
|
75
|
-
* @
|
|
76
|
-
* @param {WitnessMap} solved_witness
|
|
77
|
-
* @returns {WitnessMap}
|
|
72
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
73
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
74
|
+
* @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.
|
|
78
75
|
*/
|
|
79
|
-
export function
|
|
76
|
+
export function executeCircuitWithReturnWitness(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
80
77
|
/**
|
|
81
|
-
*
|
|
78
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
82
79
|
*
|
|
80
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
83
81
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
84
|
-
* @param {WitnessMap}
|
|
85
|
-
* @
|
|
86
|
-
* @
|
|
87
|
-
* @param {WitnessMap} solved_witness
|
|
88
|
-
* @returns {WitnessMap}
|
|
82
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
83
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
84
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
89
85
|
*/
|
|
90
|
-
export function
|
|
86
|
+
export function executeCircuitWithBlackBoxSolver(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
87
|
+
/**
|
|
88
|
+
*/
|
|
89
|
+
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
90
|
+
/**
|
|
91
|
+
*/
|
|
92
|
+
export function executeProgramWithBlackBoxSolver(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_executor: ForeignCallHandler): Promise<WitnessStack>;
|
|
91
93
|
/**
|
|
92
94
|
* Sets the package's logging level.
|
|
93
95
|
*
|
|
@@ -95,6 +97,11 @@ export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap
|
|
|
95
97
|
*/
|
|
96
98
|
export function initLogLevel(filter: string): void;
|
|
97
99
|
/**
|
|
100
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
101
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
102
|
+
*/
|
|
103
|
+
export function buildInfo(): BuildInfo;
|
|
104
|
+
/**
|
|
98
105
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
99
106
|
*
|
|
100
107
|
* @param {WitnessMap} witness_map - A witness map.
|
|
@@ -124,64 +131,61 @@ export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
|
124
131
|
*/
|
|
125
132
|
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
126
133
|
/**
|
|
127
|
-
*
|
|
128
|
-
*/
|
|
129
|
-
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
130
|
-
/**
|
|
131
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
134
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
132
135
|
*
|
|
133
136
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
134
|
-
* @param {WitnessMap}
|
|
135
|
-
* @
|
|
136
|
-
* @
|
|
137
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
138
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
139
|
+
* @param {Uint8Array} program
|
|
140
|
+
* @param {WitnessMap} witness_map
|
|
141
|
+
* @returns {WitnessMap}
|
|
137
142
|
*/
|
|
138
|
-
export function
|
|
143
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
139
144
|
/**
|
|
140
|
-
*
|
|
141
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
145
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
142
146
|
*
|
|
143
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
144
147
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
145
|
-
* @param {WitnessMap}
|
|
146
|
-
* @
|
|
147
|
-
* @
|
|
148
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
149
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
150
|
+
* @param {Uint8Array} program
|
|
151
|
+
* @param {WitnessMap} solved_witness
|
|
152
|
+
* @returns {WitnessMap}
|
|
148
153
|
*/
|
|
149
|
-
export function
|
|
154
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
150
155
|
/**
|
|
151
|
-
*
|
|
156
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
152
157
|
*
|
|
153
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
154
158
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
155
|
-
* @param {WitnessMap}
|
|
156
|
-
* @
|
|
157
|
-
* @
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
*/
|
|
162
|
-
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
163
|
-
/**
|
|
159
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
160
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
161
|
+
* @param {Uint8Array} program
|
|
162
|
+
* @param {WitnessMap} solved_witness
|
|
163
|
+
* @returns {WitnessMap}
|
|
164
164
|
*/
|
|
165
|
-
export function
|
|
165
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
166
166
|
|
|
167
|
+
export type RawAssertionPayload = {
|
|
168
|
+
selector: string;
|
|
169
|
+
data: string[];
|
|
170
|
+
};
|
|
167
171
|
export type ExecutionError = Error & {
|
|
168
172
|
callStack?: string[];
|
|
173
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
169
174
|
};
|
|
170
175
|
|
|
171
176
|
|
|
172
177
|
|
|
173
|
-
|
|
174
|
-
export type
|
|
178
|
+
export type ForeignCallInput = string[]
|
|
179
|
+
export type ForeignCallOutput = string | string[]
|
|
175
180
|
|
|
176
181
|
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
182
|
+
* A callback which performs an foreign call and returns the response.
|
|
183
|
+
* @callback ForeignCallHandler
|
|
184
|
+
* @param {string} name - The identifier for the type of foreign call being performed.
|
|
185
|
+
* @param {string[][]} inputs - An array of hex encoded inputs to the foreign call.
|
|
186
|
+
* @returns {Promise<string[]>} outputs - An array of hex encoded outputs containing the results of the foreign call.
|
|
187
|
+
*/
|
|
188
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
185
189
|
|
|
186
190
|
|
|
187
191
|
|
|
@@ -199,17 +203,18 @@ export type BuildInfo = {
|
|
|
199
203
|
|
|
200
204
|
|
|
201
205
|
|
|
202
|
-
|
|
203
|
-
export type
|
|
206
|
+
// Map from witness index to hex string value of witness.
|
|
207
|
+
export type WitnessMap = Map<number, string>;
|
|
204
208
|
|
|
205
209
|
/**
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
210
|
+
* An execution result containing two witnesses.
|
|
211
|
+
* 1. The full solved witness of the execution.
|
|
212
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
213
|
+
*/
|
|
214
|
+
export type SolvedAndReturnWitness = {
|
|
215
|
+
solvedWitness: WitnessMap;
|
|
216
|
+
returnWitness: WitnessMap;
|
|
217
|
+
}
|
|
213
218
|
|
|
214
219
|
|
|
215
220
|
|
|
@@ -238,15 +243,6 @@ export interface InitOutput {
|
|
|
238
243
|
readonly keccak256: (a: number, b: number, c: number) => void;
|
|
239
244
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
240
245
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
241
|
-
readonly buildInfo: () => number;
|
|
242
|
-
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
243
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
244
|
-
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
245
|
-
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
246
|
-
readonly compressWitness: (a: number, b: number) => void;
|
|
247
|
-
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
248
|
-
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
249
|
-
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
250
246
|
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
|
|
251
247
|
readonly createBlackBoxSolver: () => number;
|
|
252
248
|
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
@@ -254,17 +250,24 @@ export interface InitOutput {
|
|
|
254
250
|
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
255
251
|
readonly executeProgram: (a: number, b: number, c: number, d: number) => number;
|
|
256
252
|
readonly executeProgramWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
257
|
-
readonly
|
|
258
|
-
readonly
|
|
253
|
+
readonly initLogLevel: (a: number, b: number, c: number) => void;
|
|
254
|
+
readonly buildInfo: () => number;
|
|
255
|
+
readonly compressWitness: (a: number, b: number) => void;
|
|
256
|
+
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
257
|
+
readonly compressWitnessStack: (a: number, b: number) => void;
|
|
258
|
+
readonly decompressWitnessStack: (a: number, b: number, c: number) => void;
|
|
259
|
+
readonly getReturnWitness: (a: number, b: number, c: number, d: number) => void;
|
|
260
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
|
261
|
+
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
259
262
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
260
263
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
261
264
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
262
|
-
readonly
|
|
265
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h36bac5ff3ea3c380: (a: number, b: number, c: number) => void;
|
|
263
266
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
264
267
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
268
|
+
readonly wasm_bindgen__convert__closures__invoke3_mut__h629417323d5efbaa: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
265
269
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
266
|
-
readonly
|
|
267
|
-
readonly wasm_bindgen__convert__closures__invoke2_mut__h188e918906ff9a40: (a: number, b: number, c: number, d: number) => void;
|
|
270
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h4efdd1050cfb3ea7: (a: number, b: number, c: number, d: number) => void;
|
|
268
271
|
}
|
|
269
272
|
|
|
270
273
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|