@noir-lang/acvm_js 0.46.0-86fd0ac.nightly → 0.46.0-e73cdbb.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 +82 -99
- package/nodejs/acvm_js.js +249 -318
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +9 -13
- package/package.json +1 -1
- package/web/acvm_js.d.ts +91 -112
- package/web/acvm_js.js +246 -313
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +9 -13
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
5
|
+
*
|
|
6
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
7
|
+
* @returns {Uint8Array} A compressed witness map
|
|
8
|
+
*/
|
|
9
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
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.
|
|
13
|
+
*
|
|
14
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
15
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
16
|
+
*/
|
|
17
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
18
|
+
/**
|
|
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
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
34
|
+
*
|
|
35
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
36
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
37
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
38
|
+
* @param {Uint8Array} program
|
|
39
|
+
* @param {WitnessMap} witness_map
|
|
40
|
+
* @returns {WitnessMap}
|
|
41
|
+
*/
|
|
42
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
43
|
+
/**
|
|
44
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
45
|
+
*
|
|
46
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
47
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
48
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
49
|
+
* @param {Uint8Array} program
|
|
50
|
+
* @param {WitnessMap} solved_witness
|
|
51
|
+
* @returns {WitnessMap}
|
|
52
|
+
*/
|
|
53
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
54
|
+
/**
|
|
55
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
56
|
+
*
|
|
57
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
58
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
59
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
60
|
+
* @param {Uint8Array} program
|
|
61
|
+
* @param {WitnessMap} solved_witness
|
|
62
|
+
* @returns {WitnessMap}
|
|
63
|
+
*/
|
|
64
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
65
|
+
/**
|
|
4
66
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
5
67
|
* @param {string} lhs
|
|
6
68
|
* @param {string} rhs
|
|
@@ -51,9 +113,10 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
51
113
|
*/
|
|
52
114
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
53
115
|
/**
|
|
54
|
-
*
|
|
116
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
117
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
55
118
|
*/
|
|
56
|
-
export function
|
|
119
|
+
export function buildInfo(): BuildInfo;
|
|
57
120
|
/**
|
|
58
121
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
59
122
|
*
|
|
@@ -67,102 +130,27 @@ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap,
|
|
|
67
130
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
68
131
|
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
69
132
|
*
|
|
70
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
71
133
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
72
134
|
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
73
135
|
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
74
136
|
* @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.
|
|
75
137
|
*/
|
|
76
|
-
export function executeCircuitWithReturnWitness(
|
|
138
|
+
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
77
139
|
/**
|
|
78
140
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
79
141
|
*
|
|
80
|
-
* @param {
|
|
81
|
-
* @param {
|
|
82
|
-
* @param {
|
|
83
|
-
* @
|
|
84
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
85
|
-
*/
|
|
86
|
-
export function executeCircuitWithBlackBoxSolver(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
87
|
-
/**
|
|
142
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
143
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
144
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
145
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
88
146
|
*/
|
|
89
147
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
90
148
|
/**
|
|
91
|
-
*/
|
|
92
|
-
export function executeProgramWithBlackBoxSolver(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_executor: ForeignCallHandler): Promise<WitnessStack>;
|
|
93
|
-
/**
|
|
94
149
|
* Sets the package's logging level.
|
|
95
150
|
*
|
|
96
151
|
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
97
152
|
*/
|
|
98
153
|
export function initLogLevel(filter: string): void;
|
|
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
|
-
/**
|
|
105
|
-
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
106
|
-
*
|
|
107
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
108
|
-
* @returns {Uint8Array} A compressed witness map
|
|
109
|
-
*/
|
|
110
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
111
|
-
/**
|
|
112
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
113
|
-
* This should be used to only fetch the witness map for the main function.
|
|
114
|
-
*
|
|
115
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
116
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
117
|
-
*/
|
|
118
|
-
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
119
|
-
/**
|
|
120
|
-
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
121
|
-
*
|
|
122
|
-
* @param {WitnessStack} witness_stack - A witness stack.
|
|
123
|
-
* @returns {Uint8Array} A compressed witness stack
|
|
124
|
-
*/
|
|
125
|
-
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
126
|
-
/**
|
|
127
|
-
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
128
|
-
*
|
|
129
|
-
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
130
|
-
* @returns {WitnessStack} The decompressed witness stack.
|
|
131
|
-
*/
|
|
132
|
-
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
133
|
-
/**
|
|
134
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
135
|
-
*
|
|
136
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
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}
|
|
142
|
-
*/
|
|
143
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
144
|
-
/**
|
|
145
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
146
|
-
*
|
|
147
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
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}
|
|
153
|
-
*/
|
|
154
|
-
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
155
|
-
/**
|
|
156
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
157
|
-
*
|
|
158
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
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
|
-
*/
|
|
165
|
-
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
166
154
|
|
|
167
155
|
export type RawAssertionPayload = {
|
|
168
156
|
selector: string;
|
|
@@ -175,20 +163,6 @@ export type ExecutionError = Error & {
|
|
|
175
163
|
|
|
176
164
|
|
|
177
165
|
|
|
178
|
-
export type ForeignCallInput = string[]
|
|
179
|
-
export type ForeignCallOutput = string | string[]
|
|
180
|
-
|
|
181
|
-
/**
|
|
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[]>;
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
166
|
/**
|
|
193
167
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
194
168
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -226,8 +200,17 @@ export type StackItem = {
|
|
|
226
200
|
export type WitnessStack = Array<StackItem>;
|
|
227
201
|
|
|
228
202
|
|
|
203
|
+
|
|
204
|
+
export type ForeignCallInput = string[]
|
|
205
|
+
export type ForeignCallOutput = string | string[]
|
|
206
|
+
|
|
229
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.
|
|
230
213
|
*/
|
|
231
|
-
export
|
|
232
|
-
|
|
233
|
-
|
|
214
|
+
export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => Promise<ForeignCallOutput[]>;
|
|
215
|
+
|
|
216
|
+
|