@noir-lang/acvm_js 0.46.0-7936262.nightly → 0.46.0-e4eb5f5.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 +88 -88
- package/nodejs/acvm_js.js +257 -256
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +7 -7
- package/package.json +1 -1
- package/web/acvm_js.d.ts +95 -95
- package/web/acvm_js.js +253 -252
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +7 -7
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,68 +1,6 @@
|
|
|
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
|
-
/**
|
|
66
4
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
67
5
|
* @param {string} lhs
|
|
68
6
|
* @param {string} rhs
|
|
@@ -135,7 +73,7 @@ export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap,
|
|
|
135
73
|
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
136
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.
|
|
137
75
|
*/
|
|
138
|
-
export function executeCircuitWithReturnWitness(
|
|
76
|
+
export function executeCircuitWithReturnWitness(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
139
77
|
/**
|
|
140
78
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
141
79
|
*
|
|
@@ -145,13 +83,13 @@ export function executeCircuitWithReturnWitness(solver: WasmBlackBoxFunctionSolv
|
|
|
145
83
|
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
146
84
|
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
147
85
|
*/
|
|
148
|
-
export function executeCircuitWithBlackBoxSolver(
|
|
86
|
+
export function executeCircuitWithBlackBoxSolver(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
149
87
|
/**
|
|
150
88
|
*/
|
|
151
89
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
152
90
|
/**
|
|
153
91
|
*/
|
|
154
|
-
export function executeProgramWithBlackBoxSolver(
|
|
92
|
+
export function executeProgramWithBlackBoxSolver(_solver: WasmBlackBoxFunctionSolver, program: Uint8Array, initial_witness: WitnessMap, foreign_call_executor: ForeignCallHandler): Promise<WitnessStack>;
|
|
155
93
|
/**
|
|
156
94
|
* Sets the package's logging level.
|
|
157
95
|
*
|
|
@@ -163,21 +101,68 @@ export function initLogLevel(filter: string): void;
|
|
|
163
101
|
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
164
102
|
*/
|
|
165
103
|
export function buildInfo(): BuildInfo;
|
|
166
|
-
|
|
167
|
-
// Map from witness index to hex string value of witness.
|
|
168
|
-
export type WitnessMap = Map<number, string>;
|
|
169
|
-
|
|
170
104
|
/**
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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;
|
|
181
166
|
|
|
182
167
|
export type RawAssertionPayload = {
|
|
183
168
|
selector: string;
|
|
@@ -190,6 +175,20 @@ export type ExecutionError = Error & {
|
|
|
190
175
|
|
|
191
176
|
|
|
192
177
|
|
|
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
|
+
|
|
193
192
|
/**
|
|
194
193
|
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
195
194
|
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
@@ -204,17 +203,18 @@ export type BuildInfo = {
|
|
|
204
203
|
|
|
205
204
|
|
|
206
205
|
|
|
207
|
-
|
|
208
|
-
export type
|
|
206
|
+
// Map from witness index to hex string value of witness.
|
|
207
|
+
export type WitnessMap = Map<number, string>;
|
|
209
208
|
|
|
210
209
|
/**
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
+
}
|
|
218
218
|
|
|
219
219
|
|
|
220
220
|
|