@noir-lang/acvm_js 0.48.0 → 0.49.0-21425de.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 +100 -98
- package/nodejs/acvm_js.js +205 -204
- package/nodejs/acvm_js_bg.wasm +0 -0
- package/nodejs/acvm_js_bg.wasm.d.ts +11 -11
- package/package.json +1 -1
- package/web/acvm_js.d.ts +111 -109
- package/web/acvm_js.js +203 -202
- package/web/acvm_js_bg.wasm +0 -0
- package/web/acvm_js_bg.wasm.d.ts +11 -11
package/nodejs/acvm_js.js
CHANGED
|
@@ -9,20 +9,6 @@ heap.push(undefined, null, true, false);
|
|
|
9
9
|
|
|
10
10
|
function getObject(idx) { return heap[idx]; }
|
|
11
11
|
|
|
12
|
-
let heap_next = heap.length;
|
|
13
|
-
|
|
14
|
-
function dropObject(idx) {
|
|
15
|
-
if (idx < 132) return;
|
|
16
|
-
heap[idx] = heap_next;
|
|
17
|
-
heap_next = idx;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function takeObject(idx) {
|
|
21
|
-
const ret = getObject(idx);
|
|
22
|
-
dropObject(idx);
|
|
23
|
-
return ret;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
12
|
function isLikeNone(x) {
|
|
27
13
|
return x === undefined || x === null;
|
|
28
14
|
}
|
|
@@ -45,6 +31,20 @@ function getInt32Memory0() {
|
|
|
45
31
|
return cachedInt32Memory0;
|
|
46
32
|
}
|
|
47
33
|
|
|
34
|
+
let heap_next = heap.length;
|
|
35
|
+
|
|
36
|
+
function dropObject(idx) {
|
|
37
|
+
if (idx < 132) return;
|
|
38
|
+
heap[idx] = heap_next;
|
|
39
|
+
heap_next = idx;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function takeObject(idx) {
|
|
43
|
+
const ret = getObject(idx);
|
|
44
|
+
dropObject(idx);
|
|
45
|
+
return ret;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
48
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
49
49
|
|
|
50
50
|
cachedTextDecoder.decode();
|
|
@@ -217,166 +217,9 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
217
217
|
return real;
|
|
218
218
|
}
|
|
219
219
|
function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
220
|
-
wasm.
|
|
220
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(arg0, arg1, addHeapObject(arg2));
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
-
/**
|
|
224
|
-
* Sets the package's logging level.
|
|
225
|
-
*
|
|
226
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
227
|
-
*/
|
|
228
|
-
module.exports.initLogLevel = function(filter) {
|
|
229
|
-
try {
|
|
230
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
231
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
232
|
-
const len0 = WASM_VECTOR_LEN;
|
|
233
|
-
wasm.initLogLevel(retptr, ptr0, len0);
|
|
234
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
235
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
236
|
-
if (r1) {
|
|
237
|
-
throw takeObject(r0);
|
|
238
|
-
}
|
|
239
|
-
} finally {
|
|
240
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
|
-
|
|
244
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
245
|
-
const ptr = malloc(arg.length * 1) >>> 0;
|
|
246
|
-
getUint8Memory0().set(arg, ptr / 1);
|
|
247
|
-
WASM_VECTOR_LEN = arg.length;
|
|
248
|
-
return ptr;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
252
|
-
*
|
|
253
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
254
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
255
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
256
|
-
* @param {Uint8Array} program
|
|
257
|
-
* @param {WitnessMap} witness_map
|
|
258
|
-
* @returns {WitnessMap}
|
|
259
|
-
*/
|
|
260
|
-
module.exports.getReturnWitness = function(program, witness_map) {
|
|
261
|
-
try {
|
|
262
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
263
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
264
|
-
const len0 = WASM_VECTOR_LEN;
|
|
265
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
266
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
267
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
268
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
269
|
-
if (r2) {
|
|
270
|
-
throw takeObject(r1);
|
|
271
|
-
}
|
|
272
|
-
return takeObject(r0);
|
|
273
|
-
} finally {
|
|
274
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
280
|
-
*
|
|
281
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
282
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
283
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
284
|
-
* @param {Uint8Array} program
|
|
285
|
-
* @param {WitnessMap} solved_witness
|
|
286
|
-
* @returns {WitnessMap}
|
|
287
|
-
*/
|
|
288
|
-
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
289
|
-
try {
|
|
290
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
291
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
292
|
-
const len0 = WASM_VECTOR_LEN;
|
|
293
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
294
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
295
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
296
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
297
|
-
if (r2) {
|
|
298
|
-
throw takeObject(r1);
|
|
299
|
-
}
|
|
300
|
-
return takeObject(r0);
|
|
301
|
-
} finally {
|
|
302
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
308
|
-
*
|
|
309
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
310
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
311
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
312
|
-
* @param {Uint8Array} program
|
|
313
|
-
* @param {WitnessMap} solved_witness
|
|
314
|
-
* @returns {WitnessMap}
|
|
315
|
-
*/
|
|
316
|
-
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
317
|
-
try {
|
|
318
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
319
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
320
|
-
const len0 = WASM_VECTOR_LEN;
|
|
321
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
322
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
323
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
324
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
325
|
-
if (r2) {
|
|
326
|
-
throw takeObject(r1);
|
|
327
|
-
}
|
|
328
|
-
return takeObject(r0);
|
|
329
|
-
} finally {
|
|
330
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
331
|
-
}
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
336
|
-
*
|
|
337
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
338
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
339
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
340
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
341
|
-
*/
|
|
342
|
-
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
343
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
344
|
-
const len0 = WASM_VECTOR_LEN;
|
|
345
|
-
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
346
|
-
return takeObject(ret);
|
|
347
|
-
};
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
351
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
352
|
-
*
|
|
353
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
354
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
355
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
356
|
-
* @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.
|
|
357
|
-
*/
|
|
358
|
-
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
359
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
360
|
-
const len0 = WASM_VECTOR_LEN;
|
|
361
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
362
|
-
return takeObject(ret);
|
|
363
|
-
};
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
367
|
-
*
|
|
368
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
369
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
370
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
371
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
372
|
-
*/
|
|
373
|
-
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
374
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
375
|
-
const len0 = WASM_VECTOR_LEN;
|
|
376
|
-
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
377
|
-
return takeObject(ret);
|
|
378
|
-
};
|
|
379
|
-
|
|
380
223
|
/**
|
|
381
224
|
* Performs a bitwise AND operation between `lhs` and `rhs`
|
|
382
225
|
* @param {string} lhs
|
|
@@ -399,6 +242,13 @@ module.exports.xor = function(lhs, rhs) {
|
|
|
399
242
|
return takeObject(ret);
|
|
400
243
|
};
|
|
401
244
|
|
|
245
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
246
|
+
const ptr = malloc(arg.length * 1) >>> 0;
|
|
247
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
248
|
+
WASM_VECTOR_LEN = arg.length;
|
|
249
|
+
return ptr;
|
|
250
|
+
}
|
|
251
|
+
|
|
402
252
|
function getArrayU8FromWasm0(ptr, len) {
|
|
403
253
|
ptr = ptr >>> 0;
|
|
404
254
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -508,15 +358,6 @@ module.exports.ecdsa_secp256r1_verify = function(hashed_msg, public_key_x_bytes,
|
|
|
508
358
|
return ret !== 0;
|
|
509
359
|
};
|
|
510
360
|
|
|
511
|
-
/**
|
|
512
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
513
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
514
|
-
*/
|
|
515
|
-
module.exports.buildInfo = function() {
|
|
516
|
-
const ret = wasm.buildInfo();
|
|
517
|
-
return takeObject(ret);
|
|
518
|
-
};
|
|
519
|
-
|
|
520
361
|
/**
|
|
521
362
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
522
363
|
*
|
|
@@ -616,8 +457,168 @@ module.exports.decompressWitnessStack = function(compressed_witness) {
|
|
|
616
457
|
}
|
|
617
458
|
};
|
|
618
459
|
|
|
460
|
+
/**
|
|
461
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
462
|
+
*
|
|
463
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
464
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
465
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
466
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
467
|
+
*/
|
|
468
|
+
module.exports.executeCircuit = function(program, initial_witness, foreign_call_handler) {
|
|
469
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
470
|
+
const len0 = WASM_VECTOR_LEN;
|
|
471
|
+
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
472
|
+
return takeObject(ret);
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
/**
|
|
476
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
477
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
478
|
+
*
|
|
479
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
480
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
481
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
482
|
+
* @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.
|
|
483
|
+
*/
|
|
484
|
+
module.exports.executeCircuitWithReturnWitness = function(program, initial_witness, foreign_call_handler) {
|
|
485
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
486
|
+
const len0 = WASM_VECTOR_LEN;
|
|
487
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
488
|
+
return takeObject(ret);
|
|
489
|
+
};
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
493
|
+
*
|
|
494
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
495
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
496
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
497
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
498
|
+
*/
|
|
499
|
+
module.exports.executeProgram = function(program, initial_witness, foreign_call_handler) {
|
|
500
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
501
|
+
const len0 = WASM_VECTOR_LEN;
|
|
502
|
+
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
503
|
+
return takeObject(ret);
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
508
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
509
|
+
*/
|
|
510
|
+
module.exports.buildInfo = function() {
|
|
511
|
+
const ret = wasm.buildInfo();
|
|
512
|
+
return takeObject(ret);
|
|
513
|
+
};
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
517
|
+
*
|
|
518
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
519
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
520
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
521
|
+
* @param {Uint8Array} program
|
|
522
|
+
* @param {WitnessMap} witness_map
|
|
523
|
+
* @returns {WitnessMap}
|
|
524
|
+
*/
|
|
525
|
+
module.exports.getReturnWitness = function(program, witness_map) {
|
|
526
|
+
try {
|
|
527
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
528
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
529
|
+
const len0 = WASM_VECTOR_LEN;
|
|
530
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
531
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
532
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
533
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
534
|
+
if (r2) {
|
|
535
|
+
throw takeObject(r1);
|
|
536
|
+
}
|
|
537
|
+
return takeObject(r0);
|
|
538
|
+
} finally {
|
|
539
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
545
|
+
*
|
|
546
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
547
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
548
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
549
|
+
* @param {Uint8Array} program
|
|
550
|
+
* @param {WitnessMap} solved_witness
|
|
551
|
+
* @returns {WitnessMap}
|
|
552
|
+
*/
|
|
553
|
+
module.exports.getPublicParametersWitness = function(program, solved_witness) {
|
|
554
|
+
try {
|
|
555
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
556
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
557
|
+
const len0 = WASM_VECTOR_LEN;
|
|
558
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
559
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
560
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
561
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
562
|
+
if (r2) {
|
|
563
|
+
throw takeObject(r1);
|
|
564
|
+
}
|
|
565
|
+
return takeObject(r0);
|
|
566
|
+
} finally {
|
|
567
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
568
|
+
}
|
|
569
|
+
};
|
|
570
|
+
|
|
571
|
+
/**
|
|
572
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
573
|
+
*
|
|
574
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
575
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
576
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
577
|
+
* @param {Uint8Array} program
|
|
578
|
+
* @param {WitnessMap} solved_witness
|
|
579
|
+
* @returns {WitnessMap}
|
|
580
|
+
*/
|
|
581
|
+
module.exports.getPublicWitness = function(program, solved_witness) {
|
|
582
|
+
try {
|
|
583
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
584
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
585
|
+
const len0 = WASM_VECTOR_LEN;
|
|
586
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
587
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
588
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
589
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
590
|
+
if (r2) {
|
|
591
|
+
throw takeObject(r1);
|
|
592
|
+
}
|
|
593
|
+
return takeObject(r0);
|
|
594
|
+
} finally {
|
|
595
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
596
|
+
}
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Sets the package's logging level.
|
|
601
|
+
*
|
|
602
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
603
|
+
*/
|
|
604
|
+
module.exports.initLogLevel = function(filter) {
|
|
605
|
+
try {
|
|
606
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
607
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
608
|
+
const len0 = WASM_VECTOR_LEN;
|
|
609
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
610
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
611
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
612
|
+
if (r1) {
|
|
613
|
+
throw takeObject(r0);
|
|
614
|
+
}
|
|
615
|
+
} finally {
|
|
616
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
617
|
+
}
|
|
618
|
+
};
|
|
619
|
+
|
|
619
620
|
function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {
|
|
620
|
-
wasm.
|
|
621
|
+
wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
|
|
621
622
|
}
|
|
622
623
|
|
|
623
624
|
function handleError(f, args) {
|
|
@@ -628,23 +629,9 @@ function handleError(f, args) {
|
|
|
628
629
|
}
|
|
629
630
|
}
|
|
630
631
|
function __wbg_adapter_93(arg0, arg1, arg2, arg3) {
|
|
631
|
-
wasm.
|
|
632
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
632
633
|
}
|
|
633
634
|
|
|
634
|
-
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
635
|
-
const obj = takeObject(arg0).original;
|
|
636
|
-
if (obj.cnt-- == 1) {
|
|
637
|
-
obj.a = 0;
|
|
638
|
-
return true;
|
|
639
|
-
}
|
|
640
|
-
const ret = false;
|
|
641
|
-
return ret;
|
|
642
|
-
};
|
|
643
|
-
|
|
644
|
-
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
645
|
-
takeObject(arg0);
|
|
646
|
-
};
|
|
647
|
-
|
|
648
635
|
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
649
636
|
const obj = getObject(arg1);
|
|
650
637
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
@@ -652,9 +639,8 @@ module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
|
652
639
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
653
640
|
};
|
|
654
641
|
|
|
655
|
-
module.exports.
|
|
656
|
-
|
|
657
|
-
return addHeapObject(ret);
|
|
642
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
643
|
+
takeObject(arg0);
|
|
658
644
|
};
|
|
659
645
|
|
|
660
646
|
module.exports.__wbindgen_is_array = function(arg0) {
|
|
@@ -667,12 +653,27 @@ module.exports.__wbindgen_is_string = function(arg0) {
|
|
|
667
653
|
return ret;
|
|
668
654
|
};
|
|
669
655
|
|
|
656
|
+
module.exports.__wbindgen_cb_drop = function(arg0) {
|
|
657
|
+
const obj = takeObject(arg0).original;
|
|
658
|
+
if (obj.cnt-- == 1) {
|
|
659
|
+
obj.a = 0;
|
|
660
|
+
return true;
|
|
661
|
+
}
|
|
662
|
+
const ret = false;
|
|
663
|
+
return ret;
|
|
664
|
+
};
|
|
665
|
+
|
|
666
|
+
module.exports.__wbg_constructor_9e0f49809a0dd2f4 = function(arg0) {
|
|
667
|
+
const ret = new Error(takeObject(arg0));
|
|
668
|
+
return addHeapObject(ret);
|
|
669
|
+
};
|
|
670
|
+
|
|
670
671
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
671
672
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
672
673
|
return addHeapObject(ret);
|
|
673
674
|
};
|
|
674
675
|
|
|
675
|
-
module.exports.
|
|
676
|
+
module.exports.__wbg_new_baa0339c0c5c310a = function() {
|
|
676
677
|
const ret = new Array();
|
|
677
678
|
return addHeapObject(ret);
|
|
678
679
|
};
|
|
@@ -682,7 +683,7 @@ module.exports.__wbindgen_number_new = function(arg0) {
|
|
|
682
683
|
return addHeapObject(ret);
|
|
683
684
|
};
|
|
684
685
|
|
|
685
|
-
module.exports.
|
|
686
|
+
module.exports.__wbg_new_cd95aa9a75b6fbe6 = function() {
|
|
686
687
|
const ret = new Map();
|
|
687
688
|
return addHeapObject(ret);
|
|
688
689
|
};
|
|
@@ -914,8 +915,8 @@ module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
|
914
915
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
915
916
|
};
|
|
916
917
|
|
|
917
|
-
module.exports.
|
|
918
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
918
|
+
module.exports.__wbindgen_closure_wrapper748 = function(arg0, arg1, arg2) {
|
|
919
|
+
const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_22);
|
|
919
920
|
return addHeapObject(ret);
|
|
920
921
|
};
|
|
921
922
|
|
package/nodejs/acvm_js_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function initLogLevel(a: number, b: number, c: number): void;
|
|
5
|
-
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
6
|
-
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
7
|
-
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
8
|
-
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
9
|
-
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
10
|
-
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
11
4
|
export function and(a: number, b: number): number;
|
|
12
5
|
export function xor(a: number, b: number): number;
|
|
13
6
|
export function sha256(a: number, b: number, c: number): void;
|
|
@@ -15,17 +8,24 @@ export function blake2s256(a: number, b: number, c: number): void;
|
|
|
15
8
|
export function keccak256(a: number, b: number, c: number): void;
|
|
16
9
|
export function ecdsa_secp256k1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
17
10
|
export function ecdsa_secp256r1_verify(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number): number;
|
|
18
|
-
export function buildInfo(): number;
|
|
19
11
|
export function compressWitness(a: number, b: number): void;
|
|
20
12
|
export function decompressWitness(a: number, b: number, c: number): void;
|
|
21
13
|
export function compressWitnessStack(a: number, b: number): void;
|
|
22
14
|
export function decompressWitnessStack(a: number, b: number, c: number): void;
|
|
15
|
+
export function executeCircuit(a: number, b: number, c: number, d: number): number;
|
|
16
|
+
export function executeCircuitWithReturnWitness(a: number, b: number, c: number, d: number): number;
|
|
17
|
+
export function executeProgram(a: number, b: number, c: number, d: number): number;
|
|
18
|
+
export function buildInfo(): number;
|
|
19
|
+
export function getReturnWitness(a: number, b: number, c: number, d: number): void;
|
|
20
|
+
export function getPublicParametersWitness(a: number, b: number, c: number, d: number): void;
|
|
21
|
+
export function getPublicWitness(a: number, b: number, c: number, d: number): void;
|
|
22
|
+
export function initLogLevel(a: number, b: number, c: number): void;
|
|
23
23
|
export function __wbindgen_malloc(a: number): number;
|
|
24
24
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
25
25
|
export const __wbindgen_export_2: WebAssembly.Table;
|
|
26
|
-
export function
|
|
26
|
+
export function _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(a: number, b: number, c: number): void;
|
|
27
27
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
28
28
|
export function __wbindgen_free(a: number, b: number): void;
|
|
29
|
-
export function
|
|
29
|
+
export function wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(a: number, b: number, c: number, d: number, e: number): void;
|
|
30
30
|
export function __wbindgen_exn_store(a: number): void;
|
|
31
|
-
export function
|
|
31
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587(a: number, b: number, c: number, d: number): void;
|