@aztec/noir-acvm_js 0.0.0-test.0 → 0.0.1-commit.03f7ef2
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 +85 -84
- package/nodejs/acvm_js.js +129 -130
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +10 -10
- package/package.json +13 -13
- package/web/acvm_js.d.ts +95 -94
- package/web/acvm_js.js +128 -129
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +10 -10
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
5
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
|
+
*/
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
|
+
*
|
|
11
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
12
|
+
* @returns {Uint8Array} A compressed witness map
|
|
13
|
+
*/
|
|
14
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
17
|
+
* This should be used to only fetch the witness map for the main function.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
20
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
21
|
+
*/
|
|
22
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
25
|
+
*
|
|
26
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
27
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
28
|
+
*/
|
|
29
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
34
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
35
|
+
*/
|
|
36
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
3
37
|
/**
|
|
4
38
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
39
|
*
|
|
@@ -29,40 +63,35 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
29
63
|
*/
|
|
30
64
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
31
65
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
35
|
-
* @returns {Uint8Array} A compressed witness map
|
|
36
|
-
*/
|
|
37
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
38
|
-
/**
|
|
39
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
40
|
-
* This should be used to only fetch the witness map for the main function.
|
|
66
|
+
* Sets the package's logging level.
|
|
41
67
|
*
|
|
42
|
-
* @param {
|
|
43
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
68
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
44
69
|
*/
|
|
45
|
-
export function
|
|
70
|
+
export function initLogLevel(filter: string): void;
|
|
46
71
|
/**
|
|
47
|
-
*
|
|
72
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
48
73
|
*
|
|
49
|
-
* @param {
|
|
50
|
-
* @
|
|
74
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
75
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
76
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
51
77
|
*/
|
|
52
|
-
export function
|
|
78
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
53
79
|
/**
|
|
54
|
-
*
|
|
80
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
55
81
|
*
|
|
56
|
-
* @param {Uint8Array}
|
|
57
|
-
* @
|
|
82
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
83
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
84
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
58
85
|
*/
|
|
59
|
-
export function
|
|
86
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
60
87
|
/**
|
|
61
|
-
*
|
|
88
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
62
89
|
*
|
|
63
|
-
* @param {
|
|
90
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
91
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
92
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
64
93
|
*/
|
|
65
|
-
export function
|
|
94
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
66
95
|
/**
|
|
67
96
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
68
97
|
*/
|
|
@@ -87,46 +116,33 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
87
116
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
88
117
|
*/
|
|
89
118
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
119
|
+
|
|
90
120
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
97
|
-
*
|
|
98
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
99
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
100
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
101
|
-
*/
|
|
102
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
103
|
-
/**
|
|
104
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
105
|
-
*
|
|
106
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
107
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
108
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
109
|
-
*/
|
|
110
|
-
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
111
|
-
/**
|
|
112
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
113
|
-
*
|
|
114
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
115
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
116
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
121
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
122
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
123
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
124
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
117
125
|
*/
|
|
118
|
-
export
|
|
126
|
+
export type BuildInfo = {
|
|
127
|
+
gitHash: string;
|
|
128
|
+
version: string;
|
|
129
|
+
dirty: string;
|
|
130
|
+
}
|
|
119
131
|
|
|
120
|
-
export type RawAssertionPayload = {
|
|
121
|
-
selector: string;
|
|
122
|
-
data: string[];
|
|
123
|
-
};
|
|
124
132
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
|
|
134
|
+
// Map from witness index to hex string value of witness.
|
|
135
|
+
export type WitnessMap = Map<number, string>;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* An execution result containing two witnesses.
|
|
139
|
+
* 1. The full solved witness of the execution.
|
|
140
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
141
|
+
*/
|
|
142
|
+
export type SolvedAndReturnWitness = {
|
|
143
|
+
solvedWitness: WitnessMap;
|
|
144
|
+
returnWitness: WitnessMap;
|
|
145
|
+
}
|
|
130
146
|
|
|
131
147
|
|
|
132
148
|
|
|
@@ -139,20 +155,6 @@ export type WitnessStack = Array<StackItem>;
|
|
|
139
155
|
|
|
140
156
|
|
|
141
157
|
|
|
142
|
-
/**
|
|
143
|
-
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
144
|
-
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
145
|
-
* @property {string} version - The version of the package at the built git commit.
|
|
146
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
147
|
-
*/
|
|
148
|
-
export type BuildInfo = {
|
|
149
|
-
gitHash: string;
|
|
150
|
-
version: string;
|
|
151
|
-
dirty: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
158
|
export type ForeignCallInput = string[]
|
|
157
159
|
export type ForeignCallOutput = string | string[]
|
|
158
160
|
|
|
@@ -167,17 +169,16 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
167
169
|
|
|
168
170
|
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
export type RawAssertionPayload = {
|
|
173
|
+
selector: string;
|
|
174
|
+
data: string[];
|
|
175
|
+
};
|
|
172
176
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
solvedWitness: WitnessMap;
|
|
180
|
-
returnWitness: WitnessMap;
|
|
181
|
-
}
|
|
177
|
+
export type ExecutionError = Error & {
|
|
178
|
+
callStack?: string[];
|
|
179
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
180
|
+
acirFunctionId?: number;
|
|
181
|
+
brilligFunctionId?: number;
|
|
182
|
+
};
|
|
182
183
|
|
|
183
184
|
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -201,56 +201,12 @@ function debugString(val) {
|
|
|
201
201
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
202
202
|
return className;
|
|
203
203
|
}
|
|
204
|
-
|
|
205
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
206
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
207
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
208
|
-
WASM_VECTOR_LEN = arg.length;
|
|
209
|
-
return ptr;
|
|
210
|
-
}
|
|
211
204
|
/**
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
215
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
216
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
217
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
218
|
-
*/
|
|
219
|
-
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
220
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
221
|
-
const len0 = WASM_VECTOR_LEN;
|
|
222
|
-
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
223
|
-
return ret;
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
228
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
229
|
-
*
|
|
230
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
231
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
232
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
233
|
-
* @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.
|
|
234
|
-
*/
|
|
235
|
-
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
236
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
237
|
-
const len0 = WASM_VECTOR_LEN;
|
|
238
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
239
|
-
return ret;
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
244
|
-
*
|
|
245
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
246
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
247
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
248
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
205
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
206
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
249
207
|
*/
|
|
250
|
-
module.exports.
|
|
251
|
-
const
|
|
252
|
-
const len0 = WASM_VECTOR_LEN;
|
|
253
|
-
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
208
|
+
module.exports.buildInfo = function() {
|
|
209
|
+
const ret = wasm.buildInfo();
|
|
254
210
|
return ret;
|
|
255
211
|
};
|
|
256
212
|
|
|
@@ -280,6 +236,12 @@ module.exports.compressWitness = function(witness_map) {
|
|
|
280
236
|
return v1;
|
|
281
237
|
};
|
|
282
238
|
|
|
239
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
240
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
241
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
242
|
+
WASM_VECTOR_LEN = arg.length;
|
|
243
|
+
return ptr;
|
|
244
|
+
}
|
|
283
245
|
/**
|
|
284
246
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
285
247
|
* This should be used to only fetch the witness map for the main function.
|
|
@@ -329,6 +291,52 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
|
329
291
|
return takeFromExternrefTable0(ret[0]);
|
|
330
292
|
};
|
|
331
293
|
|
|
294
|
+
/**
|
|
295
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
296
|
+
*
|
|
297
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
298
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
299
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
300
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
301
|
+
*/
|
|
302
|
+
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
303
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
304
|
+
const len0 = WASM_VECTOR_LEN;
|
|
305
|
+
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
306
|
+
return ret;
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
311
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
312
|
+
*
|
|
313
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
314
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
315
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
316
|
+
* @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.
|
|
317
|
+
*/
|
|
318
|
+
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
319
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
320
|
+
const len0 = WASM_VECTOR_LEN;
|
|
321
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
322
|
+
return ret;
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
327
|
+
*
|
|
328
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
329
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
330
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
331
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
332
|
+
*/
|
|
333
|
+
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
334
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
335
|
+
const len0 = WASM_VECTOR_LEN;
|
|
336
|
+
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
337
|
+
return ret;
|
|
338
|
+
};
|
|
339
|
+
|
|
332
340
|
/**
|
|
333
341
|
* Sets the package's logging level.
|
|
334
342
|
*
|
|
@@ -343,6 +351,66 @@ module.exports.initLogLevel = function(filter) {
|
|
|
343
351
|
}
|
|
344
352
|
};
|
|
345
353
|
|
|
354
|
+
/**
|
|
355
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
356
|
+
*
|
|
357
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
358
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
359
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
360
|
+
* @param {Uint8Array} program
|
|
361
|
+
* @param {WitnessMap} witness_map
|
|
362
|
+
* @returns {WitnessMap}
|
|
363
|
+
*/
|
|
364
|
+
module.exports.getReturnWitness = function(program, witness_map) {
|
|
365
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
367
|
+
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
368
|
+
if (ret[2]) {
|
|
369
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
370
|
+
}
|
|
371
|
+
return takeFromExternrefTable0(ret[0]);
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
376
|
+
*
|
|
377
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
378
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
379
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
380
|
+
* @param {Uint8Array} program
|
|
381
|
+
* @param {WitnessMap} solved_witness
|
|
382
|
+
* @returns {WitnessMap}
|
|
383
|
+
*/
|
|
384
|
+
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
385
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
386
|
+
const len0 = WASM_VECTOR_LEN;
|
|
387
|
+
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
388
|
+
if (ret[2]) {
|
|
389
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
390
|
+
}
|
|
391
|
+
return takeFromExternrefTable0(ret[0]);
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
396
|
+
*
|
|
397
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
398
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
399
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
400
|
+
* @param {Uint8Array} program
|
|
401
|
+
* @param {WitnessMap} solved_witness
|
|
402
|
+
* @returns {WitnessMap}
|
|
403
|
+
*/
|
|
404
|
+
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
405
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
406
|
+
const len0 = WASM_VECTOR_LEN;
|
|
407
|
+
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
408
|
+
if (ret[2]) {
|
|
409
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
410
|
+
}
|
|
411
|
+
return takeFromExternrefTable0(ret[0]);
|
|
412
|
+
};
|
|
413
|
+
|
|
346
414
|
/**
|
|
347
415
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
348
416
|
* @param {string} lhs
|
|
@@ -458,85 +526,16 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
458
526
|
return ret !== 0;
|
|
459
527
|
};
|
|
460
528
|
|
|
461
|
-
/**
|
|
462
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
463
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
464
|
-
*/
|
|
465
|
-
module.exports.buildInfo = function() {
|
|
466
|
-
const ret = wasm.buildInfo();
|
|
467
|
-
return ret;
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
/**
|
|
471
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
472
|
-
*
|
|
473
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
474
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
475
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
476
|
-
* @param {Uint8Array} program
|
|
477
|
-
* @param {WitnessMap} witness_map
|
|
478
|
-
* @returns {WitnessMap}
|
|
479
|
-
*/
|
|
480
|
-
module.exports.getReturnWitness = function(program, witness_map) {
|
|
481
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
482
|
-
const len0 = WASM_VECTOR_LEN;
|
|
483
|
-
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
484
|
-
if (ret[2]) {
|
|
485
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
486
|
-
}
|
|
487
|
-
return takeFromExternrefTable0(ret[0]);
|
|
488
|
-
};
|
|
489
|
-
|
|
490
|
-
/**
|
|
491
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
492
|
-
*
|
|
493
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
494
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
495
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
496
|
-
* @param {Uint8Array} program
|
|
497
|
-
* @param {WitnessMap} solved_witness
|
|
498
|
-
* @returns {WitnessMap}
|
|
499
|
-
*/
|
|
500
|
-
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
501
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
502
|
-
const len0 = WASM_VECTOR_LEN;
|
|
503
|
-
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
504
|
-
if (ret[2]) {
|
|
505
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
506
|
-
}
|
|
507
|
-
return takeFromExternrefTable0(ret[0]);
|
|
508
|
-
};
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
512
|
-
*
|
|
513
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
514
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
515
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
516
|
-
* @param {Uint8Array} program
|
|
517
|
-
* @param {WitnessMap} solved_witness
|
|
518
|
-
* @returns {WitnessMap}
|
|
519
|
-
*/
|
|
520
|
-
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
521
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
522
|
-
const len0 = WASM_VECTOR_LEN;
|
|
523
|
-
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
524
|
-
if (ret[2]) {
|
|
525
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
526
|
-
}
|
|
527
|
-
return takeFromExternrefTable0(ret[0]);
|
|
528
|
-
};
|
|
529
|
-
|
|
530
529
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
531
|
-
wasm.
|
|
530
|
+
wasm.closure576_externref_shim(arg0, arg1, arg2);
|
|
532
531
|
}
|
|
533
532
|
|
|
534
533
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
535
|
-
wasm.
|
|
534
|
+
wasm.closure1171_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
536
535
|
}
|
|
537
536
|
|
|
538
537
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
539
|
-
wasm.
|
|
538
|
+
wasm.closure1175_externref_shim(arg0, arg1, arg2, arg3);
|
|
540
539
|
}
|
|
541
540
|
|
|
542
541
|
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
@@ -554,12 +553,12 @@ module.exports.__wbg_call_833bed5770ea2041 = function() { return handleError(fun
|
|
|
554
553
|
return ret;
|
|
555
554
|
}, arguments) };
|
|
556
555
|
|
|
557
|
-
module.exports.
|
|
556
|
+
module.exports.__wbg_constructor_3aef6db465a4d40f = function(arg0) {
|
|
558
557
|
const ret = new Error(arg0);
|
|
559
558
|
return ret;
|
|
560
559
|
};
|
|
561
560
|
|
|
562
|
-
module.exports.
|
|
561
|
+
module.exports.__wbg_constructor_9cd41836d6991f28 = function(arg0) {
|
|
563
562
|
const ret = new Error(arg0);
|
|
564
563
|
return ret;
|
|
565
564
|
};
|
|
@@ -675,11 +674,6 @@ module.exports.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
|
675
674
|
}
|
|
676
675
|
};
|
|
677
676
|
|
|
678
|
-
module.exports.__wbg_new_3f4c5c451d69e970 = function() {
|
|
679
|
-
const ret = new Map();
|
|
680
|
-
return ret;
|
|
681
|
-
};
|
|
682
|
-
|
|
683
677
|
module.exports.__wbg_new_5e0be73521bc8c17 = function() {
|
|
684
678
|
const ret = new Map();
|
|
685
679
|
return ret;
|
|
@@ -695,7 +689,7 @@ module.exports.__wbg_new_8a6f238a6ece86ea = function() {
|
|
|
695
689
|
return ret;
|
|
696
690
|
};
|
|
697
691
|
|
|
698
|
-
module.exports.
|
|
692
|
+
module.exports.__wbg_new_8e773a1674584163 = function() {
|
|
699
693
|
const ret = new Array();
|
|
700
694
|
return ret;
|
|
701
695
|
};
|
|
@@ -705,6 +699,11 @@ module.exports.__wbg_new_c68d7209be747379 = function(arg0, arg1) {
|
|
|
705
699
|
return ret;
|
|
706
700
|
};
|
|
707
701
|
|
|
702
|
+
module.exports.__wbg_new_dd245daac54dc568 = function() {
|
|
703
|
+
const ret = new Map();
|
|
704
|
+
return ret;
|
|
705
|
+
};
|
|
706
|
+
|
|
708
707
|
module.exports.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
709
708
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
710
709
|
return ret;
|
|
@@ -814,8 +813,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
814
813
|
return ret;
|
|
815
814
|
};
|
|
816
815
|
|
|
817
|
-
module.exports.
|
|
818
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
816
|
+
module.exports.__wbindgen_closure_wrapper1971 = function(arg0, arg1, arg2) {
|
|
817
|
+
const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
|
|
819
818
|
return ret;
|
|
820
819
|
};
|
|
821
820
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
5
|
-
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
|
-
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
4
|
+
export const buildInfo: () => any;
|
|
7
5
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
8
6
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
9
7
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
10
8
|
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
9
|
+
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
10
|
+
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
11
|
+
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
11
12
|
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
13
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
14
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
15
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
12
16
|
export const and: (a: any, b: any) => any;
|
|
13
17
|
export const xor: (a: any, b: any) => any;
|
|
14
18
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
19
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
16
20
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
17
21
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
18
|
-
export const buildInfo: () => any;
|
|
19
|
-
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
20
|
-
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
21
|
-
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure576_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/noir-acvm_js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1-commit.03f7ef2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -26,27 +26,27 @@
|
|
|
26
26
|
"package.json"
|
|
27
27
|
],
|
|
28
28
|
"sideEffects": false,
|
|
29
|
-
"packageManager": "yarn@
|
|
29
|
+
"packageManager": "yarn@4.5.2",
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "bash ./build.sh",
|
|
32
32
|
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
|
|
33
33
|
"test:browser": "web-test-runner",
|
|
34
|
-
"lint": "NODE_NO_WARNINGS=1 eslint . --
|
|
34
|
+
"lint": "NODE_NO_WARNINGS=1 eslint . --max-warnings 0",
|
|
35
35
|
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
|
|
36
36
|
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
|
|
37
37
|
"clean": "chmod u+w web nodejs || true && rm -rf web nodejs"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
41
|
-
"@web/dev-server-esbuild": "^0.
|
|
42
|
-
"@web/test-runner": "^0.
|
|
43
|
-
"@web/test-runner-playwright": "^0.11.
|
|
44
|
-
"chai": "^4.
|
|
45
|
-
"eslint": "^
|
|
46
|
-
"eslint-plugin-prettier": "^5.
|
|
47
|
-
"mocha": "^
|
|
48
|
-
"prettier": "3.
|
|
49
|
-
"ts-node": "^10.9.
|
|
50
|
-
"typescript": "^5.
|
|
41
|
+
"@web/dev-server-esbuild": "^1.0.4",
|
|
42
|
+
"@web/test-runner": "^0.20.2",
|
|
43
|
+
"@web/test-runner-playwright": "^0.11.1",
|
|
44
|
+
"chai": "^4.5.0",
|
|
45
|
+
"eslint": "^9.39.1",
|
|
46
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
47
|
+
"mocha": "^11.5.0",
|
|
48
|
+
"prettier": "3.7.3",
|
|
49
|
+
"ts-node": "^10.9.2",
|
|
50
|
+
"typescript": "^5.8.3"
|
|
51
51
|
}
|
|
52
52
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
5
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
|
+
*/
|
|
7
|
+
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
|
+
*
|
|
11
|
+
* @param {WitnessMap} witness_map - A witness map.
|
|
12
|
+
* @returns {Uint8Array} A compressed witness map
|
|
13
|
+
*/
|
|
14
|
+
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
17
|
+
* This should be used to only fetch the witness map for the main function.
|
|
18
|
+
*
|
|
19
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
20
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
21
|
+
*/
|
|
22
|
+
export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
23
|
+
/**
|
|
24
|
+
* Compresses a `WitnessStack` into the binary format outputted by Nargo.
|
|
25
|
+
*
|
|
26
|
+
* @param {WitnessStack} witness_stack - A witness stack.
|
|
27
|
+
* @returns {Uint8Array} A compressed witness stack
|
|
28
|
+
*/
|
|
29
|
+
export function compressWitnessStack(witness_stack: WitnessStack): Uint8Array;
|
|
30
|
+
/**
|
|
31
|
+
* Decompresses a compressed witness stack as outputted by Nargo into a `WitnessStack`.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
34
|
+
* @returns {WitnessStack} The decompressed witness stack.
|
|
35
|
+
*/
|
|
36
|
+
export function decompressWitnessStack(compressed_witness: Uint8Array): WitnessStack;
|
|
3
37
|
/**
|
|
4
38
|
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
39
|
*
|
|
@@ -29,40 +63,35 @@ export function executeCircuitWithReturnWitness(program: Uint8Array, initial_wit
|
|
|
29
63
|
*/
|
|
30
64
|
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
31
65
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* @param {WitnessMap} witness_map - A witness map.
|
|
35
|
-
* @returns {Uint8Array} A compressed witness map
|
|
36
|
-
*/
|
|
37
|
-
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
38
|
-
/**
|
|
39
|
-
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
40
|
-
* This should be used to only fetch the witness map for the main function.
|
|
66
|
+
* Sets the package's logging level.
|
|
41
67
|
*
|
|
42
|
-
* @param {
|
|
43
|
-
* @returns {WitnessMap} The decompressed witness map.
|
|
68
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
44
69
|
*/
|
|
45
|
-
export function
|
|
70
|
+
export function initLogLevel(filter: string): void;
|
|
46
71
|
/**
|
|
47
|
-
*
|
|
72
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
48
73
|
*
|
|
49
|
-
* @param {
|
|
50
|
-
* @
|
|
74
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
75
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
76
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
51
77
|
*/
|
|
52
|
-
export function
|
|
78
|
+
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
53
79
|
/**
|
|
54
|
-
*
|
|
80
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
55
81
|
*
|
|
56
|
-
* @param {Uint8Array}
|
|
57
|
-
* @
|
|
82
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
83
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
84
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
58
85
|
*/
|
|
59
|
-
export function
|
|
86
|
+
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
60
87
|
/**
|
|
61
|
-
*
|
|
88
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
62
89
|
*
|
|
63
|
-
* @param {
|
|
90
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
91
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
92
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
64
93
|
*/
|
|
65
|
-
export function
|
|
94
|
+
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
66
95
|
/**
|
|
67
96
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
68
97
|
*/
|
|
@@ -87,46 +116,33 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
87
116
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
88
117
|
*/
|
|
89
118
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
119
|
+
|
|
90
120
|
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
97
|
-
*
|
|
98
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
99
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
100
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
101
|
-
*/
|
|
102
|
-
export function getReturnWitness(program: Uint8Array, witness_map: WitnessMap): WitnessMap;
|
|
103
|
-
/**
|
|
104
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
105
|
-
*
|
|
106
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
107
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
108
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
109
|
-
*/
|
|
110
|
-
export function getPublicParametersWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
111
|
-
/**
|
|
112
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
113
|
-
*
|
|
114
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
115
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
116
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
121
|
+
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
122
|
+
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
123
|
+
* @property {string} version - The version of the package at the built git commit.
|
|
124
|
+
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
117
125
|
*/
|
|
118
|
-
export
|
|
126
|
+
export type BuildInfo = {
|
|
127
|
+
gitHash: string;
|
|
128
|
+
version: string;
|
|
129
|
+
dirty: string;
|
|
130
|
+
}
|
|
119
131
|
|
|
120
|
-
export type RawAssertionPayload = {
|
|
121
|
-
selector: string;
|
|
122
|
-
data: string[];
|
|
123
|
-
};
|
|
124
132
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
|
|
134
|
+
// Map from witness index to hex string value of witness.
|
|
135
|
+
export type WitnessMap = Map<number, string>;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* An execution result containing two witnesses.
|
|
139
|
+
* 1. The full solved witness of the execution.
|
|
140
|
+
* 2. The return witness which contains the given public return values within the full witness.
|
|
141
|
+
*/
|
|
142
|
+
export type SolvedAndReturnWitness = {
|
|
143
|
+
solvedWitness: WitnessMap;
|
|
144
|
+
returnWitness: WitnessMap;
|
|
145
|
+
}
|
|
130
146
|
|
|
131
147
|
|
|
132
148
|
|
|
@@ -139,20 +155,6 @@ export type WitnessStack = Array<StackItem>;
|
|
|
139
155
|
|
|
140
156
|
|
|
141
157
|
|
|
142
|
-
/**
|
|
143
|
-
* @typedef {Object} BuildInfo - Information about how the installed package was built
|
|
144
|
-
* @property {string} gitHash - The hash of the git commit from which the package was built.
|
|
145
|
-
* @property {string} version - The version of the package at the built git commit.
|
|
146
|
-
* @property {boolean} dirty - Whether the package contained uncommitted changes when built.
|
|
147
|
-
*/
|
|
148
|
-
export type BuildInfo = {
|
|
149
|
-
gitHash: string;
|
|
150
|
-
version: string;
|
|
151
|
-
dirty: string;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
158
|
export type ForeignCallInput = string[]
|
|
157
159
|
export type ForeignCallOutput = string | string[]
|
|
158
160
|
|
|
@@ -167,18 +169,17 @@ export type ForeignCallHandler = (name: string, inputs: ForeignCallInput[]) => P
|
|
|
167
169
|
|
|
168
170
|
|
|
169
171
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
+
export type RawAssertionPayload = {
|
|
173
|
+
selector: string;
|
|
174
|
+
data: string[];
|
|
175
|
+
};
|
|
172
176
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
solvedWitness: WitnessMap;
|
|
180
|
-
returnWitness: WitnessMap;
|
|
181
|
-
}
|
|
177
|
+
export type ExecutionError = Error & {
|
|
178
|
+
callStack?: string[];
|
|
179
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
180
|
+
acirFunctionId?: number;
|
|
181
|
+
brilligFunctionId?: number;
|
|
182
|
+
};
|
|
182
183
|
|
|
183
184
|
|
|
184
185
|
|
|
@@ -186,24 +187,24 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
186
187
|
|
|
187
188
|
export interface InitOutput {
|
|
188
189
|
readonly memory: WebAssembly.Memory;
|
|
189
|
-
readonly
|
|
190
|
-
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
191
|
-
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
190
|
+
readonly buildInfo: () => any;
|
|
192
191
|
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
193
192
|
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
194
193
|
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
195
194
|
readonly decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
195
|
+
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
196
|
+
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
197
|
+
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
196
198
|
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
199
|
+
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
200
|
+
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
201
|
+
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
197
202
|
readonly and: (a: any, b: any) => any;
|
|
198
203
|
readonly xor: (a: any, b: any) => any;
|
|
199
204
|
readonly sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
200
205
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
201
206
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
202
207
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
203
|
-
readonly buildInfo: () => any;
|
|
204
|
-
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
205
|
-
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
206
|
-
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
207
208
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
208
209
|
readonly __externref_table_alloc: () => number;
|
|
209
210
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -212,9 +213,9 @@ export interface InitOutput {
|
|
|
212
213
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
213
214
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
214
215
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
215
|
-
readonly
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
216
|
+
readonly closure576_externref_shim: (a: number, b: number, c: any) => void;
|
|
217
|
+
readonly closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
218
|
+
readonly closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
218
219
|
readonly __wbindgen_start: () => void;
|
|
219
220
|
}
|
|
220
221
|
|
package/web/acvm_js.js
CHANGED
|
@@ -197,56 +197,12 @@ function debugString(val) {
|
|
|
197
197
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
198
198
|
return className;
|
|
199
199
|
}
|
|
200
|
-
|
|
201
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
202
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
203
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
204
|
-
WASM_VECTOR_LEN = arg.length;
|
|
205
|
-
return ptr;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
209
|
-
*
|
|
210
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
211
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
212
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
213
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
214
|
-
*/
|
|
215
|
-
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
216
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
217
|
-
const len0 = WASM_VECTOR_LEN;
|
|
218
|
-
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
219
|
-
return ret;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
224
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
225
|
-
*
|
|
226
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
227
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
228
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
229
|
-
* @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.
|
|
230
|
-
*/
|
|
231
|
-
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
232
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
233
|
-
const len0 = WASM_VECTOR_LEN;
|
|
234
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
235
|
-
return ret;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
200
|
/**
|
|
239
|
-
*
|
|
240
|
-
*
|
|
241
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
242
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
243
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
244
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
201
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
202
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
245
203
|
*/
|
|
246
|
-
export function
|
|
247
|
-
const
|
|
248
|
-
const len0 = WASM_VECTOR_LEN;
|
|
249
|
-
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
204
|
+
export function buildInfo() {
|
|
205
|
+
const ret = wasm.buildInfo();
|
|
250
206
|
return ret;
|
|
251
207
|
}
|
|
252
208
|
|
|
@@ -276,6 +232,12 @@ export function compressWitness(witness_map) {
|
|
|
276
232
|
return v1;
|
|
277
233
|
}
|
|
278
234
|
|
|
235
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
236
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
237
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
238
|
+
WASM_VECTOR_LEN = arg.length;
|
|
239
|
+
return ptr;
|
|
240
|
+
}
|
|
279
241
|
/**
|
|
280
242
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
281
243
|
* This should be used to only fetch the witness map for the main function.
|
|
@@ -325,6 +287,52 @@ export function decompressWitnessStack(compressed_witness) {
|
|
|
325
287
|
return takeFromExternrefTable0(ret[0]);
|
|
326
288
|
}
|
|
327
289
|
|
|
290
|
+
/**
|
|
291
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
292
|
+
*
|
|
293
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
294
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
295
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
296
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
297
|
+
*/
|
|
298
|
+
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
299
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
300
|
+
const len0 = WASM_VECTOR_LEN;
|
|
301
|
+
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
302
|
+
return ret;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
307
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
308
|
+
*
|
|
309
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
310
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
311
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
312
|
+
* @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.
|
|
313
|
+
*/
|
|
314
|
+
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
315
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
316
|
+
const len0 = WASM_VECTOR_LEN;
|
|
317
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
318
|
+
return ret;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
323
|
+
*
|
|
324
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
325
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
326
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
327
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
328
|
+
*/
|
|
329
|
+
export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
330
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
331
|
+
const len0 = WASM_VECTOR_LEN;
|
|
332
|
+
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
333
|
+
return ret;
|
|
334
|
+
}
|
|
335
|
+
|
|
328
336
|
/**
|
|
329
337
|
* Sets the package's logging level.
|
|
330
338
|
*
|
|
@@ -339,6 +347,66 @@ export function initLogLevel(filter) {
|
|
|
339
347
|
}
|
|
340
348
|
}
|
|
341
349
|
|
|
350
|
+
/**
|
|
351
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
352
|
+
*
|
|
353
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
354
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
355
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
356
|
+
* @param {Uint8Array} program
|
|
357
|
+
* @param {WitnessMap} witness_map
|
|
358
|
+
* @returns {WitnessMap}
|
|
359
|
+
*/
|
|
360
|
+
export function getReturnWitness(program, witness_map) {
|
|
361
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
362
|
+
const len0 = WASM_VECTOR_LEN;
|
|
363
|
+
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
364
|
+
if (ret[2]) {
|
|
365
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
366
|
+
}
|
|
367
|
+
return takeFromExternrefTable0(ret[0]);
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
372
|
+
*
|
|
373
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
374
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
375
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
376
|
+
* @param {Uint8Array} program
|
|
377
|
+
* @param {WitnessMap} solved_witness
|
|
378
|
+
* @returns {WitnessMap}
|
|
379
|
+
*/
|
|
380
|
+
export function getPublicParametersWitness(program, solved_witness) {
|
|
381
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
382
|
+
const len0 = WASM_VECTOR_LEN;
|
|
383
|
+
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
384
|
+
if (ret[2]) {
|
|
385
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
386
|
+
}
|
|
387
|
+
return takeFromExternrefTable0(ret[0]);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
392
|
+
*
|
|
393
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
394
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
395
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
396
|
+
* @param {Uint8Array} program
|
|
397
|
+
* @param {WitnessMap} solved_witness
|
|
398
|
+
* @returns {WitnessMap}
|
|
399
|
+
*/
|
|
400
|
+
export function getPublicWitness(program, solved_witness) {
|
|
401
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
402
|
+
const len0 = WASM_VECTOR_LEN;
|
|
403
|
+
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
404
|
+
if (ret[2]) {
|
|
405
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
406
|
+
}
|
|
407
|
+
return takeFromExternrefTable0(ret[0]);
|
|
408
|
+
}
|
|
409
|
+
|
|
342
410
|
/**
|
|
343
411
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
344
412
|
* @param {string} lhs
|
|
@@ -454,85 +522,16 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
454
522
|
return ret !== 0;
|
|
455
523
|
}
|
|
456
524
|
|
|
457
|
-
/**
|
|
458
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
459
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
460
|
-
*/
|
|
461
|
-
export function buildInfo() {
|
|
462
|
-
const ret = wasm.buildInfo();
|
|
463
|
-
return ret;
|
|
464
|
-
}
|
|
465
|
-
|
|
466
|
-
/**
|
|
467
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
468
|
-
*
|
|
469
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
470
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
471
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
472
|
-
* @param {Uint8Array} program
|
|
473
|
-
* @param {WitnessMap} witness_map
|
|
474
|
-
* @returns {WitnessMap}
|
|
475
|
-
*/
|
|
476
|
-
export function getReturnWitness(program, witness_map) {
|
|
477
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
478
|
-
const len0 = WASM_VECTOR_LEN;
|
|
479
|
-
const ret = wasm.getReturnWitness(ptr0, len0, witness_map);
|
|
480
|
-
if (ret[2]) {
|
|
481
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
482
|
-
}
|
|
483
|
-
return takeFromExternrefTable0(ret[0]);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
/**
|
|
487
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
488
|
-
*
|
|
489
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
490
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
491
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
492
|
-
* @param {Uint8Array} program
|
|
493
|
-
* @param {WitnessMap} solved_witness
|
|
494
|
-
* @returns {WitnessMap}
|
|
495
|
-
*/
|
|
496
|
-
export function getPublicParametersWitness(program, solved_witness) {
|
|
497
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
498
|
-
const len0 = WASM_VECTOR_LEN;
|
|
499
|
-
const ret = wasm.getPublicParametersWitness(ptr0, len0, solved_witness);
|
|
500
|
-
if (ret[2]) {
|
|
501
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
502
|
-
}
|
|
503
|
-
return takeFromExternrefTable0(ret[0]);
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
508
|
-
*
|
|
509
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
510
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
511
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
512
|
-
* @param {Uint8Array} program
|
|
513
|
-
* @param {WitnessMap} solved_witness
|
|
514
|
-
* @returns {WitnessMap}
|
|
515
|
-
*/
|
|
516
|
-
export function getPublicWitness(program, solved_witness) {
|
|
517
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
518
|
-
const len0 = WASM_VECTOR_LEN;
|
|
519
|
-
const ret = wasm.getPublicWitness(ptr0, len0, solved_witness);
|
|
520
|
-
if (ret[2]) {
|
|
521
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
522
|
-
}
|
|
523
|
-
return takeFromExternrefTable0(ret[0]);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
525
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
527
|
-
wasm.
|
|
526
|
+
wasm.closure576_externref_shim(arg0, arg1, arg2);
|
|
528
527
|
}
|
|
529
528
|
|
|
530
529
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
531
|
-
wasm.
|
|
530
|
+
wasm.closure1171_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
532
531
|
}
|
|
533
532
|
|
|
534
533
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
535
|
-
wasm.
|
|
534
|
+
wasm.closure1175_externref_shim(arg0, arg1, arg2, arg3);
|
|
536
535
|
}
|
|
537
536
|
|
|
538
537
|
async function __wbg_load(module, imports) {
|
|
@@ -581,11 +580,11 @@ function __wbg_get_imports() {
|
|
|
581
580
|
const ret = arg0.call(arg1, arg2, arg3);
|
|
582
581
|
return ret;
|
|
583
582
|
}, arguments) };
|
|
584
|
-
imports.wbg.
|
|
583
|
+
imports.wbg.__wbg_constructor_3aef6db465a4d40f = function(arg0) {
|
|
585
584
|
const ret = new Error(arg0);
|
|
586
585
|
return ret;
|
|
587
586
|
};
|
|
588
|
-
imports.wbg.
|
|
587
|
+
imports.wbg.__wbg_constructor_9cd41836d6991f28 = function(arg0) {
|
|
589
588
|
const ret = new Error(arg0);
|
|
590
589
|
return ret;
|
|
591
590
|
};
|
|
@@ -686,10 +685,6 @@ function __wbg_get_imports() {
|
|
|
686
685
|
state0.a = state0.b = 0;
|
|
687
686
|
}
|
|
688
687
|
};
|
|
689
|
-
imports.wbg.__wbg_new_3f4c5c451d69e970 = function() {
|
|
690
|
-
const ret = new Map();
|
|
691
|
-
return ret;
|
|
692
|
-
};
|
|
693
688
|
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
694
689
|
const ret = new Map();
|
|
695
690
|
return ret;
|
|
@@ -702,7 +697,7 @@ function __wbg_get_imports() {
|
|
|
702
697
|
const ret = new Error();
|
|
703
698
|
return ret;
|
|
704
699
|
};
|
|
705
|
-
imports.wbg.
|
|
700
|
+
imports.wbg.__wbg_new_8e773a1674584163 = function() {
|
|
706
701
|
const ret = new Array();
|
|
707
702
|
return ret;
|
|
708
703
|
};
|
|
@@ -710,6 +705,10 @@ function __wbg_get_imports() {
|
|
|
710
705
|
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
711
706
|
return ret;
|
|
712
707
|
};
|
|
708
|
+
imports.wbg.__wbg_new_dd245daac54dc568 = function() {
|
|
709
|
+
const ret = new Map();
|
|
710
|
+
return ret;
|
|
711
|
+
};
|
|
713
712
|
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
714
713
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
715
714
|
return ret;
|
|
@@ -798,8 +797,8 @@ function __wbg_get_imports() {
|
|
|
798
797
|
const ret = false;
|
|
799
798
|
return ret;
|
|
800
799
|
};
|
|
801
|
-
imports.wbg.
|
|
802
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
800
|
+
imports.wbg.__wbindgen_closure_wrapper1971 = function(arg0, arg1, arg2) {
|
|
801
|
+
const ret = makeMutClosure(arg0, arg1, 577, __wbg_adapter_30);
|
|
803
802
|
return ret;
|
|
804
803
|
};
|
|
805
804
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const
|
|
5
|
-
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
6
|
-
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
4
|
+
export const buildInfo: () => any;
|
|
7
5
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
8
6
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
9
7
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
10
8
|
export const decompressWitnessStack: (a: number, b: number) => [number, number, number];
|
|
9
|
+
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
10
|
+
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
11
|
+
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
11
12
|
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
13
|
+
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
14
|
+
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
15
|
+
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
12
16
|
export const and: (a: any, b: any) => any;
|
|
13
17
|
export const xor: (a: any, b: any) => any;
|
|
14
18
|
export const sha256_compression: (a: number, b: number, c: number, d: number) => [number, number];
|
|
15
19
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
16
20
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
17
21
|
export const ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
18
|
-
export const buildInfo: () => any;
|
|
19
|
-
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
20
|
-
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
21
|
-
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
22
22
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
23
23
|
export const __externref_table_alloc: () => number;
|
|
24
24
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -27,7 +27,7 @@ export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
|
27
27
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
28
28
|
export const __wbindgen_export_6: WebAssembly.Table;
|
|
29
29
|
export const __externref_table_dealloc: (a: number) => void;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
32
|
-
export const
|
|
30
|
+
export const closure576_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure1171_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure1175_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|