@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/web/acvm_js.js
CHANGED
|
@@ -6,20 +6,6 @@ heap.push(undefined, null, true, false);
|
|
|
6
6
|
|
|
7
7
|
function getObject(idx) { return heap[idx]; }
|
|
8
8
|
|
|
9
|
-
let heap_next = heap.length;
|
|
10
|
-
|
|
11
|
-
function dropObject(idx) {
|
|
12
|
-
if (idx < 132) return;
|
|
13
|
-
heap[idx] = heap_next;
|
|
14
|
-
heap_next = idx;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function takeObject(idx) {
|
|
18
|
-
const ret = getObject(idx);
|
|
19
|
-
dropObject(idx);
|
|
20
|
-
return ret;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
9
|
function isLikeNone(x) {
|
|
24
10
|
return x === undefined || x === null;
|
|
25
11
|
}
|
|
@@ -42,6 +28,20 @@ function getInt32Memory0() {
|
|
|
42
28
|
return cachedInt32Memory0;
|
|
43
29
|
}
|
|
44
30
|
|
|
31
|
+
let heap_next = heap.length;
|
|
32
|
+
|
|
33
|
+
function dropObject(idx) {
|
|
34
|
+
if (idx < 132) return;
|
|
35
|
+
heap[idx] = heap_next;
|
|
36
|
+
heap_next = idx;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function takeObject(idx) {
|
|
40
|
+
const ret = getObject(idx);
|
|
41
|
+
dropObject(idx);
|
|
42
|
+
return ret;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
45
|
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
46
46
|
|
|
47
47
|
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
@@ -214,164 +214,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
214
214
|
return real;
|
|
215
215
|
}
|
|
216
216
|
function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
217
|
-
wasm.
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Sets the package's logging level.
|
|
222
|
-
*
|
|
223
|
-
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
224
|
-
*/
|
|
225
|
-
export function initLogLevel(filter) {
|
|
226
|
-
try {
|
|
227
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
228
|
-
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
229
|
-
const len0 = WASM_VECTOR_LEN;
|
|
230
|
-
wasm.initLogLevel(retptr, ptr0, len0);
|
|
231
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
232
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
233
|
-
if (r1) {
|
|
234
|
-
throw takeObject(r0);
|
|
235
|
-
}
|
|
236
|
-
} finally {
|
|
237
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
242
|
-
const ptr = malloc(arg.length * 1) >>> 0;
|
|
243
|
-
getUint8Memory0().set(arg, ptr / 1);
|
|
244
|
-
WASM_VECTOR_LEN = arg.length;
|
|
245
|
-
return ptr;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
249
|
-
*
|
|
250
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
251
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
252
|
-
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
253
|
-
* @param {Uint8Array} program
|
|
254
|
-
* @param {WitnessMap} witness_map
|
|
255
|
-
* @returns {WitnessMap}
|
|
256
|
-
*/
|
|
257
|
-
export function getReturnWitness(program, witness_map) {
|
|
258
|
-
try {
|
|
259
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
260
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
261
|
-
const len0 = WASM_VECTOR_LEN;
|
|
262
|
-
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
263
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
264
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
265
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
266
|
-
if (r2) {
|
|
267
|
-
throw takeObject(r1);
|
|
268
|
-
}
|
|
269
|
-
return takeObject(r0);
|
|
270
|
-
} finally {
|
|
271
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
277
|
-
*
|
|
278
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
279
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
280
|
-
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
281
|
-
* @param {Uint8Array} program
|
|
282
|
-
* @param {WitnessMap} solved_witness
|
|
283
|
-
* @returns {WitnessMap}
|
|
284
|
-
*/
|
|
285
|
-
export function getPublicParametersWitness(program, solved_witness) {
|
|
286
|
-
try {
|
|
287
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
288
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
289
|
-
const len0 = WASM_VECTOR_LEN;
|
|
290
|
-
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
291
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
292
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
293
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
294
|
-
if (r2) {
|
|
295
|
-
throw takeObject(r1);
|
|
296
|
-
}
|
|
297
|
-
return takeObject(r0);
|
|
298
|
-
} finally {
|
|
299
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
305
|
-
*
|
|
306
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
307
|
-
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
308
|
-
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
309
|
-
* @param {Uint8Array} program
|
|
310
|
-
* @param {WitnessMap} solved_witness
|
|
311
|
-
* @returns {WitnessMap}
|
|
312
|
-
*/
|
|
313
|
-
export function getPublicWitness(program, solved_witness) {
|
|
314
|
-
try {
|
|
315
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
316
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
317
|
-
const len0 = WASM_VECTOR_LEN;
|
|
318
|
-
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
319
|
-
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
320
|
-
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
321
|
-
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
322
|
-
if (r2) {
|
|
323
|
-
throw takeObject(r1);
|
|
324
|
-
}
|
|
325
|
-
return takeObject(r0);
|
|
326
|
-
} finally {
|
|
327
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
333
|
-
*
|
|
334
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
335
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
336
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
337
|
-
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
338
|
-
*/
|
|
339
|
-
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
340
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
341
|
-
const len0 = WASM_VECTOR_LEN;
|
|
342
|
-
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
343
|
-
return takeObject(ret);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
/**
|
|
347
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
348
|
-
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
349
|
-
*
|
|
350
|
-
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
351
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
352
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
353
|
-
* @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.
|
|
354
|
-
*/
|
|
355
|
-
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
356
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
357
|
-
const len0 = WASM_VECTOR_LEN;
|
|
358
|
-
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
359
|
-
return takeObject(ret);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
/**
|
|
363
|
-
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
364
|
-
*
|
|
365
|
-
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
366
|
-
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
367
|
-
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
368
|
-
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
369
|
-
*/
|
|
370
|
-
export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
371
|
-
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
372
|
-
const len0 = WASM_VECTOR_LEN;
|
|
373
|
-
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
374
|
-
return takeObject(ret);
|
|
217
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h21c8ca3eb6ab9385(arg0, arg1, addHeapObject(arg2));
|
|
375
218
|
}
|
|
376
219
|
|
|
377
220
|
/**
|
|
@@ -396,6 +239,13 @@ export function xor(lhs, rhs) {
|
|
|
396
239
|
return takeObject(ret);
|
|
397
240
|
}
|
|
398
241
|
|
|
242
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
243
|
+
const ptr = malloc(arg.length * 1) >>> 0;
|
|
244
|
+
getUint8Memory0().set(arg, ptr / 1);
|
|
245
|
+
WASM_VECTOR_LEN = arg.length;
|
|
246
|
+
return ptr;
|
|
247
|
+
}
|
|
248
|
+
|
|
399
249
|
function getArrayU8FromWasm0(ptr, len) {
|
|
400
250
|
ptr = ptr >>> 0;
|
|
401
251
|
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -505,15 +355,6 @@ export function ecdsa_secp256r1_verify(hashed_msg, public_key_x_bytes, public_ke
|
|
|
505
355
|
return ret !== 0;
|
|
506
356
|
}
|
|
507
357
|
|
|
508
|
-
/**
|
|
509
|
-
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
510
|
-
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
511
|
-
*/
|
|
512
|
-
export function buildInfo() {
|
|
513
|
-
const ret = wasm.buildInfo();
|
|
514
|
-
return takeObject(ret);
|
|
515
|
-
}
|
|
516
|
-
|
|
517
358
|
/**
|
|
518
359
|
* Compresses a `WitnessMap` into the binary format outputted by Nargo.
|
|
519
360
|
*
|
|
@@ -613,8 +454,168 @@ export function decompressWitnessStack(compressed_witness) {
|
|
|
613
454
|
}
|
|
614
455
|
}
|
|
615
456
|
|
|
457
|
+
/**
|
|
458
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
459
|
+
*
|
|
460
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
461
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
462
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
463
|
+
* @returns {WitnessMap} The solved witness calculated by executing the circuit on the provided inputs.
|
|
464
|
+
*/
|
|
465
|
+
export function executeCircuit(program, initial_witness, foreign_call_handler) {
|
|
466
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
467
|
+
const len0 = WASM_VECTOR_LEN;
|
|
468
|
+
const ret = wasm.executeCircuit(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
469
|
+
return takeObject(ret);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
474
|
+
* This method also extracts the public return values from the solved witness into its own return witness.
|
|
475
|
+
*
|
|
476
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
477
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `circuit`..
|
|
478
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the circuit.
|
|
479
|
+
* @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.
|
|
480
|
+
*/
|
|
481
|
+
export function executeCircuitWithReturnWitness(program, initial_witness, foreign_call_handler) {
|
|
482
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
483
|
+
const len0 = WASM_VECTOR_LEN;
|
|
484
|
+
const ret = wasm.executeCircuitWithReturnWitness(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
485
|
+
return takeObject(ret);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
/**
|
|
489
|
+
* Executes an ACIR circuit to generate the solved witness from the initial witness.
|
|
490
|
+
*
|
|
491
|
+
* @param {Uint8Array} program - A serialized representation of an ACIR program
|
|
492
|
+
* @param {WitnessMap} initial_witness - The initial witness map defining all of the inputs to `program`.
|
|
493
|
+
* @param {ForeignCallHandler} foreign_call_handler - A callback to process any foreign calls from the program.
|
|
494
|
+
* @returns {WitnessStack} The solved witness calculated by executing the program on the provided inputs.
|
|
495
|
+
*/
|
|
496
|
+
export function executeProgram(program, initial_witness, foreign_call_handler) {
|
|
497
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
498
|
+
const len0 = WASM_VECTOR_LEN;
|
|
499
|
+
const ret = wasm.executeProgram(ptr0, len0, addHeapObject(initial_witness), addHeapObject(foreign_call_handler));
|
|
500
|
+
return takeObject(ret);
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Returns the `BuildInfo` object containing information about how the installed package was built.
|
|
505
|
+
* @returns {BuildInfo} - Information on how the installed package was built.
|
|
506
|
+
*/
|
|
507
|
+
export function buildInfo() {
|
|
508
|
+
const ret = wasm.buildInfo();
|
|
509
|
+
return takeObject(ret);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's return values.
|
|
514
|
+
*
|
|
515
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
516
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
517
|
+
* @returns {WitnessMap} A witness map containing the circuit's return values.
|
|
518
|
+
* @param {Uint8Array} program
|
|
519
|
+
* @param {WitnessMap} witness_map
|
|
520
|
+
* @returns {WitnessMap}
|
|
521
|
+
*/
|
|
522
|
+
export function getReturnWitness(program, witness_map) {
|
|
523
|
+
try {
|
|
524
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
525
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
526
|
+
const len0 = WASM_VECTOR_LEN;
|
|
527
|
+
wasm.getReturnWitness(retptr, ptr0, len0, addHeapObject(witness_map));
|
|
528
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
529
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
530
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
531
|
+
if (r2) {
|
|
532
|
+
throw takeObject(r1);
|
|
533
|
+
}
|
|
534
|
+
return takeObject(r0);
|
|
535
|
+
} finally {
|
|
536
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
/**
|
|
541
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public parameters.
|
|
542
|
+
*
|
|
543
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
544
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
545
|
+
* @returns {WitnessMap} A witness map containing the circuit's public parameters.
|
|
546
|
+
* @param {Uint8Array} program
|
|
547
|
+
* @param {WitnessMap} solved_witness
|
|
548
|
+
* @returns {WitnessMap}
|
|
549
|
+
*/
|
|
550
|
+
export function getPublicParametersWitness(program, solved_witness) {
|
|
551
|
+
try {
|
|
552
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
553
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
554
|
+
const len0 = WASM_VECTOR_LEN;
|
|
555
|
+
wasm.getPublicParametersWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
556
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
557
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
558
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
559
|
+
if (r2) {
|
|
560
|
+
throw takeObject(r1);
|
|
561
|
+
}
|
|
562
|
+
return takeObject(r0);
|
|
563
|
+
} finally {
|
|
564
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* Extracts a `WitnessMap` containing the witness indices corresponding to the circuit's public inputs.
|
|
570
|
+
*
|
|
571
|
+
* @param {Uint8Array} circuit - A serialized representation of an ACIR circuit
|
|
572
|
+
* @param {WitnessMap} witness_map - The completed witness map after executing the circuit.
|
|
573
|
+
* @returns {WitnessMap} A witness map containing the circuit's public inputs.
|
|
574
|
+
* @param {Uint8Array} program
|
|
575
|
+
* @param {WitnessMap} solved_witness
|
|
576
|
+
* @returns {WitnessMap}
|
|
577
|
+
*/
|
|
578
|
+
export function getPublicWitness(program, solved_witness) {
|
|
579
|
+
try {
|
|
580
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
581
|
+
const ptr0 = passArray8ToWasm0(program, wasm.__wbindgen_malloc);
|
|
582
|
+
const len0 = WASM_VECTOR_LEN;
|
|
583
|
+
wasm.getPublicWitness(retptr, ptr0, len0, addHeapObject(solved_witness));
|
|
584
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
585
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
586
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
587
|
+
if (r2) {
|
|
588
|
+
throw takeObject(r1);
|
|
589
|
+
}
|
|
590
|
+
return takeObject(r0);
|
|
591
|
+
} finally {
|
|
592
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Sets the package's logging level.
|
|
598
|
+
*
|
|
599
|
+
* @param {LogLevel} level - The maximum level of logging to be emitted.
|
|
600
|
+
*/
|
|
601
|
+
export function initLogLevel(filter) {
|
|
602
|
+
try {
|
|
603
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
604
|
+
const ptr0 = passStringToWasm0(filter, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
605
|
+
const len0 = WASM_VECTOR_LEN;
|
|
606
|
+
wasm.initLogLevel(retptr, ptr0, len0);
|
|
607
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
608
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
609
|
+
if (r1) {
|
|
610
|
+
throw takeObject(r0);
|
|
611
|
+
}
|
|
612
|
+
} finally {
|
|
613
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
|
|
616
617
|
function __wbg_adapter_76(arg0, arg1, arg2, arg3, arg4) {
|
|
617
|
-
wasm.
|
|
618
|
+
wasm.wasm_bindgen__convert__closures__invoke3_mut__h17fc532521b46256(arg0, arg1, addHeapObject(arg2), arg3, addHeapObject(arg4));
|
|
618
619
|
}
|
|
619
620
|
|
|
620
621
|
function handleError(f, args) {
|
|
@@ -625,7 +626,7 @@ function handleError(f, args) {
|
|
|
625
626
|
}
|
|
626
627
|
}
|
|
627
628
|
function __wbg_adapter_93(arg0, arg1, arg2, arg3) {
|
|
628
|
-
wasm.
|
|
629
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h0d187b0f08495587(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
629
630
|
}
|
|
630
631
|
|
|
631
632
|
async function __wbg_load(module, imports) {
|
|
@@ -662,27 +663,14 @@ async function __wbg_load(module, imports) {
|
|
|
662
663
|
function __wbg_get_imports() {
|
|
663
664
|
const imports = {};
|
|
664
665
|
imports.wbg = {};
|
|
665
|
-
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
666
|
-
const obj = takeObject(arg0).original;
|
|
667
|
-
if (obj.cnt-- == 1) {
|
|
668
|
-
obj.a = 0;
|
|
669
|
-
return true;
|
|
670
|
-
}
|
|
671
|
-
const ret = false;
|
|
672
|
-
return ret;
|
|
673
|
-
};
|
|
674
|
-
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
675
|
-
takeObject(arg0);
|
|
676
|
-
};
|
|
677
666
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
678
667
|
const obj = getObject(arg1);
|
|
679
668
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
680
669
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
681
670
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
682
671
|
};
|
|
683
|
-
imports.wbg.
|
|
684
|
-
|
|
685
|
-
return addHeapObject(ret);
|
|
672
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
673
|
+
takeObject(arg0);
|
|
686
674
|
};
|
|
687
675
|
imports.wbg.__wbindgen_is_array = function(arg0) {
|
|
688
676
|
const ret = Array.isArray(getObject(arg0));
|
|
@@ -692,11 +680,24 @@ function __wbg_get_imports() {
|
|
|
692
680
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
693
681
|
return ret;
|
|
694
682
|
};
|
|
683
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
684
|
+
const obj = takeObject(arg0).original;
|
|
685
|
+
if (obj.cnt-- == 1) {
|
|
686
|
+
obj.a = 0;
|
|
687
|
+
return true;
|
|
688
|
+
}
|
|
689
|
+
const ret = false;
|
|
690
|
+
return ret;
|
|
691
|
+
};
|
|
692
|
+
imports.wbg.__wbg_constructor_9e0f49809a0dd2f4 = function(arg0) {
|
|
693
|
+
const ret = new Error(takeObject(arg0));
|
|
694
|
+
return addHeapObject(ret);
|
|
695
|
+
};
|
|
695
696
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
696
697
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
697
698
|
return addHeapObject(ret);
|
|
698
699
|
};
|
|
699
|
-
imports.wbg.
|
|
700
|
+
imports.wbg.__wbg_new_baa0339c0c5c310a = function() {
|
|
700
701
|
const ret = new Array();
|
|
701
702
|
return addHeapObject(ret);
|
|
702
703
|
};
|
|
@@ -704,7 +705,7 @@ function __wbg_get_imports() {
|
|
|
704
705
|
const ret = arg0;
|
|
705
706
|
return addHeapObject(ret);
|
|
706
707
|
};
|
|
707
|
-
imports.wbg.
|
|
708
|
+
imports.wbg.__wbg_new_cd95aa9a75b6fbe6 = function() {
|
|
708
709
|
const ret = new Map();
|
|
709
710
|
return addHeapObject(ret);
|
|
710
711
|
};
|
|
@@ -899,8 +900,8 @@ function __wbg_get_imports() {
|
|
|
899
900
|
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
900
901
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
901
902
|
};
|
|
902
|
-
imports.wbg.
|
|
903
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
903
|
+
imports.wbg.__wbindgen_closure_wrapper748 = function(arg0, arg1, arg2) {
|
|
904
|
+
const ret = makeMutClosure(arg0, arg1, 265, __wbg_adapter_22);
|
|
904
905
|
return addHeapObject(ret);
|
|
905
906
|
};
|
|
906
907
|
|
package/web/acvm_js_bg.wasm
CHANGED
|
Binary file
|
package/web/acvm_js_bg.wasm.d.ts
CHANGED
|
@@ -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;
|