@noir-lang/acvm_js 0.39.0 → 0.40.0-a7cc16b.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 +59 -59
- package/nodejs/acvm_js.js +211 -202
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +10 -10
- package/package.json +2 -2
- package/web/acvm_js.d.ts +69 -69
- package/web/acvm_js.js +204 -195
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +10 -10
package/nodejs/acvm_js.js
CHANGED
|
@@ -11,6 +11,15 @@ function getObject(idx) { return heap[idx]; }
|
|
|
11
11
|
|
|
12
12
|
let heap_next = heap.length;
|
|
13
13
|
|
|
14
|
+
function addHeapObject(obj) {
|
|
15
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
16
|
+
const idx = heap_next;
|
|
17
|
+
heap_next = heap[idx];
|
|
18
|
+
|
|
19
|
+
heap[idx] = obj;
|
|
20
|
+
return idx;
|
|
21
|
+
}
|
|
22
|
+
|
|
14
23
|
function dropObject(idx) {
|
|
15
24
|
if (idx < 132) return;
|
|
16
25
|
heap[idx] = heap_next;
|
|
@@ -41,37 +50,6 @@ function getStringFromWasm0(ptr, len) {
|
|
|
41
50
|
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
42
51
|
}
|
|
43
52
|
|
|
44
|
-
function addHeapObject(obj) {
|
|
45
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
46
|
-
const idx = heap_next;
|
|
47
|
-
heap_next = heap[idx];
|
|
48
|
-
|
|
49
|
-
heap[idx] = obj;
|
|
50
|
-
return idx;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function isLikeNone(x) {
|
|
54
|
-
return x === undefined || x === null;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let cachedFloat64Memory0 = null;
|
|
58
|
-
|
|
59
|
-
function getFloat64Memory0() {
|
|
60
|
-
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
61
|
-
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
62
|
-
}
|
|
63
|
-
return cachedFloat64Memory0;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let cachedInt32Memory0 = null;
|
|
67
|
-
|
|
68
|
-
function getInt32Memory0() {
|
|
69
|
-
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
70
|
-
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
71
|
-
}
|
|
72
|
-
return cachedInt32Memory0;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
53
|
let WASM_VECTOR_LEN = 0;
|
|
76
54
|
|
|
77
55
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
@@ -127,6 +105,28 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
127
105
|
return ptr;
|
|
128
106
|
}
|
|
129
107
|
|
|
108
|
+
function isLikeNone(x) {
|
|
109
|
+
return x === undefined || x === null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
let cachedInt32Memory0 = null;
|
|
113
|
+
|
|
114
|
+
function getInt32Memory0() {
|
|
115
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
116
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
117
|
+
}
|
|
118
|
+
return cachedInt32Memory0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let cachedFloat64Memory0 = null;
|
|
122
|
+
|
|
123
|
+
function getFloat64Memory0() {
|
|
124
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
125
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
126
|
+
}
|
|
127
|
+
return cachedFloat64Memory0;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
130
|
let cachedBigInt64Memory0 = null;
|
|
131
131
|
|
|
132
132
|
function getBigInt64Memory0() {
|
|
@@ -226,15 +226,17 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
226
226
|
return real;
|
|
227
227
|
}
|
|
228
228
|
function __wbg_adapter_52(arg0, arg1, arg2) {
|
|
229
|
-
wasm.
|
|
229
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbc7b25f504ae2d81(arg0, arg1, addHeapObject(arg2));
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
232
|
+
/**
|
|
233
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
234
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
235
|
+
*/
|
|
236
|
+
module.exports.buildInfo = function() {
|
|
237
|
+
const ret = wasm.buildInfo();
|
|
238
|
+
return takeObject(ret);
|
|
239
|
+
};
|
|
238
240
|
|
|
239
241
|
function passArray8ToWasm0(arg, malloc) {
|
|
240
242
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
@@ -242,46 +244,6 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
242
244
|
WASM_VECTOR_LEN = arg.length;
|
|
243
245
|
return ptr;
|
|
244
246
|
}
|
|
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
247
|
/**
|
|
286
248
|
* Verifies a ECDSA signature over the secp256r1 curve.
|
|
287
249
|
* @param {Uint8Array} hashed_msg
|
|
@@ -414,28 +376,49 @@ module.exports.and = function(lhs, rhs) {
|
|
|
414
376
|
};
|
|
415
377
|
|
|
416
378
|
/**
|
|
417
|
-
*
|
|
379
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
418
380
|
*
|
|
419
|
-
* @param {
|
|
381
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
382
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
383
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
384
|
+
* @param {Uint8Array} circuit
|
|
385
|
+
* @param {WitnessMap} solved_witness
|
|
386
|
+
* @returns {WitnessMap}
|
|
420
387
|
*/
|
|
421
|
-
module.exports.
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
388
|
+
module.exports.getPublicWitness = function(circuit, solved_witness) {
|
|
389
|
+
try {
|
|
390
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
391
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
392
|
+
const len0 = WASM_VECTOR_LEN;
|
|
393
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
394
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
395
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
396
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
397
|
+
if (r2) {
|
|
398
|
+
throw takeObject(r1);
|
|
399
|
+
}
|
|
400
|
+
return takeObject(r0);
|
|
401
|
+
} finally {
|
|
402
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
403
|
+
}
|
|
425
404
|
};
|
|
426
405
|
|
|
427
406
|
/**
|
|
428
|
-
*
|
|
407
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
429
408
|
*
|
|
430
|
-
* @param {Uint8Array}
|
|
431
|
-
* @
|
|
409
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
410
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
411
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
412
|
+
* @param {Uint8Array} circuit
|
|
413
|
+
* @param {WitnessMap} solved_witness
|
|
414
|
+
* @returns {WitnessMap}
|
|
432
415
|
*/
|
|
433
|
-
module.exports.
|
|
416
|
+
module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
|
|
434
417
|
try {
|
|
435
418
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
436
|
-
const ptr0 = passArray8ToWasm0(
|
|
419
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
437
420
|
const len0 = WASM_VECTOR_LEN;
|
|
438
|
-
wasm.
|
|
421
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
439
422
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
440
423
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
441
424
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -449,83 +432,112 @@ module.exports.decompressWitness = function(compressed_witness) {
|
|
|
449
432
|
};
|
|
450
433
|
|
|
451
434
|
/**
|
|
452
|
-
*
|
|
435
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
453
436
|
*
|
|
454
|
-
* @param {Uint8Array}
|
|
455
|
-
* @
|
|
437
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
438
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
439
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
440
|
+
* @param {Uint8Array} circuit
|
|
441
|
+
* @param {WitnessMap} witness_map
|
|
442
|
+
* @returns {WitnessMap}
|
|
456
443
|
*/
|
|
457
|
-
module.exports.
|
|
444
|
+
module.exports.getReturnWitness = function(circuit, witness_map) {
|
|
458
445
|
try {
|
|
459
446
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
460
|
-
|
|
447
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
448
|
+
const len0 = WASM_VECTOR_LEN;
|
|
449
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
461
450
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
462
451
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
463
452
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
throw takeObject(r2);
|
|
453
|
+
if (r2) {
|
|
454
|
+
throw takeObject(r1);
|
|
467
455
|
}
|
|
468
|
-
|
|
469
|
-
wasm.__wbindgen_free(r0, r1 * 1);
|
|
470
|
-
return v1;
|
|
456
|
+
return takeObject(r0);
|
|
471
457
|
} finally {
|
|
472
458
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
473
459
|
}
|
|
474
460
|
};
|
|
475
461
|
|
|
462
|
+
function _assertClass(instance, klass) {
|
|
463
|
+
if (!(instance instanceof klass)) {
|
|
464
|
+
throw new Error(`expected instance of ${klass.name}`);
|
|
465
|
+
}
|
|
466
|
+
return instance.ptr;
|
|
467
|
+
}
|
|
476
468
|
/**
|
|
477
|
-
*
|
|
478
|
-
*
|
|
469
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
470
|
+
*
|
|
471
|
+
* @param {&WasmBlackBoxFunctionSolver} solver - A black box solver.
|
|
472
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
473
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
474
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
475
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
479
476
|
*/
|
|
480
|
-
module.exports.
|
|
481
|
-
|
|
477
|
+
module.exports.executeCircuitWithBlackBoxSolver = function(solver, circuit, initial_witness, foreign_call_handler) {
|
|
478
|
+
_assertClass(solver, WasmBlackBoxFunctionSolver);
|
|
479
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
480
|
+
const len0 = WASM_VECTOR_LEN;
|
|
481
|
+
const ret = wasm.executeCircuitWithBlackBoxSolver(solver.__wbg_ptr, ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
482
482
|
return takeObject(ret);
|
|
483
483
|
};
|
|
484
484
|
|
|
485
485
|
/**
|
|
486
|
-
*
|
|
486
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
487
487
|
*
|
|
488
488
|
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
489
|
-
* @param {WitnessMap}
|
|
490
|
-
* @
|
|
491
|
-
* @
|
|
492
|
-
* @param {WitnessMap} solved_witness
|
|
493
|
-
* @returns {WitnessMap}
|
|
489
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
490
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
491
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
494
492
|
*/
|
|
495
|
-
module.exports.
|
|
493
|
+
module.exports.executeCircuit = function(circuit, initial_witness, foreign_call_handler) {
|
|
494
|
+
const ptr0 = passArray8ToWasm0(circuit, wasm.__wbindgen_malloc);
|
|
495
|
+
const len0 = WASM_VECTOR_LEN;
|
|
496
|
+
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
497
|
+
return takeObject(ret);
|
|
498
|
+
};
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* @returns {Promise<WasmBlackBoxFunctionSolver>}
|
|
502
|
+
*/
|
|
503
|
+
module.exports.createBlackBoxSolver = function() {
|
|
504
|
+
const ret = wasm.createBlackBoxSolver();
|
|
505
|
+
return takeObject(ret);
|
|
506
|
+
};
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Sets the package's logging level.
|
|
510
|
+
*
|
|
511
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
512
|
+
*/
|
|
513
|
+
module.exports.initLogLevel = function(filter) {
|
|
496
514
|
try {
|
|
497
515
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
498
|
-
const ptr0 =
|
|
516
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
517
|
const len0 = WASM_VECTOR_LEN;
|
|
500
|
-
wasm.
|
|
518
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
501
519
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
502
520
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
throw takeObject(r1);
|
|
521
|
+
if (r1) {
|
|
522
|
+
throw takeObject(r0);
|
|
506
523
|
}
|
|
507
|
-
return takeObject(r0);
|
|
508
524
|
} finally {
|
|
509
525
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
510
526
|
}
|
|
511
527
|
};
|
|
512
528
|
|
|
513
529
|
/**
|
|
514
|
-
*
|
|
530
|
+
* Decompresses a compressed witness as outputted by Nargo into a `WitnessMap`.
|
|
515
531
|
*
|
|
516
|
-
* @param {Uint8Array}
|
|
517
|
-
* @
|
|
518
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
519
|
-
* @param {Uint8Array} circuit
|
|
520
|
-
* @param {WitnessMap} solved_witness
|
|
521
|
-
* @returns {WitnessMap}
|
|
532
|
+
* @param {Uint8Array} compressed_witness - A compressed witness.
|
|
533
|
+
* @returns {WitnessMap} The decompressed witness map.
|
|
522
534
|
*/
|
|
523
|
-
module.exports.
|
|
535
|
+
module.exports.decompressWitness = function(compressed_witness) {
|
|
524
536
|
try {
|
|
525
537
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
526
|
-
const ptr0 = passArray8ToWasm0(
|
|
538
|
+
const ptr0 = passArray8ToWasm0(compressed_witness, wasm.__wbindgen_malloc);
|
|
527
539
|
const len0 = WASM_VECTOR_LEN;
|
|
528
|
-
wasm.
|
|
540
|
+
wasm.decompressWitness(retptr, ptr0, len0);
|
|
529
541
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
530
542
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
531
543
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
@@ -539,28 +551,25 @@ module.exports.getPublicParametersWitness = function(circuit, solved_witness) {
|
|
|
539
551
|
};
|
|
540
552
|
|
|
541
553
|
/**
|
|
542
|
-
*
|
|
554
|
+
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
543
555
|
*
|
|
544
|
-
* @param {Uint8Array}
|
|
545
|
-
* @
|
|
546
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
547
|
-
* @param {Uint8Array} circuit
|
|
548
|
-
* @param {WitnessMap} witness_map
|
|
549
|
-
* @returns {WitnessMap}
|
|
556
|
+
* @param {Uint8Array} compressed_witness - A witness map.
|
|
557
|
+
* @returns {WitnessMap} A compressed witness map
|
|
550
558
|
*/
|
|
551
|
-
module.exports.
|
|
559
|
+
module.exports.compressWitness = function(witness_map) {
|
|
552
560
|
try {
|
|
553
561
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
554
|
-
|
|
555
|
-
const len0 = WASM_VECTOR_LEN;
|
|
556
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
562
|
+
wasm.compressWitness(retptr, addHeapObject(witness_map));
|
|
557
563
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
558
564
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
559
565
|
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
560
|
-
|
|
561
|
-
|
|
566
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
567
|
+
if (r3) {
|
|
568
|
+
throw takeObject(r2);
|
|
562
569
|
}
|
|
563
|
-
|
|
570
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
571
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
572
|
+
return v1;
|
|
564
573
|
} finally {
|
|
565
574
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
566
575
|
}
|
|
@@ -574,7 +583,7 @@ function handleError(f, args) {
|
|
|
574
583
|
}
|
|
575
584
|
}
|
|
576
585
|
function __wbg_adapter_159(arg0, arg1, arg2, arg3) {
|
|
577
|
-
wasm.
|
|
586
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h01a3aca130342b1a(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
578
587
|
}
|
|
579
588
|
|
|
580
589
|
/**
|
|
@@ -628,6 +637,11 @@ class WasmBlackBoxFunctionSolver {
|
|
|
628
637
|
}
|
|
629
638
|
module.exports.WasmBlackBoxFunctionSolver = WasmBlackBoxFunctionSolver;
|
|
630
639
|
|
|
640
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
641
|
+
const ret = getObject(arg0);
|
|
642
|
+
return addHeapObject(ret);
|
|
643
|
+
};
|
|
644
|
+
|
|
631
645
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
632
646
|
takeObject(arg0);
|
|
633
647
|
};
|
|
@@ -637,39 +651,42 @@ module.exports.__wbg_wasmblackboxfunctionsolver_new = function(arg0) {
|
|
|
637
651
|
return addHeapObject(ret);
|
|
638
652
|
};
|
|
639
653
|
|
|
640
|
-
module.exports.__wbindgen_is_array = function(arg0) {
|
|
641
|
-
const ret = Array.isArray(getObject(arg0));
|
|
642
|
-
return ret;
|
|
643
|
-
};
|
|
644
|
-
|
|
645
654
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
646
655
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
647
656
|
return addHeapObject(ret);
|
|
648
657
|
};
|
|
649
658
|
|
|
650
|
-
module.exports.
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
654
|
-
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
659
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
660
|
+
const ret = getObject(arg0) === undefined;
|
|
661
|
+
return ret;
|
|
655
662
|
};
|
|
656
663
|
|
|
657
|
-
module.exports.
|
|
658
|
-
const ret =
|
|
664
|
+
module.exports.__wbg_constructor_8444207292d12e94 = function(arg0) {
|
|
665
|
+
const ret = new Error(takeObject(arg0));
|
|
659
666
|
return addHeapObject(ret);
|
|
660
667
|
};
|
|
661
668
|
|
|
662
|
-
module.exports.
|
|
663
|
-
const
|
|
664
|
-
|
|
669
|
+
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
670
|
+
const obj = takeObject(arg0).original;
|
|
671
|
+
if (obj.cnt-- == 1) {
|
|
672
|
+
obj.a = 0;
|
|
673
|
+
return true;
|
|
674
|
+
}
|
|
675
|
+
const ret = false;
|
|
676
|
+
return ret;
|
|
665
677
|
};
|
|
666
678
|
|
|
667
|
-
module.exports.
|
|
668
|
-
const ret =
|
|
679
|
+
module.exports.__wbindgen_is_array = function(arg0) {
|
|
680
|
+
const ret = Array.isArray(getObject(arg0));
|
|
669
681
|
return ret;
|
|
670
682
|
};
|
|
671
683
|
|
|
672
|
-
module.exports.
|
|
684
|
+
module.exports.__wbindgen_error_new = function(arg0, arg1) {
|
|
685
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
686
|
+
return addHeapObject(ret);
|
|
687
|
+
};
|
|
688
|
+
|
|
689
|
+
module.exports.__wbg_new_12499e712355d566 = function() {
|
|
673
690
|
const ret = new Map();
|
|
674
691
|
return addHeapObject(ret);
|
|
675
692
|
};
|
|
@@ -688,23 +705,15 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
688
705
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
689
706
|
};
|
|
690
707
|
|
|
691
|
-
module.exports.
|
|
692
|
-
const obj =
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
}
|
|
697
|
-
const ret = false;
|
|
698
|
-
return ret;
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
module.exports.__wbg_constructor_6648e7ae005cd460 = function(arg0) {
|
|
702
|
-
const ret = new Error(takeObject(arg0));
|
|
703
|
-
return addHeapObject(ret);
|
|
708
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
709
|
+
const obj = getObject(arg1);
|
|
710
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
711
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
712
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
704
713
|
};
|
|
705
714
|
|
|
706
|
-
module.exports.
|
|
707
|
-
const ret = getObject(arg0) ===
|
|
715
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
716
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
708
717
|
return ret;
|
|
709
718
|
};
|
|
710
719
|
|
|
@@ -733,16 +742,6 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
733
742
|
}
|
|
734
743
|
};
|
|
735
744
|
|
|
736
|
-
module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
737
|
-
const ret = arg0;
|
|
738
|
-
return addHeapObject(ret);
|
|
739
|
-
};
|
|
740
|
-
|
|
741
|
-
module.exports.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
|
|
742
|
-
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
|
|
743
|
-
return addHeapObject(ret);
|
|
744
|
-
};
|
|
745
|
-
|
|
746
745
|
module.exports.__wbindgen_ge = function(arg0, arg1) {
|
|
747
746
|
const ret = getObject(arg0) >= getObject(arg1);
|
|
748
747
|
return ret;
|
|
@@ -768,15 +767,14 @@ module.exports.__wbindgen_is_bigint = function(arg0) {
|
|
|
768
767
|
return ret;
|
|
769
768
|
};
|
|
770
769
|
|
|
771
|
-
module.exports.
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
return ret;
|
|
770
|
+
module.exports.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
771
|
+
const ret = arg0;
|
|
772
|
+
return addHeapObject(ret);
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
module.exports.__wbindgen_bigint_from_u128 = function(arg0, arg1) {
|
|
776
|
+
const ret = BigInt.asUintN(64, arg0) << BigInt(64) | BigInt.asUintN(64, arg1);
|
|
777
|
+
return addHeapObject(ret);
|
|
780
778
|
};
|
|
781
779
|
|
|
782
780
|
module.exports.__wbindgen_is_function = function(arg0) {
|
|
@@ -790,6 +788,17 @@ module.exports.__wbindgen_is_object = function(arg0) {
|
|
|
790
788
|
return ret;
|
|
791
789
|
};
|
|
792
790
|
|
|
791
|
+
module.exports.__wbg_instanceof_Global_1c3b64df1a5c886c = function(arg0) {
|
|
792
|
+
let result;
|
|
793
|
+
try {
|
|
794
|
+
result = getObject(arg0) instanceof WebAssembly.Global;
|
|
795
|
+
} catch {
|
|
796
|
+
result = false;
|
|
797
|
+
}
|
|
798
|
+
const ret = result;
|
|
799
|
+
return ret;
|
|
800
|
+
};
|
|
801
|
+
|
|
793
802
|
module.exports.__wbg_crypto_c48a774b022d20ac = function(arg0) {
|
|
794
803
|
const ret = getObject(arg0).crypto;
|
|
795
804
|
return addHeapObject(ret);
|
|
@@ -1120,6 +1129,11 @@ module.exports.__wbg_subarray_d82be056deb4ad27 = function(arg0, arg1, arg2) {
|
|
|
1120
1129
|
return addHeapObject(ret);
|
|
1121
1130
|
};
|
|
1122
1131
|
|
|
1132
|
+
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
1133
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
1134
|
+
return addHeapObject(ret);
|
|
1135
|
+
}, arguments) };
|
|
1136
|
+
|
|
1123
1137
|
module.exports.__wbg_compile_eefe73dfb19bff3d = function(arg0) {
|
|
1124
1138
|
const ret = WebAssembly.compile(getObject(arg0));
|
|
1125
1139
|
return addHeapObject(ret);
|
|
@@ -1187,11 +1201,6 @@ module.exports.__wbg_set_07da13cc24b69217 = function() { return handleError(func
|
|
|
1187
1201
|
return ret;
|
|
1188
1202
|
}, arguments) };
|
|
1189
1203
|
|
|
1190
|
-
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
1191
|
-
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
1192
|
-
return addHeapObject(ret);
|
|
1193
|
-
}, arguments) };
|
|
1194
|
-
|
|
1195
1204
|
module.exports.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
1196
1205
|
const v = getObject(arg1);
|
|
1197
1206
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
@@ -1221,8 +1230,8 @@ module.exports.__wbindgen_function_table = function() {
|
|
|
1221
1230
|
return addHeapObject(ret);
|
|
1222
1231
|
};
|
|
1223
1232
|
|
|
1224
|
-
module.exports.
|
|
1225
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1233
|
+
module.exports.__wbindgen_closure_wrapper1396 = function(arg0, arg1, arg2) {
|
|
1234
|
+
const ret = makeMutClosure(arg0, arg1, 479, __wbg_adapter_52);
|
|
1226
1235
|
return addHeapObject(ret);
|
|
1227
1236
|
};
|
|
1228
1237
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function
|
|
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;
|
|
4
|
+
export function buildInfo(): number;
|
|
8
5
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
9
6
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
10
7
|
export function keccak256(a: number, b: number, c: number): void;
|
|
@@ -12,20 +9,23 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
12
9
|
export function sha256(a: number, b: number, c: number): void;
|
|
13
10
|
export function xor(a: number, b: number): number;
|
|
14
11
|
export function and(a: number, b: number): number;
|
|
15
|
-
export function initLogLevel(a: number, b: number): void;
|
|
16
|
-
export function decompressWitness(a: number, b: number, c: number): void;
|
|
17
|
-
export function compressWitness(a: number, b: number): void;
|
|
18
|
-
export function buildInfo(): number;
|
|
19
12
|
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
20
13
|
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
21
14
|
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
15
|
+
export function executeCircuitWithBlackBoxSolver(a: number, b: number, c: number, d: number, e: number): number;
|
|
16
|
+
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
17
|
+
export function createBlackBoxSolver(): number;
|
|
18
|
+
export function __wbg_wasmblackboxfunctionsolver_free(a: number): void;
|
|
19
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
20
|
+
export function decompressWitness(a: number, b: number, c: number): void;
|
|
21
|
+
export function compressWitness(a: number, b: number): void;
|
|
22
22
|
export function __wbg_trap_free(a: number): void;
|
|
23
23
|
export function trap___wbg_wasmer_trap(): void;
|
|
24
24
|
export function __wbindgen_malloc(a: number): number;
|
|
25
25
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
26
26
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
27
|
-
export function
|
|
27
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hbc7b25f504ae2d81(a: number, b: number, c: number): void;
|
|
28
28
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
29
29
|
export function __wbindgen_free(a: number, b: number): void;
|
|
30
30
|
export function __wbindgen_exn_store(a: number): void;
|
|
31
|
-
export function
|
|
31
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h01a3aca130342b1a(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.
|
|
3
|
+
"version": "0.40.0-a7cc16b.nightly",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@web/test-runner": "^0.15.3",
|
|
45
45
|
"@web/test-runner-playwright": "^0.10.0",
|
|
46
46
|
"chai": "^4.3.7",
|
|
47
|
-
"eslint": "^8.
|
|
47
|
+
"eslint": "^8.56.0",
|
|
48
48
|
"eslint-plugin-prettier": "^5.0.0",
|
|
49
49
|
"mocha": "^10.2.0",
|
|
50
50
|
"prettier": "3.0.3",
|