@aztec/noir-acvm_js 0.0.1-commit.2ed92850 → 0.0.1-commit.3469e52
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 +28 -28
- package/nodejs/acvm_js.js +57 -57
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +6 -6
- package/package.json +3 -3
- package/web/acvm_js.d.ts +34 -34
- package/web/acvm_js.js +57 -57
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +6 -6
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,34 +86,6 @@ 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;
|
|
61
|
-
/**
|
|
62
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
63
|
-
*
|
|
64
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
65
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
66
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
67
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
68
|
-
*/
|
|
69
|
-
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
70
|
-
/**
|
|
71
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
72
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
73
|
-
*
|
|
74
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
75
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
76
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
77
|
-
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
78
|
-
*/
|
|
79
|
-
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
80
|
-
/**
|
|
81
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
82
|
-
*
|
|
83
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
84
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
85
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
86
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
87
|
-
*/
|
|
88
|
-
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
89
89
|
/**
|
|
90
90
|
* Sets the package's logging level.
|
|
91
91
|
*
|
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,52 +452,6 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
406
452
|
return ret !== 0;
|
|
407
453
|
};
|
|
408
454
|
|
|
409
|
-
/**
|
|
410
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
411
|
-
*
|
|
412
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
413
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
414
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
415
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
416
|
-
*/
|
|
417
|
-
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
418
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
419
|
-
const len0 = WASM_VECTOR_LEN;
|
|
420
|
-
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
421
|
-
return ret;
|
|
422
|
-
};
|
|
423
|
-
|
|
424
|
-
/**
|
|
425
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
426
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
427
|
-
*
|
|
428
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
429
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
430
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
431
|
-
* @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.
|
|
432
|
-
*/
|
|
433
|
-
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
434
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
435
|
-
const len0 = WASM_VECTOR_LEN;
|
|
436
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
437
|
-
return ret;
|
|
438
|
-
};
|
|
439
|
-
|
|
440
|
-
/**
|
|
441
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
442
|
-
*
|
|
443
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
444
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
445
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
446
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
447
|
-
*/
|
|
448
|
-
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
449
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
450
|
-
const len0 = WASM_VECTOR_LEN;
|
|
451
|
-
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
452
|
-
return ret;
|
|
453
|
-
};
|
|
454
|
-
|
|
455
455
|
/**
|
|
456
456
|
* Sets the package's logging level.
|
|
457
457
|
*
|
|
@@ -527,15 +527,15 @@ module.exports.getPublicWitness = function(program, solved_witness) {
|
|
|
527
527
|
};
|
|
528
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,9 +15,6 @@ 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;
|
|
15
|
-
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
16
|
-
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
17
|
-
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
18
18
|
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
19
19
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
20
20
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
@@ -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.3469e52",
|
|
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,34 +86,6 @@ 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;
|
|
61
|
-
/**
|
|
62
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
63
|
-
*
|
|
64
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
65
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
66
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
67
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
68
|
-
*/
|
|
69
|
-
export function executeCircuit(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
70
|
-
/**
|
|
71
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
72
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
73
|
-
*
|
|
74
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
75
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
76
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
77
|
-
* @returns {SolvedAndReturnWitness} The solved witness calculated by executing the circuit on the provided inputs, as well as the return witness indices as specified by the circuit.
|
|
78
|
-
*/
|
|
79
|
-
export function executeCircuitWithReturnWitness(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<SolvedAndReturnWitness>;
|
|
80
|
-
/**
|
|
81
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
82
|
-
*
|
|
83
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
84
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
85
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
86
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
87
|
-
*/
|
|
88
|
-
export function executeProgram(program: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessStack>;
|
|
89
89
|
/**
|
|
90
90
|
* Sets the package's logging level.
|
|
91
91
|
*
|
|
@@ -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,9 +201,6 @@ 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;
|
|
201
|
-
readonly executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
202
|
-
readonly executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
203
|
-
readonly executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
204
204
|
readonly initLogLevel: (a: number, b: number) => [number, number];
|
|
205
205
|
readonly getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
206
206
|
readonly getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
@@ -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,52 +448,6 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
402
448
|
return ret !== 0;
|
|
403
449
|
}
|
|
404
450
|
|
|
405
|
-
/**
|
|
406
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
407
|
-
*
|
|
408
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
409
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
410
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
411
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
412
|
-
*/
|
|
413
|
-
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
414
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
415
|
-
const len0 = WASM_VECTOR_LEN;
|
|
416
|
-
const ret = wasm.executeCircuit(ptr0, len0, initial_witness, foreign_call_handler);
|
|
417
|
-
return ret;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
422
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
423
|
-
*
|
|
424
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
425
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
426
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
427
|
-
* @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.
|
|
428
|
-
*/
|
|
429
|
-
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
430
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
431
|
-
const len0 = WASM_VECTOR_LEN;
|
|
432
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, initial_witness, foreign_call_handler);
|
|
433
|
-
return ret;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
438
|
-
*
|
|
439
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
440
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
441
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
442
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
443
|
-
*/
|
|
444
|
-
export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
445
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
446
|
-
const len0 = WASM_VECTOR_LEN;
|
|
447
|
-
const ret = wasm.executeProgram(ptr0, len0, initial_witness, foreign_call_handler);
|
|
448
|
-
return ret;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
451
|
/**
|
|
452
452
|
* Sets the package's logging level.
|
|
453
453
|
*
|
|
@@ -523,15 +523,15 @@ export function getPublicWitness(program, solved_witness) {
|
|
|
523
523
|
}
|
|
524
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,9 +15,6 @@ 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;
|
|
15
|
-
export const executeCircuit: (a: number, b: number, c: any, d: any) => any;
|
|
16
|
-
export const executeCircuitWithReturnWitness: (a: number, b: number, c: any, d: any) => any;
|
|
17
|
-
export const executeProgram: (a: number, b: number, c: any, d: any) => any;
|
|
18
18
|
export const initLogLevel: (a: number, b: number) => [number, number];
|
|
19
19
|
export const getReturnWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
20
20
|
export const getPublicParametersWitness: (a: number, b: number, c: any) => [number, number, number];
|
|
@@ -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;
|