@noir-lang/acvm_js 0.28.0-6e2b70a → 0.28.0-e88ce80.nightly
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/nodejs/acvm_js.d.ts +30 -30
- package/nodejs/acvm_js.js +90 -91
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +5 -5
- package/package.json +5 -3
- package/web/acvm_js.d.ts +35 -35
- package/web/acvm_js.js +87 -88
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +5 -5
package/nodejs/acvm_js.d.ts
CHANGED
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
|
-
*
|
|
6
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
7
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
8
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
9
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
10
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
11
|
-
*/
|
|
12
|
-
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
13
|
-
/**
|
|
14
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
15
|
-
*
|
|
16
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
17
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
18
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
19
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
20
|
-
*/
|
|
21
|
-
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
22
|
-
/**
|
|
23
|
-
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
24
|
-
*/
|
|
25
|
-
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
26
|
-
/**
|
|
27
4
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
28
5
|
*
|
|
29
6
|
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
@@ -38,6 +15,11 @@ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
|
38
15
|
*/
|
|
39
16
|
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
40
17
|
/**
|
|
18
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
19
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
20
|
+
*/
|
|
21
|
+
export function buildInfo(): BuildInfo;
|
|
22
|
+
/**
|
|
41
23
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
42
24
|
* @param {Uint8Array} hashed_msg
|
|
43
25
|
* @param {Uint8Array} public_key_x_bytes
|
|
@@ -89,10 +71,28 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
89
71
|
*/
|
|
90
72
|
export function and(lhs: string, rhs: string): string;
|
|
91
73
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
74
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
75
|
+
*
|
|
76
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
77
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
78
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
79
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
80
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
94
81
|
*/
|
|
95
|
-
export function
|
|
82
|
+
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
83
|
+
/**
|
|
84
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
85
|
+
*
|
|
86
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
87
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
88
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
89
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
90
|
+
*/
|
|
91
|
+
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
92
|
+
/**
|
|
93
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
94
|
+
*/
|
|
95
|
+
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
96
96
|
/**
|
|
97
97
|
* Sets the package's logging level.
|
|
98
98
|
*
|
|
@@ -161,16 +161,16 @@ export type BuildInfo = {
|
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
164
|
export type ExecutionError = Error & {
|
|
169
165
|
callStack?: string[];
|
|
170
166
|
};
|
|
171
167
|
|
|
172
168
|
|
|
173
169
|
|
|
170
|
+
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
174
|
// Map from witness index to hex string value of witness.
|
|
175
175
|
export type WitnessMap = Map<number, string>;
|
|
176
176
|
|
package/nodejs/acvm_js.js
CHANGED
|
@@ -3,28 +3,12 @@ imports['__wbindgen_placeholder__'] = module.exports;
|
|
|
3
3
|
let wasm;
|
|
4
4
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
5
5
|
|
|
6
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
7
|
-
|
|
8
|
-
cachedTextDecoder.decode();
|
|
9
|
-
|
|
10
|
-
let cachedUint8Memory0 = null;
|
|
11
|
-
|
|
12
|
-
function getUint8Memory0() {
|
|
13
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
14
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
15
|
-
}
|
|
16
|
-
return cachedUint8Memory0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
function getStringFromWasm0(ptr, len) {
|
|
20
|
-
ptr = ptr >>> 0;
|
|
21
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
22
|
-
}
|
|
23
|
-
|
|
24
6
|
const heap = new Array(128).fill(undefined);
|
|
25
7
|
|
|
26
8
|
heap.push(undefined, null, true, false);
|
|
27
9
|
|
|
10
|
+
function getObject(idx) { return heap[idx]; }
|
|
11
|
+
|
|
28
12
|
let heap_next = heap.length;
|
|
29
13
|
|
|
30
14
|
function addHeapObject(obj) {
|
|
@@ -36,8 +20,6 @@ function addHeapObject(obj) {
|
|
|
36
20
|
return idx;
|
|
37
21
|
}
|
|
38
22
|
|
|
39
|
-
function getObject(idx) { return heap[idx]; }
|
|
40
|
-
|
|
41
23
|
function dropObject(idx) {
|
|
42
24
|
if (idx < 132) return;
|
|
43
25
|
heap[idx] = heap_next;
|
|
@@ -50,6 +32,24 @@ function takeObject(idx) {
|
|
|
50
32
|
return ret;
|
|
51
33
|
}
|
|
52
34
|
|
|
35
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
36
|
+
|
|
37
|
+
cachedTextDecoder.decode();
|
|
38
|
+
|
|
39
|
+
let cachedUint8Memory0 = null;
|
|
40
|
+
|
|
41
|
+
function getUint8Memory0() {
|
|
42
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
43
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
44
|
+
}
|
|
45
|
+
return cachedUint8Memory0;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getStringFromWasm0(ptr, len) {
|
|
49
|
+
ptr = ptr >>> 0;
|
|
50
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
53
|
function isLikeNone(x) {
|
|
54
54
|
return x === undefined || x === null;
|
|
55
55
|
}
|
|
@@ -229,59 +229,12 @@ function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
|
229
229
|
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb1f60a5b015b6c5(arg0, arg1, addHeapObject(arg2));
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
function _assertClass(instance, klass) {
|
|
233
|
-
if (!(instance instanceof klass)) {
|
|
234
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
235
|
-
}
|
|
236
|
-
return instance.ptr;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
232
|
function passArray8ToWasm0(arg, malloc) {
|
|
240
233
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
241
234
|
getUint8Memory0().set(arg, ptr / 1);
|
|
242
235
|
WASM_VECTOR_LEN = arg.length;
|
|
243
236
|
return ptr;
|
|
244
237
|
}
|
|
245
|
-
/**
|
|
246
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
247
|
-
*
|
|
248
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
249
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
250
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
251
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
252
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
253
|
-
*/
|
|
254
|
-
module.exports.executeCircuitWithBlackBoxSolver = function(solver, circuit, initial_witness, foreign_call_handler) {
|
|
255
|
-
_assertClass(solver, WasmBlackBoxFunctionSolver);
|
|
256
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
257
|
-
const len0 = WASM_VECTOR_LEN;
|
|
258
|
-
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
259
|
-
return takeObject(ret);
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
264
|
-
*
|
|
265
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
266
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
267
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
268
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
269
|
-
*/
|
|
270
|
-
module.exports.executeCircuit = function(circuit, initial_witness, foreign_call_handler) {
|
|
271
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
272
|
-
const len0 = WASM_VECTOR_LEN;
|
|
273
|
-
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
274
|
-
return takeObject(ret);
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
279
|
-
*/
|
|
280
|
-
module.exports.createBlackBoxSolver = function() {
|
|
281
|
-
const ret = wasm.createBlackBoxSolver();
|
|
282
|
-
return takeObject(ret);
|
|
283
|
-
};
|
|
284
|
-
|
|
285
238
|
/**
|
|
286
239
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
287
240
|
*
|
|
@@ -335,6 +288,15 @@ module.exports.compressWitness = function(witness_map) {
|
|
|
335
288
|
}
|
|
336
289
|
};
|
|
337
290
|
|
|
291
|
+
/**
|
|
292
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
293
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
294
|
+
*/
|
|
295
|
+
module.exports.buildInfo = function() {
|
|
296
|
+
const ret = wasm.buildInfo();
|
|
297
|
+
return takeObject(ret);
|
|
298
|
+
};
|
|
299
|
+
|
|
338
300
|
/**
|
|
339
301
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
340
302
|
* @param {Uint8Array} hashed_msg
|
|
@@ -463,12 +425,49 @@ module.exports.and = function(lhs, rhs) {
|
|
|
463
425
|
return takeObject(ret);
|
|
464
426
|
};
|
|
465
427
|
|
|
428
|
+
function _assertClass(instance, klass) {
|
|
429
|
+
if (!(instance instanceof klass)) {
|
|
430
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
431
|
+
}
|
|
432
|
+
return instance.ptr;
|
|
433
|
+
}
|
|
466
434
|
/**
|
|
467
|
-
*
|
|
468
|
-
*
|
|
435
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
436
|
+
*
|
|
437
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
438
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
439
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
440
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
441
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
469
442
|
*/
|
|
470
|
-
module.exports.
|
|
471
|
-
|
|
443
|
+
module.exports.executeCircuitWithBlackBoxSolver = function(solver, circuit, initial_witness, foreign_call_handler) {
|
|
444
|
+
_assertClass(solver, WasmBlackBoxFunctionSolver);
|
|
445
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
446
|
+
const len0 = WASM_VECTOR_LEN;
|
|
447
|
+
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
448
|
+
return takeObject(ret);
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
453
|
+
*
|
|
454
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
455
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
456
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
457
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
458
|
+
*/
|
|
459
|
+
module.exports.executeCircuit = function(circuit, initial_witness, foreign_call_handler) {
|
|
460
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
461
|
+
const len0 = WASM_VECTOR_LEN;
|
|
462
|
+
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
463
|
+
return takeObject(ret);
|
|
464
|
+
};
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
468
|
+
*/
|
|
469
|
+
module.exports.createBlackBoxSolver = function() {
|
|
470
|
+
const ret = wasm.createBlackBoxSolver();
|
|
472
471
|
return takeObject(ret);
|
|
473
472
|
};
|
|
474
473
|
|
|
@@ -627,11 +626,6 @@ class WasmBlackBoxFunctionSolver {
|
|
|
627
626
|
}
|
|
628
627
|
module.exports.WasmBlackBoxFunctionSolver = WasmBlackBoxFunctionSolver;
|
|
629
628
|
|
|
630
|
-
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
631
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
632
|
-
return addHeapObject(ret);
|
|
633
|
-
};
|
|
634
|
-
|
|
635
629
|
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
636
630
|
const ret = getObject(arg0);
|
|
637
631
|
return addHeapObject(ret);
|
|
@@ -641,6 +635,21 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
641
635
|
takeObject(arg0);
|
|
642
636
|
};
|
|
643
637
|
|
|
638
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
639
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
640
|
+
return addHeapObject(ret);
|
|
641
|
+
};
|
|
642
|
+
|
|
643
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
644
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
645
|
+
return ret;
|
|
646
|
+
};
|
|
647
|
+
|
|
648
|
+
module.exports.__wbindgen_is_array = function(arg0) {
|
|
649
|
+
const ret = Array.isArray(getObject(arg0));
|
|
650
|
+
return ret;
|
|
651
|
+
};
|
|
652
|
+
|
|
644
653
|
module.exports.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
|
|
645
654
|
const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
|
|
646
655
|
return addHeapObject(ret);
|
|
@@ -663,9 +672,9 @@ module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
|
663
672
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
664
673
|
};
|
|
665
674
|
|
|
666
|
-
module.exports.
|
|
667
|
-
const ret =
|
|
668
|
-
return ret;
|
|
675
|
+
module.exports.__wbg_constructor_bd5b3ba6619fce81 = function(arg0) {
|
|
676
|
+
const ret = new Error(takeObject(arg0));
|
|
677
|
+
return addHeapObject(ret);
|
|
669
678
|
};
|
|
670
679
|
|
|
671
680
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
@@ -677,11 +686,6 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
677
686
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
678
687
|
};
|
|
679
688
|
|
|
680
|
-
module.exports.__wbg_constructor_bd5b3ba6619fce81 = function(arg0) {
|
|
681
|
-
const ret = new Error(takeObject(arg0));
|
|
682
|
-
return addHeapObject(ret);
|
|
683
|
-
};
|
|
684
|
-
|
|
685
689
|
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
686
690
|
const obj = takeObject(arg0).original;
|
|
687
691
|
if (obj.cnt-- == 1) {
|
|
@@ -702,11 +706,6 @@ module.exports.__wbindgen_number_new = function(arg0) {
|
|
|
702
706
|
return addHeapObject(ret);
|
|
703
707
|
};
|
|
704
708
|
|
|
705
|
-
module.exports.__wbindgen_is_string = function(arg0) {
|
|
706
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
707
|
-
return ret;
|
|
708
|
-
};
|
|
709
|
-
|
|
710
709
|
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
711
710
|
const ret = new Error();
|
|
712
711
|
return addHeapObject(ret);
|
|
@@ -1190,8 +1189,8 @@ module.exports.__wbindgen_function_table = function() {
|
|
|
1190
1189
|
return addHeapObject(ret);
|
|
1191
1190
|
};
|
|
1192
1191
|
|
|
1193
|
-
module.exports.
|
|
1194
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1192
|
+
module.exports.__wbindgen_closure_wrapper602 = function(arg0, arg1, arg2) {
|
|
1193
|
+
const ret = makeMutClosure(arg0, arg1, 189, __wbg_adapter_54);
|
|
1195
1194
|
return addHeapObject(ret);
|
|
1196
1195
|
};
|
|
1197
1196
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
5
|
-
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
6
|
-
export function createBlackBoxSolver(): number;
|
|
7
|
-
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
8
4
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
9
5
|
export function compressWitness(a: number, b: number): void;
|
|
6
|
+
export function buildInfo(): number;
|
|
10
7
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
11
8
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
12
9
|
export function keccak256(a: number, b: number, c: number): void;
|
|
@@ -14,7 +11,10 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
14
11
|
export function sha256(a: number, b: number, c: number): void;
|
|
15
12
|
export function xor(a: number, b: number): number;
|
|
16
13
|
export function and(a: number, b: number): number;
|
|
17
|
-
export function
|
|
14
|
+
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
15
|
+
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
16
|
+
export function createBlackBoxSolver(): number;
|
|
17
|
+
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
18
18
|
export function initLogLevel(a: number): void;
|
|
19
19
|
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
20
20
|
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@noir-lang/acvm_js",
|
|
3
|
-
"version": "0.28.0-
|
|
3
|
+
"version": "0.28.0-e88ce80.nightly",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/noir-lang/acvm.git"
|
|
@@ -28,8 +28,10 @@
|
|
|
28
28
|
"test:browser": "web-test-runner",
|
|
29
29
|
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
|
|
30
30
|
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
|
|
31
|
-
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
|
|
32
|
-
"clean": "chmod u+w web nodejs || true && rm -rf web nodejs"
|
|
31
|
+
"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",
|
|
32
|
+
"clean": "chmod u+w web nodejs || true && rm -rf web nodejs",
|
|
33
|
+
"build:nix": "nix build -L .#acvm_js",
|
|
34
|
+
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/acvm_js/nodejs ./ && cp -rL ./result/acvm_js/web ./"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
package/web/acvm_js.d.ts
CHANGED
|
@@ -1,29 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
5
|
-
*
|
|
6
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
7
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
8
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
9
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
10
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
11
|
-
*/
|
|
12
|
-
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
13
|
-
/**
|
|
14
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
15
|
-
*
|
|
16
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
17
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
18
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
19
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
20
|
-
*/
|
|
21
|
-
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
22
|
-
/**
|
|
23
|
-
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
24
|
-
*/
|
|
25
|
-
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
26
|
-
/**
|
|
27
4
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
28
5
|
*
|
|
29
6
|
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
@@ -38,6 +15,11 @@ export function decompressWitness(compressed_witness: Uint8Array): WitnessMap;
|
|
|
38
15
|
*/
|
|
39
16
|
export function compressWitness(witness_map: WitnessMap): Uint8Array;
|
|
40
17
|
/**
|
|
18
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
19
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
20
|
+
*/
|
|
21
|
+
export function buildInfo(): BuildInfo;
|
|
22
|
+
/**
|
|
41
23
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
42
24
|
* @param {Uint8Array} hashed_msg
|
|
43
25
|
* @param {Uint8Array} public_key_x_bytes
|
|
@@ -89,10 +71,28 @@ export function xor(lhs: string, rhs: string): string;
|
|
|
89
71
|
*/
|
|
90
72
|
export function and(lhs: string, rhs: string): string;
|
|
91
73
|
/**
|
|
92
|
-
*
|
|
93
|
-
*
|
|
74
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
75
|
+
*
|
|
76
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
77
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
78
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
79
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
80
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
94
81
|
*/
|
|
95
|
-
export function
|
|
82
|
+
export function executeCircuitWithBlackBoxSolver(solver: WasmBlackBoxFunctionSolver, circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
83
|
+
/**
|
|
84
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
85
|
+
*
|
|
86
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
87
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
88
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
89
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
90
|
+
*/
|
|
91
|
+
export function executeCircuit(circuit: Uint8Array, initial_witness: WitnessMap, foreign_call_handler: ForeignCallHandler): Promise<WitnessMap>;
|
|
92
|
+
/**
|
|
93
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
94
|
+
*/
|
|
95
|
+
export function createBlackBoxSolver(): Promise<WasmBlackBoxFunctionSolver>;
|
|
96
96
|
/**
|
|
97
97
|
* Sets the package's logging level.
|
|
98
98
|
*
|
|
@@ -161,16 +161,16 @@ export type BuildInfo = {
|
|
|
161
161
|
|
|
162
162
|
|
|
163
163
|
|
|
164
|
-
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
164
|
export type ExecutionError = Error & {
|
|
169
165
|
callStack?: string[];
|
|
170
166
|
};
|
|
171
167
|
|
|
172
168
|
|
|
173
169
|
|
|
170
|
+
export type LogLevel = "OFF" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE";
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
174
|
// Map from witness index to hex string value of witness.
|
|
175
175
|
export type WitnessMap = Map<number, string>;
|
|
176
176
|
|
|
@@ -195,12 +195,9 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
195
195
|
|
|
196
196
|
export interface InitOutput {
|
|
197
197
|
readonly memory: WebAssembly.Memory;
|
|
198
|
-
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
199
|
-
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
200
|
-
readonly createBlackBoxSolver: () => number;
|
|
201
|
-
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
|
|
202
198
|
readonly decompressWitness: (a: number, b: number, c: number) => void;
|
|
203
199
|
readonly compressWitness: (a: number, b: number) => void;
|
|
200
|
+
readonly buildInfo: () => number;
|
|
204
201
|
readonly ecdsa_secp256r1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
205
202
|
readonly ecdsa_secp256k1_verify: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => number;
|
|
206
203
|
readonly keccak256: (a: number, b: number, c: number) => void;
|
|
@@ -208,7 +205,10 @@ export interface InitOutput {
|
|
|
208
205
|
readonly sha256: (a: number, b: number, c: number) => void;
|
|
209
206
|
readonly xor: (a: number, b: number) => number;
|
|
210
207
|
readonly and: (a: number, b: number) => number;
|
|
211
|
-
readonly
|
|
208
|
+
readonly executeCircuitWithBlackBoxSolver: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
209
|
+
readonly executeCircuit: (a: number, b: number, c: number, d: number) => number;
|
|
210
|
+
readonly createBlackBoxSolver: () => number;
|
|
211
|
+
readonly __wbg_wasmblackboxfunctionsolver_free: (a: number) => void;
|
|
212
212
|
readonly initLogLevel: (a: number) => void;
|
|
213
213
|
readonly getPublicWitness: (a: number, b: number, c: number, d: number) => void;
|
|
214
214
|
readonly getPublicParametersWitness: (a: number, b: number, c: number, d: number) => void;
|
package/web/acvm_js.js
CHANGED
|
@@ -1,27 +1,11 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
4
|
-
|
|
5
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
6
|
-
|
|
7
|
-
let cachedUint8Memory0 = null;
|
|
8
|
-
|
|
9
|
-
function getUint8Memory0() {
|
|
10
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
11
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
12
|
-
}
|
|
13
|
-
return cachedUint8Memory0;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function getStringFromWasm0(ptr, len) {
|
|
17
|
-
ptr = ptr >>> 0;
|
|
18
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
19
|
-
}
|
|
20
|
-
|
|
21
3
|
const heap = new Array(128).fill(undefined);
|
|
22
4
|
|
|
23
5
|
heap.push(undefined, null, true, false);
|
|
24
6
|
|
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
|
8
|
+
|
|
25
9
|
let heap_next = heap.length;
|
|
26
10
|
|
|
27
11
|
function addHeapObject(obj) {
|
|
@@ -33,8 +17,6 @@ function addHeapObject(obj) {
|
|
|
33
17
|
return idx;
|
|
34
18
|
}
|
|
35
19
|
|
|
36
|
-
function getObject(idx) { return heap[idx]; }
|
|
37
|
-
|
|
38
20
|
function dropObject(idx) {
|
|
39
21
|
if (idx < 132) return;
|
|
40
22
|
heap[idx] = heap_next;
|
|
@@ -47,6 +29,24 @@ function takeObject(idx) {
|
|
|
47
29
|
return ret;
|
|
48
30
|
}
|
|
49
31
|
|
|
32
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
33
|
+
|
|
34
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
35
|
+
|
|
36
|
+
let cachedUint8Memory0 = null;
|
|
37
|
+
|
|
38
|
+
function getUint8Memory0() {
|
|
39
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
40
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
41
|
+
}
|
|
42
|
+
return cachedUint8Memory0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function getStringFromWasm0(ptr, len) {
|
|
46
|
+
ptr = ptr >>> 0;
|
|
47
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
50
|
function isLikeNone(x) {
|
|
51
51
|
return x === undefined || x === null;
|
|
52
52
|
}
|
|
@@ -226,59 +226,12 @@ function __wbg_adapter_54(arg0, arg1, arg2) {
|
|
|
226
226
|
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__heb1f60a5b015b6c5(arg0, arg1, addHeapObject(arg2));
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
function _assertClass(instance, klass) {
|
|
230
|
-
if (!(instance instanceof klass)) {
|
|
231
|
-
throw new Error(`expected instance of ${klass.name}`);
|
|
232
|
-
}
|
|
233
|
-
return instance.ptr;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
229
|
function passArray8ToWasm0(arg, malloc) {
|
|
237
230
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
238
231
|
getUint8Memory0().set(arg, ptr / 1);
|
|
239
232
|
WASM_VECTOR_LEN = arg.length;
|
|
240
233
|
return ptr;
|
|
241
234
|
}
|
|
242
|
-
/**
|
|
243
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
244
|
-
*
|
|
245
|
-
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
246
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
247
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
248
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
249
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
250
|
-
*/
|
|
251
|
-
export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) {
|
|
252
|
-
_assertClass(solver, WasmBlackBoxFunctionSolver);
|
|
253
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
254
|
-
const len0 = WASM_VECTOR_LEN;
|
|
255
|
-
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
256
|
-
return takeObject(ret);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
261
|
-
*
|
|
262
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
263
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
264
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
265
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
266
|
-
*/
|
|
267
|
-
export function executeCircuit(circuit, initial_witness, foreign_call_handler) {
|
|
268
|
-
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
269
|
-
const len0 = WASM_VECTOR_LEN;
|
|
270
|
-
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
271
|
-
return takeObject(ret);
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
276
|
-
*/
|
|
277
|
-
export function createBlackBoxSolver() {
|
|
278
|
-
const ret = wasm.createBlackBoxSolver();
|
|
279
|
-
return takeObject(ret);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
235
|
/**
|
|
283
236
|
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
284
237
|
*
|
|
@@ -332,6 +285,15 @@ export function compressWitness(witness_map) {
|
|
|
332
285
|
}
|
|
333
286
|
}
|
|
334
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
290
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
291
|
+
*/
|
|
292
|
+
export function buildInfo() {
|
|
293
|
+
const ret = wasm.buildInfo();
|
|
294
|
+
return takeObject(ret);
|
|
295
|
+
}
|
|
296
|
+
|
|
335
297
|
/**
|
|
336
298
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
337
299
|
* @param {Uint8Array} hashed_msg
|
|
@@ -460,12 +422,49 @@ export function and(lhs, rhs) {
|
|
|
460
422
|
return takeObject(ret);
|
|
461
423
|
}
|
|
462
424
|
|
|
425
|
+
function _assertClass(instance, klass) {
|
|
426
|
+
if (!(instance instanceof klass)) {
|
|
427
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
428
|
+
}
|
|
429
|
+
return instance.ptr;
|
|
430
|
+
}
|
|
463
431
|
/**
|
|
464
|
-
*
|
|
465
|
-
*
|
|
432
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
433
|
+
*
|
|
434
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
435
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
436
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
437
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
438
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
466
439
|
*/
|
|
467
|
-
export function
|
|
468
|
-
|
|
440
|
+
export function executeCircuitWithBlackBoxSolver(solver, circuit, initial_witness, foreign_call_handler) {
|
|
441
|
+
_assertClass(solver, WasmBlackBoxFunctionSolver);
|
|
442
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
443
|
+
const len0 = WASM_VECTOR_LEN;
|
|
444
|
+
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
445
|
+
return takeObject(ret);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
450
|
+
*
|
|
451
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
452
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
453
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
454
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
455
|
+
*/
|
|
456
|
+
export function executeCircuit(circuit, initial_witness, foreign_call_handler) {
|
|
457
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
458
|
+
const len0 = WASM_VECTOR_LEN;
|
|
459
|
+
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
460
|
+
return takeObject(ret);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
465
|
+
*/
|
|
466
|
+
export function createBlackBoxSolver() {
|
|
467
|
+
const ret = wasm.createBlackBoxSolver();
|
|
469
468
|
return takeObject(ret);
|
|
470
469
|
}
|
|
471
470
|
|
|
@@ -656,10 +655,6 @@ async function __wbg_load(module, imports) {
|
|
|
656
655
|
function __wbg_get_imports() {
|
|
657
656
|
const imports = {};
|
|
658
657
|
imports.wbg = {};
|
|
659
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
660
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
661
|
-
return addHeapObject(ret);
|
|
662
|
-
};
|
|
663
658
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
664
659
|
const ret = getObject(arg0);
|
|
665
660
|
return addHeapObject(ret);
|
|
@@ -667,6 +662,18 @@ function __wbg_get_imports() {
|
|
|
667
662
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
668
663
|
takeObject(arg0);
|
|
669
664
|
};
|
|
665
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
666
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
667
|
+
return addHeapObject(ret);
|
|
668
|
+
};
|
|
669
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
670
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
671
|
+
return ret;
|
|
672
|
+
};
|
|
673
|
+
imports.wbg.__wbindgen_is_array = function(arg0) {
|
|
674
|
+
const ret = Array.isArray(getObject(arg0));
|
|
675
|
+
return ret;
|
|
676
|
+
};
|
|
670
677
|
imports.wbg.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
|
|
671
678
|
const ret = WasmBlackBoxFunctionSolver.__wrap(arg0);
|
|
672
679
|
return addHeapObject(ret);
|
|
@@ -685,9 +692,9 @@ function __wbg_get_imports() {
|
|
|
685
692
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
686
693
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
687
694
|
};
|
|
688
|
-
imports.wbg.
|
|
689
|
-
const ret =
|
|
690
|
-
return ret;
|
|
695
|
+
imports.wbg.__wbg_constructor_bd5b3ba6619fce81 = function(arg0) {
|
|
696
|
+
const ret = new Error(takeObject(arg0));
|
|
697
|
+
return addHeapObject(ret);
|
|
691
698
|
};
|
|
692
699
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
693
700
|
const obj = getObject(arg1);
|
|
@@ -697,10 +704,6 @@ function __wbg_get_imports() {
|
|
|
697
704
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
698
705
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
699
706
|
};
|
|
700
|
-
imports.wbg.__wbg_constructor_bd5b3ba6619fce81 = function(arg0) {
|
|
701
|
-
const ret = new Error(takeObject(arg0));
|
|
702
|
-
return addHeapObject(ret);
|
|
703
|
-
};
|
|
704
707
|
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
705
708
|
const obj = takeObject(arg0).original;
|
|
706
709
|
if (obj.cnt-- == 1) {
|
|
@@ -718,10 +721,6 @@ function __wbg_get_imports() {
|
|
|
718
721
|
const ret = arg0;
|
|
719
722
|
return addHeapObject(ret);
|
|
720
723
|
};
|
|
721
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
722
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
723
|
-
return ret;
|
|
724
|
-
};
|
|
725
724
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
726
725
|
const ret = new Error();
|
|
727
726
|
return addHeapObject(ret);
|
|
@@ -1120,8 +1119,8 @@ function __wbg_get_imports() {
|
|
|
1120
1119
|
const ret = wasm.__wbindgen_export_2;
|
|
1121
1120
|
return addHeapObject(ret);
|
|
1122
1121
|
};
|
|
1123
|
-
imports.wbg.
|
|
1124
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1122
|
+
imports.wbg.__wbindgen_closure_wrapper602 = function(arg0, arg1, arg2) {
|
|
1123
|
+
const ret = makeMutClosure(arg0, arg1, 189, __wbg_adapter_54);
|
|
1125
1124
|
return addHeapObject(ret);
|
|
1126
1125
|
};
|
|
1127
1126
|
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
5
|
-
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
6
|
-
export function createBlackBoxSolver(): number;
|
|
7
|
-
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
8
4
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
9
5
|
export function compressWitness(a: number, b: number): void;
|
|
6
|
+
export function buildInfo(): number;
|
|
10
7
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
11
8
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
12
9
|
export function keccak256(a: number, b: number, c: number): void;
|
|
@@ -14,7 +11,10 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
14
11
|
export function sha256(a: number, b: number, c: number): void;
|
|
15
12
|
export function xor(a: number, b: number): number;
|
|
16
13
|
export function and(a: number, b: number): number;
|
|
17
|
-
export function
|
|
14
|
+
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
15
|
+
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
16
|
+
export function createBlackBoxSolver(): number;
|
|
17
|
+
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
18
18
|
export function initLogLevel(a: number): void;
|
|
19
19
|
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
20
20
|
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|