@aztec/noir-acvm_js 0.0.1-commit.d1f2d6c → 0.0.1-commit.d431d1c
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 +48 -48
- package/nodejs/acvm_js.js +71 -71
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +7 -7
- package/package.json +3 -3
- package/web/acvm_js.d.ts +55 -55
- package/web/acvm_js.js +71 -71
- 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
|
@@ -5,6 +5,34 @@
|
|
|
5
5
|
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
6
|
*/
|
|
7
7
|
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
10
|
+
*
|
|
11
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
12
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
13
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
14
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
15
|
+
*/
|
|
16
|
+
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
17
|
+
/**
|
|
18
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
19
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
20
|
+
*
|
|
21
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
22
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
23
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
24
|
+
* @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.
|
|
25
|
+
*/
|
|
26
|
+
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
27
|
+
/**
|
|
28
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
29
|
+
*
|
|
30
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
31
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
32
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
33
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
34
|
+
*/
|
|
35
|
+
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
8
36
|
/**
|
|
9
37
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
38
|
*
|
|
@@ -58,6 +86,12 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
58
86
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
59
87
|
*/
|
|
60
88
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Sets the package's logging level.
|
|
91
|
+
*
|
|
92
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
93
|
+
*/
|
|
94
|
+
export function initLogLevel(filter: string): void;
|
|
61
95
|
/**
|
|
62
96
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
63
97
|
*
|
|
@@ -82,40 +116,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
82
116
|
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
83
117
|
*/
|
|
84
118
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
85
|
-
/**
|
|
86
|
-
* Sets the package's logging level.
|
|
87
|
-
*
|
|
88
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
89
|
-
*/
|
|
90
|
-
export function initLogLevel(filter: string): void;
|
|
91
|
-
/**
|
|
92
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
93
|
-
*
|
|
94
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
95
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
96
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
97
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
98
|
-
*/
|
|
99
|
-
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
100
|
-
/**
|
|
101
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
102
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
103
|
-
*
|
|
104
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
105
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
106
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
107
|
-
* @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.
|
|
108
|
-
*/
|
|
109
|
-
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
110
|
-
/**
|
|
111
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
112
|
-
*
|
|
113
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
114
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
115
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
116
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
117
|
-
*/
|
|
118
|
-
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
119
119
|
|
|
120
120
|
export type StackItem = {
|
|
121
121
|
index: number;
|
|
@@ -140,6 +140,20 @@ export type BuildInfo = {
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
|
|
143
|
+
export type RawAssertionPayload = {
|
|
144
|
+
selector: string;
|
|
145
|
+
data: string[];
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export type ExecutionError = Error & {
|
|
149
|
+
callStack?: string[];
|
|
150
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
151
|
+
acirFunctionId?: number;
|
|
152
|
+
brilligFunctionId?: number;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
143
157
|
// Map from witness index to hex string value of witness.
|
|
144
158
|
export type WitnessMap = Map<number, string>;
|
|
145
159
|
|
|
@@ -155,20 +169,6 @@ export type SolvedAndReturnWitness = {
|
|
|
155
169
|
|
|
156
170
|
|
|
157
171
|
|
|
158
|
-
export type RawAssertionPayload = {
|
|
159
|
-
selector: string;
|
|
160
|
-
data: string[];
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export type ExecutionError = Error & {
|
|
164
|
-
callStack?: string[];
|
|
165
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
166
|
-
acirFunctionId?: number;
|
|
167
|
-
brilligFunctionId?: number;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
172
|
export type ForeignCallInput = string[]
|
|
173
173
|
export type ForeignCallOutput = string | string[]
|
|
174
174
|
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -210,6 +210,58 @@ module.exports.buildInfo = function() {
|
|
|
210
210
|
return ret;
|
|
211
211
|
};
|
|
212
212
|
|
|
213
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
214
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
215
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
216
|
+
WASM_VECTOR_LEN = arg.length;
|
|
217
|
+
return ptr;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
221
|
+
*
|
|
222
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
223
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
224
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
225
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
226
|
+
*/
|
|
227
|
+
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
228
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
229
|
+
const len0 = WASM_VECTOR_LEN;
|
|
230
|
+
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
231
|
+
return ret;
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
236
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
237
|
+
*
|
|
238
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
239
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
240
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
241
|
+
* @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.
|
|
242
|
+
*/
|
|
243
|
+
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
244
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
245
|
+
const len0 = WASM_VECTOR_LEN;
|
|
246
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
247
|
+
return ret;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
252
|
+
*
|
|
253
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
254
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
255
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
256
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
257
|
+
*/
|
|
258
|
+
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
259
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
260
|
+
const len0 = WASM_VECTOR_LEN;
|
|
261
|
+
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
262
|
+
return ret;
|
|
263
|
+
};
|
|
264
|
+
|
|
213
265
|
function takeFromExternrefTable0(idx) {
|
|
214
266
|
const value = wasm.__wbindgen_export_2.get(idx);
|
|
215
267
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -236,12 +288,6 @@ module.exports.compressWitness = function(witness_map) {
|
|
|
236
288
|
return v1;
|
|
237
289
|
};
|
|
238
290
|
|
|
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
|
-
}
|
|
245
291
|
/**
|
|
246
292
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
247
293
|
* This should be used to only fetch the witness map for the main function.
|
|
@@ -406,6 +452,20 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
406
452
|
return ret !== 0;
|
|
407
453
|
};
|
|
408
454
|
|
|
455
|
+
/**
|
|
456
|
+
* Sets the package's logging level.
|
|
457
|
+
*
|
|
458
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
459
|
+
*/
|
|
460
|
+
module.exports.initLogLevel = function(filter) {
|
|
461
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
462
|
+
const len0 = WASM_VECTOR_LEN;
|
|
463
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
464
|
+
if (ret[1]) {
|
|
465
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
|
|
409
469
|
/**
|
|
410
470
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
411
471
|
*
|
|
@@ -466,76 +526,16 @@ module.exports.getPublicWitness = function(program, solved_witness) {
|
|
|
466
526
|
return takeFromExternrefTable0(ret[0]);
|
|
467
527
|
};
|
|
468
528
|
|
|
469
|
-
/**
|
|
470
|
-
* Sets the package's logging level.
|
|
471
|
-
*
|
|
472
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
473
|
-
*/
|
|
474
|
-
module.exports.initLogLevel = function(filter) {
|
|
475
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
476
|
-
const len0 = WASM_VECTOR_LEN;
|
|
477
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
478
|
-
if (ret[1]) {
|
|
479
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
480
|
-
}
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
485
|
-
*
|
|
486
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
487
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
488
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
489
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
490
|
-
*/
|
|
491
|
-
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
492
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
493
|
-
const len0 = WASM_VECTOR_LEN;
|
|
494
|
-
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
495
|
-
return ret;
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
/**
|
|
499
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
500
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
501
|
-
*
|
|
502
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
503
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
504
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
505
|
-
* @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.
|
|
506
|
-
*/
|
|
507
|
-
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
508
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
509
|
-
const len0 = WASM_VECTOR_LEN;
|
|
510
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
511
|
-
return ret;
|
|
512
|
-
};
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
516
|
-
*
|
|
517
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
518
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
519
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
520
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
521
|
-
*/
|
|
522
|
-
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
523
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
524
|
-
const len0 = WASM_VECTOR_LEN;
|
|
525
|
-
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
526
|
-
return ret;
|
|
527
|
-
};
|
|
528
|
-
|
|
529
529
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure447_externref_shim(arg0, arg1, arg2);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
534
|
-
wasm.
|
|
534
|
+
wasm.closure932_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
538
|
-
wasm.
|
|
538
|
+
wasm.closure936_externref_shim(arg0, arg1, arg2, arg3);
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
module.exports.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
@@ -813,8 +813,8 @@ module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
|
813
813
|
return ret;
|
|
814
814
|
};
|
|
815
815
|
|
|
816
|
-
module.exports.
|
|
817
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
816
|
+
module.exports.__wbindgen_closure_wrapper1443 = function(arg0, arg1, arg2) {
|
|
817
|
+
const ret = makeMutClosure(arg0, arg1, 448, __wbg_adapter_30);
|
|
818
818
|
return ret;
|
|
819
819
|
};
|
|
820
820
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const buildInfo: () => any;
|
|
5
|
+
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
6
|
+
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
+
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
5
8
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
6
9
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
7
10
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -12,13 +15,10 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
|
|
|
12
15
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
13
16
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
14
17
|
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 initLogLevel: (a: number, b: number) => [number, number];
|
|
15
19
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
16
20
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
17
21
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
18
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
19
|
-
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
20
|
-
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
21
|
-
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
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 closure447_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure932_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure936_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.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.d431d1c",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"@web/test-runner-playwright": "^0.11.1",
|
|
44
44
|
"chai": "^6.2.2",
|
|
45
45
|
"eslint": "^9.39.2",
|
|
46
|
-
"eslint-plugin-prettier": "^5.5.
|
|
46
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
47
47
|
"mocha": "^11.7.5",
|
|
48
|
-
"prettier": "3.
|
|
48
|
+
"prettier": "3.7.4",
|
|
49
49
|
"ts-node": "^10.9.2",
|
|
50
50
|
"typescript": "^5.8.3"
|
|
51
51
|
}
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -5,6 +5,34 @@
|
|
|
5
5
|
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
6
6
|
*/
|
|
7
7
|
export function buildInfo(): BuildInfo;
|
|
8
|
+
/**
|
|
9
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
10
|
+
*
|
|
11
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
12
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
13
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
14
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
15
|
+
*/
|
|
16
|
+
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
17
|
+
/**
|
|
18
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
19
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
20
|
+
*
|
|
21
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
22
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
23
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
24
|
+
* @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.
|
|
25
|
+
*/
|
|
26
|
+
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
27
|
+
/**
|
|
28
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
29
|
+
*
|
|
30
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
31
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
32
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
33
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
34
|
+
*/
|
|
35
|
+
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
8
36
|
/**
|
|
9
37
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
10
38
|
*
|
|
@@ -58,6 +86,12 @@ export function ecdsa_secp256k1_verify(hashed_msg: Uint8Array, public_key_x_byte
|
|
|
58
86
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
59
87
|
*/
|
|
60
88
|
export function ecdsa_secp256r1_verify(hashed_msg: Uint8Array, public_key_x_bytes: Uint8Array, public_key_y_bytes: Uint8Array, signature: Uint8Array): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Sets the package's logging level.
|
|
91
|
+
*
|
|
92
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
93
|
+
*/
|
|
94
|
+
export function initLogLevel(filter: string): void;
|
|
61
95
|
/**
|
|
62
96
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
63
97
|
*
|
|
@@ -82,40 +116,6 @@ export function getPublicParametersWitness(program: Uint8Array, solved_witness:
|
|
|
82
116
|
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
83
117
|
*/
|
|
84
118
|
export function getPublicWitness(program: Uint8Array, solved_witness: WitnessMap): WitnessMap;
|
|
85
|
-
/**
|
|
86
|
-
* Sets the package's logging level.
|
|
87
|
-
*
|
|
88
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
89
|
-
*/
|
|
90
|
-
export function initLogLevel(filter: string): void;
|
|
91
|
-
/**
|
|
92
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
93
|
-
*
|
|
94
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
95
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
96
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
97
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
98
|
-
*/
|
|
99
|
-
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
100
|
-
/**
|
|
101
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
102
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
103
|
-
*
|
|
104
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
105
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
106
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
107
|
-
* @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.
|
|
108
|
-
*/
|
|
109
|
-
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
110
|
-
/**
|
|
111
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
112
|
-
*
|
|
113
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
114
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
115
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
116
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
117
|
-
*/
|
|
118
|
-
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
119
119
|
|
|
120
120
|
export type StackItem = {
|
|
121
121
|
index: number;
|
|
@@ -140,6 +140,20 @@ export type BuildInfo = {
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
|
|
143
|
+
export type RawAssertionPayload = {
|
|
144
|
+
selector: string;
|
|
145
|
+
data: string[];
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export type ExecutionError = Error & {
|
|
149
|
+
callStack?: string[];
|
|
150
|
+
rawAssertionPayload?: RawAssertionPayload;
|
|
151
|
+
acirFunctionId?: number;
|
|
152
|
+
brilligFunctionId?: number;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
143
157
|
// Map from witness index to hex string value of witness.
|
|
144
158
|
export type WitnessMap = Map<number, string>;
|
|
145
159
|
|
|
@@ -155,20 +169,6 @@ export type SolvedAndReturnWitness = {
|
|
|
155
169
|
|
|
156
170
|
|
|
157
171
|
|
|
158
|
-
export type RawAssertionPayload = {
|
|
159
|
-
selector: string;
|
|
160
|
-
data: string[];
|
|
161
|
-
};
|
|
162
|
-
|
|
163
|
-
export type ExecutionError = Error & {
|
|
164
|
-
callStack?: string[];
|
|
165
|
-
rawAssertionPayload?: RawAssertionPayload;
|
|
166
|
-
acirFunctionId?: number;
|
|
167
|
-
brilligFunctionId?: number;
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
172
|
export type ForeignCallInput = string[]
|
|
173
173
|
export type ForeignCallOutput = string | string[]
|
|
174
174
|
|
|
@@ -188,6 +188,9 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
188
188
|
export interface InitOutput {
|
|
189
189
|
readonly memory: WebAssembly.Memory;
|
|
190
190
|
readonly buildInfo: () => any;
|
|
191
|
+
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
192
|
+
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
193
|
+
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
191
194
|
readonly compressWitness: (a: any) => [number, number, number, number];
|
|
192
195
|
readonly decompressWitness: (a: number, b: number) => [number, number, number];
|
|
193
196
|
readonly compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -198,13 +201,10 @@ export interface InitOutput {
|
|
|
198
201
|
readonly blake2s256: (a: number, b: number) => [number, number];
|
|
199
202
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
200
203
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
204
|
+
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
201
205
|
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
202
206
|
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
203
207
|
readonly getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
204
|
-
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
205
|
-
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
206
|
-
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
207
|
-
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
208
208
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
209
209
|
readonly __externref_table_alloc: () => number;
|
|
210
210
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
@@ -213,9 +213,9 @@ export interface InitOutput {
|
|
|
213
213
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
214
214
|
readonly __wbindgen_export_6: WebAssembly.Table;
|
|
215
215
|
readonly __externref_table_dealloc: (a: number) => void;
|
|
216
|
-
readonly
|
|
217
|
-
readonly
|
|
218
|
-
readonly
|
|
216
|
+
readonly closure447_externref_shim: (a: number, b: number, c: any) => void;
|
|
217
|
+
readonly closure932_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
218
|
+
readonly closure936_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
219
219
|
readonly __wbindgen_start: () => void;
|
|
220
220
|
}
|
|
221
221
|
|
package/web/acvm_js.js
CHANGED
|
@@ -206,6 +206,58 @@ export function buildInfo() {
|
|
|
206
206
|
return ret;
|
|
207
207
|
}
|
|
208
208
|
|
|
209
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
210
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
211
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
212
|
+
WASM_VECTOR_LEN = arg.length;
|
|
213
|
+
return ptr;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
217
|
+
*
|
|
218
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
219
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
220
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
221
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
222
|
+
*/
|
|
223
|
+
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
224
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
225
|
+
const len0 = WASM_VECTOR_LEN;
|
|
226
|
+
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
227
|
+
return ret;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
232
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
233
|
+
*
|
|
234
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
235
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
236
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
237
|
+
* @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.
|
|
238
|
+
*/
|
|
239
|
+
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
240
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
241
|
+
const len0 = WASM_VECTOR_LEN;
|
|
242
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
243
|
+
return ret;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
248
|
+
*
|
|
249
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
250
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
251
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
252
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
253
|
+
*/
|
|
254
|
+
export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
255
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
257
|
+
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
258
|
+
return ret;
|
|
259
|
+
}
|
|
260
|
+
|
|
209
261
|
function takeFromExternrefTable0(idx) {
|
|
210
262
|
const value = wasm.__wbindgen_export_2.get(idx);
|
|
211
263
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -232,12 +284,6 @@ export function compressWitness(witness_map) {
|
|
|
232
284
|
return v1;
|
|
233
285
|
}
|
|
234
286
|
|
|
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
|
-
}
|
|
241
287
|
/**
|
|
242
288
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
243
289
|
* This should be used to only fetch the witness map for the main function.
|
|
@@ -402,6 +448,20 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
402
448
|
return ret !== 0;
|
|
403
449
|
}
|
|
404
450
|
|
|
451
|
+
/**
|
|
452
|
+
* Sets the package's logging level.
|
|
453
|
+
*
|
|
454
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
455
|
+
*/
|
|
456
|
+
export function initLogLevel(filter) {
|
|
457
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
458
|
+
const len0 = WASM_VECTOR_LEN;
|
|
459
|
+
const ret = wasm.initLogLevel(ptr0, len0);
|
|
460
|
+
if (ret[1]) {
|
|
461
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
405
465
|
/**
|
|
406
466
|
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
407
467
|
*
|
|
@@ -462,76 +522,16 @@ export function getPublicWitness(program, solved_witness) {
|
|
|
462
522
|
return takeFromExternrefTable0(ret[0]);
|
|
463
523
|
}
|
|
464
524
|
|
|
465
|
-
/**
|
|
466
|
-
* Sets the package's logging level.
|
|
467
|
-
*
|
|
468
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
469
|
-
*/
|
|
470
|
-
export function initLogLevel(filter) {
|
|
471
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
472
|
-
const len0 = WASM_VECTOR_LEN;
|
|
473
|
-
const ret = wasm.initLogLevel(ptr0, len0);
|
|
474
|
-
if (ret[1]) {
|
|
475
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
/**
|
|
480
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
481
|
-
*
|
|
482
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
483
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
484
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
485
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
486
|
-
*/
|
|
487
|
-
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
488
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
489
|
-
const len0 = WASM_VECTOR_LEN;
|
|
490
|
-
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
491
|
-
return ret;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
496
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
497
|
-
*
|
|
498
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
499
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
500
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
501
|
-
* @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.
|
|
502
|
-
*/
|
|
503
|
-
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
504
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
505
|
-
const len0 = WASM_VECTOR_LEN;
|
|
506
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
507
|
-
return ret;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
/**
|
|
511
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
512
|
-
*
|
|
513
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
514
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
515
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
516
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
517
|
-
*/
|
|
518
|
-
export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
519
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
520
|
-
const len0 = WASM_VECTOR_LEN;
|
|
521
|
-
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
522
|
-
return ret;
|
|
523
|
-
}
|
|
524
|
-
|
|
525
525
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
526
|
-
wasm.
|
|
526
|
+
wasm.closure447_externref_shim(arg0, arg1, arg2);
|
|
527
527
|
}
|
|
528
528
|
|
|
529
529
|
function __wbg_adapter_89(arg0, arg1, arg2, arg3, arg4) {
|
|
530
|
-
wasm.
|
|
530
|
+
wasm.closure932_externref_shim(arg0, arg1, arg2, arg3, arg4);
|
|
531
531
|
}
|
|
532
532
|
|
|
533
533
|
function __wbg_adapter_110(arg0, arg1, arg2, arg3) {
|
|
534
|
-
wasm.
|
|
534
|
+
wasm.closure936_externref_shim(arg0, arg1, arg2, arg3);
|
|
535
535
|
}
|
|
536
536
|
|
|
537
537
|
async function __wbg_load(module, imports) {
|
|
@@ -797,8 +797,8 @@ function __wbg_get_imports() {
|
|
|
797
797
|
const ret = false;
|
|
798
798
|
return ret;
|
|
799
799
|
};
|
|
800
|
-
imports.wbg.
|
|
801
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
800
|
+
imports.wbg.__wbindgen_closure_wrapper1443 = function(arg0, arg1, arg2) {
|
|
801
|
+
const ret = makeMutClosure(arg0, arg1, 448, __wbg_adapter_30);
|
|
802
802
|
return ret;
|
|
803
803
|
};
|
|
804
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
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const buildInfo: () => any;
|
|
5
|
+
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
6
|
+
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
7
|
+
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
5
8
|
export const compressWitness: (a: any) => [number, number, number, number];
|
|
6
9
|
export const decompressWitness: (a: number, b: number) => [number, number, number];
|
|
7
10
|
export const compressWitnessStack: (a: any) => [number, number, number, number];
|
|
@@ -12,13 +15,10 @@ export const sha256_compression: (a: number, b: number, c: number, d: number) =>
|
|
|
12
15
|
export const blake2s256: (a: number, b: number) => [number, number];
|
|
13
16
|
export const ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
14
17
|
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 initLogLevel: (a: number, b: number) => [number, number];
|
|
15
19
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
16
20
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
17
21
|
export const getPublicWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
18
|
-
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
19
|
-
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
20
|
-
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
21
|
-
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
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 closure447_externref_shim: (a: number, b: number, c: any) => void;
|
|
31
|
+
export const closure932_externref_shim: (a: number, b: number, c: any, d: number, e: any) => void;
|
|
32
|
+
export const closure936_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
33
33
|
export const __wbindgen_start: () => void;
|