@provablehq/wasm 0.9.5 → 0.9.7
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/dist/mainnet/aleo_wasm.d.ts +235 -219
- package/dist/mainnet/aleo_wasm.wasm +0 -0
- package/dist/mainnet/index.js +311 -238
- package/dist/mainnet/index.js.map +1 -1
- package/dist/mainnet/worker.js +311 -238
- package/dist/mainnet/worker.js.map +1 -1
- package/dist/testnet/aleo_wasm.d.ts +235 -219
- package/dist/testnet/aleo_wasm.wasm +0 -0
- package/dist/testnet/index.js +311 -238
- package/dist/testnet/index.js.map +1 -1
- package/dist/testnet/worker.js +311 -238
- package/dist/testnet/worker.js.map +1 -1
- package/package.json +1 -1
package/dist/mainnet/worker.js
CHANGED
|
@@ -291,7 +291,7 @@ function __wbg_adapter_43(arg0, arg1, arg2) {
|
|
|
291
291
|
wasm.__wbindgen_export_7(arg0, arg1, addHeapObject(arg2));
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
-
function
|
|
294
|
+
function __wbg_adapter_854(arg0, arg1, arg2, arg3) {
|
|
295
295
|
wasm.__wbindgen_export_8(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
296
296
|
}
|
|
297
297
|
|
|
@@ -2629,10 +2629,11 @@ class ExecutionRequest {
|
|
|
2629
2629
|
* @param {Array<any>} inputs
|
|
2630
2630
|
* @param {Array<any>} input_types
|
|
2631
2631
|
* @param {Field | null | undefined} root_tvk
|
|
2632
|
+
* @param {Field | null | undefined} program_checksum
|
|
2632
2633
|
* @param {boolean} is_root
|
|
2633
2634
|
* @returns {ExecutionRequest}
|
|
2634
2635
|
*/
|
|
2635
|
-
static sign(private_key, program_id, function_name, inputs, input_types, root_tvk, is_root) {
|
|
2636
|
+
static sign(private_key, program_id, function_name, inputs, input_types, root_tvk, program_checksum, is_root) {
|
|
2636
2637
|
try {
|
|
2637
2638
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2638
2639
|
_assertClass(private_key, PrivateKey);
|
|
@@ -2646,7 +2647,12 @@ class ExecutionRequest {
|
|
|
2646
2647
|
_assertClass(root_tvk, Field);
|
|
2647
2648
|
ptr3 = root_tvk.__destroy_into_raw();
|
|
2648
2649
|
}
|
|
2649
|
-
|
|
2650
|
+
let ptr4 = 0;
|
|
2651
|
+
if (!isLikeNone(program_checksum)) {
|
|
2652
|
+
_assertClass(program_checksum, Field);
|
|
2653
|
+
ptr4 = program_checksum.__destroy_into_raw();
|
|
2654
|
+
}
|
|
2655
|
+
wasm.executionrequest_sign(retptr, ptr0, ptr1, len1, ptr2, len2, addHeapObject(inputs), addHeapObject(input_types), ptr3, ptr4, is_root);
|
|
2650
2656
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2651
2657
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2652
2658
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -2665,10 +2671,16 @@ class ExecutionRequest {
|
|
|
2665
2671
|
* @param {boolean} Flag to indicate whether this request is the first function in the call graph.
|
|
2666
2672
|
* @param {Array<any>} input_types
|
|
2667
2673
|
* @param {boolean} is_root
|
|
2674
|
+
* @param {Field | null} [program_checksum]
|
|
2668
2675
|
* @returns {boolean}
|
|
2669
2676
|
*/
|
|
2670
|
-
verify(input_types, is_root) {
|
|
2671
|
-
|
|
2677
|
+
verify(input_types, is_root, program_checksum) {
|
|
2678
|
+
let ptr0 = 0;
|
|
2679
|
+
if (!isLikeNone(program_checksum)) {
|
|
2680
|
+
_assertClass(program_checksum, Field);
|
|
2681
|
+
ptr0 = program_checksum.__destroy_into_raw();
|
|
2682
|
+
}
|
|
2683
|
+
const ret = wasm.executionrequest_verify(this.__wbg_ptr, addHeapObject(input_types), is_root, ptr0);
|
|
2672
2684
|
return ret !== 0;
|
|
2673
2685
|
}
|
|
2674
2686
|
}
|
|
@@ -3431,7 +3443,7 @@ class I128 {
|
|
|
3431
3443
|
wasm.__wbg_i128_free(ptr, 0);
|
|
3432
3444
|
}
|
|
3433
3445
|
/**
|
|
3434
|
-
*
|
|
3446
|
+
* Construct an integer from a string representation.
|
|
3435
3447
|
* @param {string} s
|
|
3436
3448
|
* @returns {I128}
|
|
3437
3449
|
*/
|
|
@@ -3453,7 +3465,7 @@ class I128 {
|
|
|
3453
3465
|
}
|
|
3454
3466
|
}
|
|
3455
3467
|
/**
|
|
3456
|
-
*
|
|
3468
|
+
* Get the string representation of the integer.
|
|
3457
3469
|
* @returns {string}
|
|
3458
3470
|
*/
|
|
3459
3471
|
toString() {
|
|
@@ -3473,7 +3485,7 @@ class I128 {
|
|
|
3473
3485
|
}
|
|
3474
3486
|
}
|
|
3475
3487
|
/**
|
|
3476
|
-
*
|
|
3488
|
+
* Get the byte array representation of the integer.
|
|
3477
3489
|
* @param {Uint8Array} bytes
|
|
3478
3490
|
* @returns {I128}
|
|
3479
3491
|
*/
|
|
@@ -3494,7 +3506,7 @@ class I128 {
|
|
|
3494
3506
|
}
|
|
3495
3507
|
}
|
|
3496
3508
|
/**
|
|
3497
|
-
*
|
|
3509
|
+
* Construct an integer from a byte array representation.
|
|
3498
3510
|
* @returns {Uint8Array}
|
|
3499
3511
|
*/
|
|
3500
3512
|
toBytesLe() {
|
|
@@ -3513,7 +3525,7 @@ class I128 {
|
|
|
3513
3525
|
}
|
|
3514
3526
|
}
|
|
3515
3527
|
/**
|
|
3516
|
-
*
|
|
3528
|
+
* Construct an integer from a boolean array representation.
|
|
3517
3529
|
* @param {Array<any>} bits
|
|
3518
3530
|
* @returns {I128}
|
|
3519
3531
|
*/
|
|
@@ -3534,7 +3546,7 @@ class I128 {
|
|
|
3534
3546
|
}
|
|
3535
3547
|
}
|
|
3536
3548
|
/**
|
|
3537
|
-
*
|
|
3549
|
+
* Get the boolean array representation of the integer.
|
|
3538
3550
|
* @returns {Array<any>}
|
|
3539
3551
|
*/
|
|
3540
3552
|
toBitsLe() {
|
|
@@ -3558,7 +3570,7 @@ class I128 {
|
|
|
3558
3570
|
return I128.__wrap(ret);
|
|
3559
3571
|
}
|
|
3560
3572
|
/**
|
|
3561
|
-
* Wrapped addition.
|
|
3573
|
+
* Wrapped addition with another integer.
|
|
3562
3574
|
* @param {I128} other
|
|
3563
3575
|
* @returns {I128}
|
|
3564
3576
|
*/
|
|
@@ -3568,7 +3580,7 @@ class I128 {
|
|
|
3568
3580
|
return I128.__wrap(ret);
|
|
3569
3581
|
}
|
|
3570
3582
|
/**
|
|
3571
|
-
* Wrapped subtraction.
|
|
3583
|
+
* Wrapped subtraction with another integer.
|
|
3572
3584
|
* @param {I128} other
|
|
3573
3585
|
* @returns {I128}
|
|
3574
3586
|
*/
|
|
@@ -3578,7 +3590,7 @@ class I128 {
|
|
|
3578
3590
|
return I128.__wrap(ret);
|
|
3579
3591
|
}
|
|
3580
3592
|
/**
|
|
3581
|
-
* Wrapped multiplication.
|
|
3593
|
+
* Wrapped multiplication with another integer.
|
|
3582
3594
|
* @param {I128} other
|
|
3583
3595
|
* @returns {I128}
|
|
3584
3596
|
*/
|
|
@@ -3598,7 +3610,7 @@ class I128 {
|
|
|
3598
3610
|
return I128.__wrap(ret);
|
|
3599
3611
|
}
|
|
3600
3612
|
/**
|
|
3601
|
-
*
|
|
3613
|
+
* Exponentiate the integer with a u8 exponent.
|
|
3602
3614
|
* @param {U8} exponent
|
|
3603
3615
|
* @returns {I128}
|
|
3604
3616
|
*/
|
|
@@ -3608,7 +3620,7 @@ class I128 {
|
|
|
3608
3620
|
return I128.__wrap(ret);
|
|
3609
3621
|
}
|
|
3610
3622
|
/**
|
|
3611
|
-
*
|
|
3623
|
+
* Exponentiate the integer with a u16 exponent.
|
|
3612
3624
|
* @param {U16} exponent
|
|
3613
3625
|
* @returns {I128}
|
|
3614
3626
|
*/
|
|
@@ -3618,7 +3630,7 @@ class I128 {
|
|
|
3618
3630
|
return I128.__wrap(ret);
|
|
3619
3631
|
}
|
|
3620
3632
|
/**
|
|
3621
|
-
*
|
|
3633
|
+
* Exponentiate the integer with a u32 exponent.
|
|
3622
3634
|
* @param {U32} exponent
|
|
3623
3635
|
* @returns {I128}
|
|
3624
3636
|
*/
|
|
@@ -3628,7 +3640,7 @@ class I128 {
|
|
|
3628
3640
|
return I128.__wrap(ret);
|
|
3629
3641
|
}
|
|
3630
3642
|
/**
|
|
3631
|
-
*
|
|
3643
|
+
* Negate the integer (e.g., 5 → -5).
|
|
3632
3644
|
* @returns {I128}
|
|
3633
3645
|
*/
|
|
3634
3646
|
neg() {
|
|
@@ -3636,7 +3648,7 @@ class I128 {
|
|
|
3636
3648
|
return I128.__wrap(ret);
|
|
3637
3649
|
}
|
|
3638
3650
|
/**
|
|
3639
|
-
*
|
|
3651
|
+
* Check equality with another integer.
|
|
3640
3652
|
* @param {I128} other
|
|
3641
3653
|
* @returns {boolean}
|
|
3642
3654
|
*/
|
|
@@ -3646,7 +3658,7 @@ class I128 {
|
|
|
3646
3658
|
return ret !== 0;
|
|
3647
3659
|
}
|
|
3648
3660
|
/**
|
|
3649
|
-
*
|
|
3661
|
+
* Get the remainder from integer division.
|
|
3650
3662
|
* @param {I128} other
|
|
3651
3663
|
* @returns {I128}
|
|
3652
3664
|
*/
|
|
@@ -3656,7 +3668,7 @@ class I128 {
|
|
|
3656
3668
|
return I128.__wrap(ret);
|
|
3657
3669
|
}
|
|
3658
3670
|
/**
|
|
3659
|
-
*
|
|
3671
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
3660
3672
|
* @param {I128} other
|
|
3661
3673
|
* @returns {I128}
|
|
3662
3674
|
*/
|
|
@@ -3666,7 +3678,7 @@ class I128 {
|
|
|
3666
3678
|
return I128.__wrap(ret);
|
|
3667
3679
|
}
|
|
3668
3680
|
/**
|
|
3669
|
-
* Convert to Scalar.
|
|
3681
|
+
* Convert the integer to a Scalar value.
|
|
3670
3682
|
* @returns {Scalar}
|
|
3671
3683
|
*/
|
|
3672
3684
|
toScalar() {
|
|
@@ -3674,7 +3686,7 @@ class I128 {
|
|
|
3674
3686
|
return Scalar.__wrap(ret);
|
|
3675
3687
|
}
|
|
3676
3688
|
/**
|
|
3677
|
-
* Convert to
|
|
3689
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
3678
3690
|
* @returns {Plaintext}
|
|
3679
3691
|
*/
|
|
3680
3692
|
toPlaintext() {
|
|
@@ -3682,7 +3694,7 @@ class I128 {
|
|
|
3682
3694
|
return Plaintext.__wrap(ret);
|
|
3683
3695
|
}
|
|
3684
3696
|
/**
|
|
3685
|
-
*
|
|
3697
|
+
* Attempt to construct the integer from a field element.
|
|
3686
3698
|
* @param {Field} field
|
|
3687
3699
|
* @returns {I128}
|
|
3688
3700
|
*/
|
|
@@ -3703,7 +3715,7 @@ class I128 {
|
|
|
3703
3715
|
}
|
|
3704
3716
|
}
|
|
3705
3717
|
/**
|
|
3706
|
-
*
|
|
3718
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
3707
3719
|
* @param {Array<any>} fields
|
|
3708
3720
|
* @returns {I128}
|
|
3709
3721
|
*/
|
|
@@ -3723,7 +3735,7 @@ class I128 {
|
|
|
3723
3735
|
}
|
|
3724
3736
|
}
|
|
3725
3737
|
/**
|
|
3726
|
-
* Clone.
|
|
3738
|
+
* Clone the integer in wasm memory.
|
|
3727
3739
|
* @returns {I128}
|
|
3728
3740
|
*/
|
|
3729
3741
|
clone() {
|
|
@@ -3758,7 +3770,7 @@ class I16 {
|
|
|
3758
3770
|
wasm.__wbg_i16_free(ptr, 0);
|
|
3759
3771
|
}
|
|
3760
3772
|
/**
|
|
3761
|
-
*
|
|
3773
|
+
* Construct an integer from a string representation.
|
|
3762
3774
|
* @param {string} s
|
|
3763
3775
|
* @returns {I16}
|
|
3764
3776
|
*/
|
|
@@ -3780,7 +3792,7 @@ class I16 {
|
|
|
3780
3792
|
}
|
|
3781
3793
|
}
|
|
3782
3794
|
/**
|
|
3783
|
-
*
|
|
3795
|
+
* Get the string representation of the integer.
|
|
3784
3796
|
* @returns {string}
|
|
3785
3797
|
*/
|
|
3786
3798
|
toString() {
|
|
@@ -3800,7 +3812,7 @@ class I16 {
|
|
|
3800
3812
|
}
|
|
3801
3813
|
}
|
|
3802
3814
|
/**
|
|
3803
|
-
*
|
|
3815
|
+
* Get the byte array representation of the integer.
|
|
3804
3816
|
* @param {Uint8Array} bytes
|
|
3805
3817
|
* @returns {I16}
|
|
3806
3818
|
*/
|
|
@@ -3821,7 +3833,7 @@ class I16 {
|
|
|
3821
3833
|
}
|
|
3822
3834
|
}
|
|
3823
3835
|
/**
|
|
3824
|
-
*
|
|
3836
|
+
* Construct an integer from a byte array representation.
|
|
3825
3837
|
* @returns {Uint8Array}
|
|
3826
3838
|
*/
|
|
3827
3839
|
toBytesLe() {
|
|
@@ -3840,7 +3852,7 @@ class I16 {
|
|
|
3840
3852
|
}
|
|
3841
3853
|
}
|
|
3842
3854
|
/**
|
|
3843
|
-
*
|
|
3855
|
+
* Construct an integer from a boolean array representation.
|
|
3844
3856
|
* @param {Array<any>} bits
|
|
3845
3857
|
* @returns {I16}
|
|
3846
3858
|
*/
|
|
@@ -3861,7 +3873,7 @@ class I16 {
|
|
|
3861
3873
|
}
|
|
3862
3874
|
}
|
|
3863
3875
|
/**
|
|
3864
|
-
*
|
|
3876
|
+
* Get the boolean array representation of the integer.
|
|
3865
3877
|
* @returns {Array<any>}
|
|
3866
3878
|
*/
|
|
3867
3879
|
toBitsLe() {
|
|
@@ -3885,7 +3897,7 @@ class I16 {
|
|
|
3885
3897
|
return I16.__wrap(ret);
|
|
3886
3898
|
}
|
|
3887
3899
|
/**
|
|
3888
|
-
* Wrapped addition.
|
|
3900
|
+
* Wrapped addition with another integer.
|
|
3889
3901
|
* @param {I16} other
|
|
3890
3902
|
* @returns {I16}
|
|
3891
3903
|
*/
|
|
@@ -3895,7 +3907,7 @@ class I16 {
|
|
|
3895
3907
|
return I16.__wrap(ret);
|
|
3896
3908
|
}
|
|
3897
3909
|
/**
|
|
3898
|
-
* Wrapped subtraction.
|
|
3910
|
+
* Wrapped subtraction with another integer.
|
|
3899
3911
|
* @param {I16} other
|
|
3900
3912
|
* @returns {I16}
|
|
3901
3913
|
*/
|
|
@@ -3905,7 +3917,7 @@ class I16 {
|
|
|
3905
3917
|
return I16.__wrap(ret);
|
|
3906
3918
|
}
|
|
3907
3919
|
/**
|
|
3908
|
-
* Wrapped multiplication.
|
|
3920
|
+
* Wrapped multiplication with another integer.
|
|
3909
3921
|
* @param {I16} other
|
|
3910
3922
|
* @returns {I16}
|
|
3911
3923
|
*/
|
|
@@ -3925,7 +3937,7 @@ class I16 {
|
|
|
3925
3937
|
return I16.__wrap(ret);
|
|
3926
3938
|
}
|
|
3927
3939
|
/**
|
|
3928
|
-
*
|
|
3940
|
+
* Exponentiate the integer with a u8 exponent.
|
|
3929
3941
|
* @param {U8} exponent
|
|
3930
3942
|
* @returns {I16}
|
|
3931
3943
|
*/
|
|
@@ -3935,7 +3947,7 @@ class I16 {
|
|
|
3935
3947
|
return I16.__wrap(ret);
|
|
3936
3948
|
}
|
|
3937
3949
|
/**
|
|
3938
|
-
*
|
|
3950
|
+
* Exponentiate the integer with a u16 exponent.
|
|
3939
3951
|
* @param {U16} exponent
|
|
3940
3952
|
* @returns {I16}
|
|
3941
3953
|
*/
|
|
@@ -3945,7 +3957,7 @@ class I16 {
|
|
|
3945
3957
|
return I16.__wrap(ret);
|
|
3946
3958
|
}
|
|
3947
3959
|
/**
|
|
3948
|
-
*
|
|
3960
|
+
* Exponentiate the integer with a u32 exponent.
|
|
3949
3961
|
* @param {U32} exponent
|
|
3950
3962
|
* @returns {I16}
|
|
3951
3963
|
*/
|
|
@@ -3955,7 +3967,7 @@ class I16 {
|
|
|
3955
3967
|
return I16.__wrap(ret);
|
|
3956
3968
|
}
|
|
3957
3969
|
/**
|
|
3958
|
-
*
|
|
3970
|
+
* Negate the integer (e.g., 5 → -5).
|
|
3959
3971
|
* @returns {I16}
|
|
3960
3972
|
*/
|
|
3961
3973
|
neg() {
|
|
@@ -3963,7 +3975,7 @@ class I16 {
|
|
|
3963
3975
|
return I16.__wrap(ret);
|
|
3964
3976
|
}
|
|
3965
3977
|
/**
|
|
3966
|
-
*
|
|
3978
|
+
* Check equality with another integer.
|
|
3967
3979
|
* @param {I16} other
|
|
3968
3980
|
* @returns {boolean}
|
|
3969
3981
|
*/
|
|
@@ -3973,7 +3985,7 @@ class I16 {
|
|
|
3973
3985
|
return ret !== 0;
|
|
3974
3986
|
}
|
|
3975
3987
|
/**
|
|
3976
|
-
*
|
|
3988
|
+
* Get the remainder from integer division.
|
|
3977
3989
|
* @param {I16} other
|
|
3978
3990
|
* @returns {I16}
|
|
3979
3991
|
*/
|
|
@@ -3983,7 +3995,7 @@ class I16 {
|
|
|
3983
3995
|
return I16.__wrap(ret);
|
|
3984
3996
|
}
|
|
3985
3997
|
/**
|
|
3986
|
-
*
|
|
3998
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
3987
3999
|
* @param {I16} other
|
|
3988
4000
|
* @returns {I16}
|
|
3989
4001
|
*/
|
|
@@ -3993,7 +4005,7 @@ class I16 {
|
|
|
3993
4005
|
return I16.__wrap(ret);
|
|
3994
4006
|
}
|
|
3995
4007
|
/**
|
|
3996
|
-
* Convert to Scalar.
|
|
4008
|
+
* Convert the integer to a Scalar value.
|
|
3997
4009
|
* @returns {Scalar}
|
|
3998
4010
|
*/
|
|
3999
4011
|
toScalar() {
|
|
@@ -4001,7 +4013,7 @@ class I16 {
|
|
|
4001
4013
|
return Scalar.__wrap(ret);
|
|
4002
4014
|
}
|
|
4003
4015
|
/**
|
|
4004
|
-
* Convert to
|
|
4016
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
4005
4017
|
* @returns {Plaintext}
|
|
4006
4018
|
*/
|
|
4007
4019
|
toPlaintext() {
|
|
@@ -4009,7 +4021,7 @@ class I16 {
|
|
|
4009
4021
|
return Plaintext.__wrap(ret);
|
|
4010
4022
|
}
|
|
4011
4023
|
/**
|
|
4012
|
-
*
|
|
4024
|
+
* Attempt to construct the integer from a field element.
|
|
4013
4025
|
* @param {Field} field
|
|
4014
4026
|
* @returns {I16}
|
|
4015
4027
|
*/
|
|
@@ -4030,7 +4042,7 @@ class I16 {
|
|
|
4030
4042
|
}
|
|
4031
4043
|
}
|
|
4032
4044
|
/**
|
|
4033
|
-
*
|
|
4045
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
4034
4046
|
* @param {Array<any>} fields
|
|
4035
4047
|
* @returns {I16}
|
|
4036
4048
|
*/
|
|
@@ -4050,7 +4062,7 @@ class I16 {
|
|
|
4050
4062
|
}
|
|
4051
4063
|
}
|
|
4052
4064
|
/**
|
|
4053
|
-
* Clone.
|
|
4065
|
+
* Clone the integer in wasm memory.
|
|
4054
4066
|
* @returns {I16}
|
|
4055
4067
|
*/
|
|
4056
4068
|
clone() {
|
|
@@ -4085,7 +4097,7 @@ class I32 {
|
|
|
4085
4097
|
wasm.__wbg_i32_free(ptr, 0);
|
|
4086
4098
|
}
|
|
4087
4099
|
/**
|
|
4088
|
-
*
|
|
4100
|
+
* Construct an integer from a string representation.
|
|
4089
4101
|
* @param {string} s
|
|
4090
4102
|
* @returns {I32}
|
|
4091
4103
|
*/
|
|
@@ -4107,7 +4119,7 @@ class I32 {
|
|
|
4107
4119
|
}
|
|
4108
4120
|
}
|
|
4109
4121
|
/**
|
|
4110
|
-
*
|
|
4122
|
+
* Get the string representation of the integer.
|
|
4111
4123
|
* @returns {string}
|
|
4112
4124
|
*/
|
|
4113
4125
|
toString() {
|
|
@@ -4127,7 +4139,7 @@ class I32 {
|
|
|
4127
4139
|
}
|
|
4128
4140
|
}
|
|
4129
4141
|
/**
|
|
4130
|
-
*
|
|
4142
|
+
* Get the byte array representation of the integer.
|
|
4131
4143
|
* @param {Uint8Array} bytes
|
|
4132
4144
|
* @returns {I32}
|
|
4133
4145
|
*/
|
|
@@ -4148,7 +4160,7 @@ class I32 {
|
|
|
4148
4160
|
}
|
|
4149
4161
|
}
|
|
4150
4162
|
/**
|
|
4151
|
-
*
|
|
4163
|
+
* Construct an integer from a byte array representation.
|
|
4152
4164
|
* @returns {Uint8Array}
|
|
4153
4165
|
*/
|
|
4154
4166
|
toBytesLe() {
|
|
@@ -4167,7 +4179,7 @@ class I32 {
|
|
|
4167
4179
|
}
|
|
4168
4180
|
}
|
|
4169
4181
|
/**
|
|
4170
|
-
*
|
|
4182
|
+
* Construct an integer from a boolean array representation.
|
|
4171
4183
|
* @param {Array<any>} bits
|
|
4172
4184
|
* @returns {I32}
|
|
4173
4185
|
*/
|
|
@@ -4188,7 +4200,7 @@ class I32 {
|
|
|
4188
4200
|
}
|
|
4189
4201
|
}
|
|
4190
4202
|
/**
|
|
4191
|
-
*
|
|
4203
|
+
* Get the boolean array representation of the integer.
|
|
4192
4204
|
* @returns {Array<any>}
|
|
4193
4205
|
*/
|
|
4194
4206
|
toBitsLe() {
|
|
@@ -4212,7 +4224,7 @@ class I32 {
|
|
|
4212
4224
|
return I32.__wrap(ret);
|
|
4213
4225
|
}
|
|
4214
4226
|
/**
|
|
4215
|
-
* Wrapped addition.
|
|
4227
|
+
* Wrapped addition with another integer.
|
|
4216
4228
|
* @param {I32} other
|
|
4217
4229
|
* @returns {I32}
|
|
4218
4230
|
*/
|
|
@@ -4222,7 +4234,7 @@ class I32 {
|
|
|
4222
4234
|
return I32.__wrap(ret);
|
|
4223
4235
|
}
|
|
4224
4236
|
/**
|
|
4225
|
-
* Wrapped subtraction.
|
|
4237
|
+
* Wrapped subtraction with another integer.
|
|
4226
4238
|
* @param {I32} other
|
|
4227
4239
|
* @returns {I32}
|
|
4228
4240
|
*/
|
|
@@ -4232,7 +4244,7 @@ class I32 {
|
|
|
4232
4244
|
return I32.__wrap(ret);
|
|
4233
4245
|
}
|
|
4234
4246
|
/**
|
|
4235
|
-
* Wrapped multiplication.
|
|
4247
|
+
* Wrapped multiplication with another integer.
|
|
4236
4248
|
* @param {I32} other
|
|
4237
4249
|
* @returns {I32}
|
|
4238
4250
|
*/
|
|
@@ -4252,7 +4264,7 @@ class I32 {
|
|
|
4252
4264
|
return I32.__wrap(ret);
|
|
4253
4265
|
}
|
|
4254
4266
|
/**
|
|
4255
|
-
*
|
|
4267
|
+
* Exponentiate the integer with a u8 exponent.
|
|
4256
4268
|
* @param {U8} exponent
|
|
4257
4269
|
* @returns {I32}
|
|
4258
4270
|
*/
|
|
@@ -4262,7 +4274,7 @@ class I32 {
|
|
|
4262
4274
|
return I32.__wrap(ret);
|
|
4263
4275
|
}
|
|
4264
4276
|
/**
|
|
4265
|
-
*
|
|
4277
|
+
* Exponentiate the integer with a u16 exponent.
|
|
4266
4278
|
* @param {U16} exponent
|
|
4267
4279
|
* @returns {I32}
|
|
4268
4280
|
*/
|
|
@@ -4272,7 +4284,7 @@ class I32 {
|
|
|
4272
4284
|
return I32.__wrap(ret);
|
|
4273
4285
|
}
|
|
4274
4286
|
/**
|
|
4275
|
-
*
|
|
4287
|
+
* Exponentiate the integer with a u32 exponent.
|
|
4276
4288
|
* @param {U32} exponent
|
|
4277
4289
|
* @returns {I32}
|
|
4278
4290
|
*/
|
|
@@ -4282,7 +4294,7 @@ class I32 {
|
|
|
4282
4294
|
return I32.__wrap(ret);
|
|
4283
4295
|
}
|
|
4284
4296
|
/**
|
|
4285
|
-
*
|
|
4297
|
+
* Negate the integer (e.g., 5 → -5).
|
|
4286
4298
|
* @returns {I32}
|
|
4287
4299
|
*/
|
|
4288
4300
|
neg() {
|
|
@@ -4290,7 +4302,7 @@ class I32 {
|
|
|
4290
4302
|
return I32.__wrap(ret);
|
|
4291
4303
|
}
|
|
4292
4304
|
/**
|
|
4293
|
-
*
|
|
4305
|
+
* Check equality with another integer.
|
|
4294
4306
|
* @param {I32} other
|
|
4295
4307
|
* @returns {boolean}
|
|
4296
4308
|
*/
|
|
@@ -4300,7 +4312,7 @@ class I32 {
|
|
|
4300
4312
|
return ret !== 0;
|
|
4301
4313
|
}
|
|
4302
4314
|
/**
|
|
4303
|
-
*
|
|
4315
|
+
* Get the remainder from integer division.
|
|
4304
4316
|
* @param {I32} other
|
|
4305
4317
|
* @returns {I32}
|
|
4306
4318
|
*/
|
|
@@ -4310,7 +4322,7 @@ class I32 {
|
|
|
4310
4322
|
return I32.__wrap(ret);
|
|
4311
4323
|
}
|
|
4312
4324
|
/**
|
|
4313
|
-
*
|
|
4325
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
4314
4326
|
* @param {I32} other
|
|
4315
4327
|
* @returns {I32}
|
|
4316
4328
|
*/
|
|
@@ -4320,7 +4332,7 @@ class I32 {
|
|
|
4320
4332
|
return I32.__wrap(ret);
|
|
4321
4333
|
}
|
|
4322
4334
|
/**
|
|
4323
|
-
* Convert to Scalar.
|
|
4335
|
+
* Convert the integer to a Scalar value.
|
|
4324
4336
|
* @returns {Scalar}
|
|
4325
4337
|
*/
|
|
4326
4338
|
toScalar() {
|
|
@@ -4328,7 +4340,7 @@ class I32 {
|
|
|
4328
4340
|
return Scalar.__wrap(ret);
|
|
4329
4341
|
}
|
|
4330
4342
|
/**
|
|
4331
|
-
* Convert to
|
|
4343
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
4332
4344
|
* @returns {Plaintext}
|
|
4333
4345
|
*/
|
|
4334
4346
|
toPlaintext() {
|
|
@@ -4336,7 +4348,7 @@ class I32 {
|
|
|
4336
4348
|
return Plaintext.__wrap(ret);
|
|
4337
4349
|
}
|
|
4338
4350
|
/**
|
|
4339
|
-
*
|
|
4351
|
+
* Attempt to construct the integer from a field element.
|
|
4340
4352
|
* @param {Field} field
|
|
4341
4353
|
* @returns {I32}
|
|
4342
4354
|
*/
|
|
@@ -4357,7 +4369,7 @@ class I32 {
|
|
|
4357
4369
|
}
|
|
4358
4370
|
}
|
|
4359
4371
|
/**
|
|
4360
|
-
*
|
|
4372
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
4361
4373
|
* @param {Array<any>} fields
|
|
4362
4374
|
* @returns {I32}
|
|
4363
4375
|
*/
|
|
@@ -4377,7 +4389,7 @@ class I32 {
|
|
|
4377
4389
|
}
|
|
4378
4390
|
}
|
|
4379
4391
|
/**
|
|
4380
|
-
* Clone.
|
|
4392
|
+
* Clone the integer in wasm memory.
|
|
4381
4393
|
* @returns {I32}
|
|
4382
4394
|
*/
|
|
4383
4395
|
clone() {
|
|
@@ -4412,7 +4424,7 @@ class I64 {
|
|
|
4412
4424
|
wasm.__wbg_i64_free(ptr, 0);
|
|
4413
4425
|
}
|
|
4414
4426
|
/**
|
|
4415
|
-
*
|
|
4427
|
+
* Construct an integer from a string representation.
|
|
4416
4428
|
* @param {string} s
|
|
4417
4429
|
* @returns {I64}
|
|
4418
4430
|
*/
|
|
@@ -4434,7 +4446,7 @@ class I64 {
|
|
|
4434
4446
|
}
|
|
4435
4447
|
}
|
|
4436
4448
|
/**
|
|
4437
|
-
*
|
|
4449
|
+
* Get the string representation of the integer.
|
|
4438
4450
|
* @returns {string}
|
|
4439
4451
|
*/
|
|
4440
4452
|
toString() {
|
|
@@ -4454,7 +4466,7 @@ class I64 {
|
|
|
4454
4466
|
}
|
|
4455
4467
|
}
|
|
4456
4468
|
/**
|
|
4457
|
-
*
|
|
4469
|
+
* Get the byte array representation of the integer.
|
|
4458
4470
|
* @param {Uint8Array} bytes
|
|
4459
4471
|
* @returns {I64}
|
|
4460
4472
|
*/
|
|
@@ -4475,7 +4487,7 @@ class I64 {
|
|
|
4475
4487
|
}
|
|
4476
4488
|
}
|
|
4477
4489
|
/**
|
|
4478
|
-
*
|
|
4490
|
+
* Construct an integer from a byte array representation.
|
|
4479
4491
|
* @returns {Uint8Array}
|
|
4480
4492
|
*/
|
|
4481
4493
|
toBytesLe() {
|
|
@@ -4494,7 +4506,7 @@ class I64 {
|
|
|
4494
4506
|
}
|
|
4495
4507
|
}
|
|
4496
4508
|
/**
|
|
4497
|
-
*
|
|
4509
|
+
* Construct an integer from a boolean array representation.
|
|
4498
4510
|
* @param {Array<any>} bits
|
|
4499
4511
|
* @returns {I64}
|
|
4500
4512
|
*/
|
|
@@ -4515,7 +4527,7 @@ class I64 {
|
|
|
4515
4527
|
}
|
|
4516
4528
|
}
|
|
4517
4529
|
/**
|
|
4518
|
-
*
|
|
4530
|
+
* Get the boolean array representation of the integer.
|
|
4519
4531
|
* @returns {Array<any>}
|
|
4520
4532
|
*/
|
|
4521
4533
|
toBitsLe() {
|
|
@@ -4539,7 +4551,7 @@ class I64 {
|
|
|
4539
4551
|
return I64.__wrap(ret);
|
|
4540
4552
|
}
|
|
4541
4553
|
/**
|
|
4542
|
-
* Wrapped addition.
|
|
4554
|
+
* Wrapped addition with another integer.
|
|
4543
4555
|
* @param {I64} other
|
|
4544
4556
|
* @returns {I64}
|
|
4545
4557
|
*/
|
|
@@ -4549,7 +4561,7 @@ class I64 {
|
|
|
4549
4561
|
return I64.__wrap(ret);
|
|
4550
4562
|
}
|
|
4551
4563
|
/**
|
|
4552
|
-
* Wrapped subtraction.
|
|
4564
|
+
* Wrapped subtraction with another integer.
|
|
4553
4565
|
* @param {I64} other
|
|
4554
4566
|
* @returns {I64}
|
|
4555
4567
|
*/
|
|
@@ -4559,7 +4571,7 @@ class I64 {
|
|
|
4559
4571
|
return I64.__wrap(ret);
|
|
4560
4572
|
}
|
|
4561
4573
|
/**
|
|
4562
|
-
* Wrapped multiplication.
|
|
4574
|
+
* Wrapped multiplication with another integer.
|
|
4563
4575
|
* @param {I64} other
|
|
4564
4576
|
* @returns {I64}
|
|
4565
4577
|
*/
|
|
@@ -4579,7 +4591,7 @@ class I64 {
|
|
|
4579
4591
|
return I64.__wrap(ret);
|
|
4580
4592
|
}
|
|
4581
4593
|
/**
|
|
4582
|
-
*
|
|
4594
|
+
* Exponentiate the integer with a u8 exponent.
|
|
4583
4595
|
* @param {U8} exponent
|
|
4584
4596
|
* @returns {I64}
|
|
4585
4597
|
*/
|
|
@@ -4589,7 +4601,7 @@ class I64 {
|
|
|
4589
4601
|
return I64.__wrap(ret);
|
|
4590
4602
|
}
|
|
4591
4603
|
/**
|
|
4592
|
-
*
|
|
4604
|
+
* Exponentiate the integer with a u16 exponent.
|
|
4593
4605
|
* @param {U16} exponent
|
|
4594
4606
|
* @returns {I64}
|
|
4595
4607
|
*/
|
|
@@ -4599,7 +4611,7 @@ class I64 {
|
|
|
4599
4611
|
return I64.__wrap(ret);
|
|
4600
4612
|
}
|
|
4601
4613
|
/**
|
|
4602
|
-
*
|
|
4614
|
+
* Exponentiate the integer with a u32 exponent.
|
|
4603
4615
|
* @param {U32} exponent
|
|
4604
4616
|
* @returns {I64}
|
|
4605
4617
|
*/
|
|
@@ -4609,7 +4621,7 @@ class I64 {
|
|
|
4609
4621
|
return I64.__wrap(ret);
|
|
4610
4622
|
}
|
|
4611
4623
|
/**
|
|
4612
|
-
*
|
|
4624
|
+
* Negate the integer (e.g., 5 → -5).
|
|
4613
4625
|
* @returns {I64}
|
|
4614
4626
|
*/
|
|
4615
4627
|
neg() {
|
|
@@ -4617,7 +4629,7 @@ class I64 {
|
|
|
4617
4629
|
return I64.__wrap(ret);
|
|
4618
4630
|
}
|
|
4619
4631
|
/**
|
|
4620
|
-
*
|
|
4632
|
+
* Check equality with another integer.
|
|
4621
4633
|
* @param {I64} other
|
|
4622
4634
|
* @returns {boolean}
|
|
4623
4635
|
*/
|
|
@@ -4627,7 +4639,7 @@ class I64 {
|
|
|
4627
4639
|
return ret !== 0;
|
|
4628
4640
|
}
|
|
4629
4641
|
/**
|
|
4630
|
-
*
|
|
4642
|
+
* Get the remainder from integer division.
|
|
4631
4643
|
* @param {I64} other
|
|
4632
4644
|
* @returns {I64}
|
|
4633
4645
|
*/
|
|
@@ -4637,7 +4649,7 @@ class I64 {
|
|
|
4637
4649
|
return I64.__wrap(ret);
|
|
4638
4650
|
}
|
|
4639
4651
|
/**
|
|
4640
|
-
*
|
|
4652
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
4641
4653
|
* @param {I64} other
|
|
4642
4654
|
* @returns {I64}
|
|
4643
4655
|
*/
|
|
@@ -4647,7 +4659,7 @@ class I64 {
|
|
|
4647
4659
|
return I64.__wrap(ret);
|
|
4648
4660
|
}
|
|
4649
4661
|
/**
|
|
4650
|
-
* Convert to Scalar.
|
|
4662
|
+
* Convert the integer to a Scalar value.
|
|
4651
4663
|
* @returns {Scalar}
|
|
4652
4664
|
*/
|
|
4653
4665
|
toScalar() {
|
|
@@ -4655,7 +4667,7 @@ class I64 {
|
|
|
4655
4667
|
return Scalar.__wrap(ret);
|
|
4656
4668
|
}
|
|
4657
4669
|
/**
|
|
4658
|
-
* Convert to
|
|
4670
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
4659
4671
|
* @returns {Plaintext}
|
|
4660
4672
|
*/
|
|
4661
4673
|
toPlaintext() {
|
|
@@ -4663,7 +4675,7 @@ class I64 {
|
|
|
4663
4675
|
return Plaintext.__wrap(ret);
|
|
4664
4676
|
}
|
|
4665
4677
|
/**
|
|
4666
|
-
*
|
|
4678
|
+
* Attempt to construct the integer from a field element.
|
|
4667
4679
|
* @param {Field} field
|
|
4668
4680
|
* @returns {I64}
|
|
4669
4681
|
*/
|
|
@@ -4684,7 +4696,7 @@ class I64 {
|
|
|
4684
4696
|
}
|
|
4685
4697
|
}
|
|
4686
4698
|
/**
|
|
4687
|
-
*
|
|
4699
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
4688
4700
|
* @param {Array<any>} fields
|
|
4689
4701
|
* @returns {I64}
|
|
4690
4702
|
*/
|
|
@@ -4704,7 +4716,7 @@ class I64 {
|
|
|
4704
4716
|
}
|
|
4705
4717
|
}
|
|
4706
4718
|
/**
|
|
4707
|
-
* Clone.
|
|
4719
|
+
* Clone the integer in wasm memory.
|
|
4708
4720
|
* @returns {I64}
|
|
4709
4721
|
*/
|
|
4710
4722
|
clone() {
|
|
@@ -4739,7 +4751,7 @@ class I8 {
|
|
|
4739
4751
|
wasm.__wbg_i8_free(ptr, 0);
|
|
4740
4752
|
}
|
|
4741
4753
|
/**
|
|
4742
|
-
*
|
|
4754
|
+
* Construct an integer from a string representation.
|
|
4743
4755
|
* @param {string} s
|
|
4744
4756
|
* @returns {I8}
|
|
4745
4757
|
*/
|
|
@@ -4761,7 +4773,7 @@ class I8 {
|
|
|
4761
4773
|
}
|
|
4762
4774
|
}
|
|
4763
4775
|
/**
|
|
4764
|
-
*
|
|
4776
|
+
* Get the string representation of the integer.
|
|
4765
4777
|
* @returns {string}
|
|
4766
4778
|
*/
|
|
4767
4779
|
toString() {
|
|
@@ -4781,7 +4793,7 @@ class I8 {
|
|
|
4781
4793
|
}
|
|
4782
4794
|
}
|
|
4783
4795
|
/**
|
|
4784
|
-
*
|
|
4796
|
+
* Get the byte array representation of the integer.
|
|
4785
4797
|
* @param {Uint8Array} bytes
|
|
4786
4798
|
* @returns {I8}
|
|
4787
4799
|
*/
|
|
@@ -4802,7 +4814,7 @@ class I8 {
|
|
|
4802
4814
|
}
|
|
4803
4815
|
}
|
|
4804
4816
|
/**
|
|
4805
|
-
*
|
|
4817
|
+
* Construct an integer from a byte array representation.
|
|
4806
4818
|
* @returns {Uint8Array}
|
|
4807
4819
|
*/
|
|
4808
4820
|
toBytesLe() {
|
|
@@ -4821,7 +4833,7 @@ class I8 {
|
|
|
4821
4833
|
}
|
|
4822
4834
|
}
|
|
4823
4835
|
/**
|
|
4824
|
-
*
|
|
4836
|
+
* Construct an integer from a boolean array representation.
|
|
4825
4837
|
* @param {Array<any>} bits
|
|
4826
4838
|
* @returns {I8}
|
|
4827
4839
|
*/
|
|
@@ -4842,7 +4854,7 @@ class I8 {
|
|
|
4842
4854
|
}
|
|
4843
4855
|
}
|
|
4844
4856
|
/**
|
|
4845
|
-
*
|
|
4857
|
+
* Get the boolean array representation of the integer.
|
|
4846
4858
|
* @returns {Array<any>}
|
|
4847
4859
|
*/
|
|
4848
4860
|
toBitsLe() {
|
|
@@ -4866,7 +4878,7 @@ class I8 {
|
|
|
4866
4878
|
return I8.__wrap(ret);
|
|
4867
4879
|
}
|
|
4868
4880
|
/**
|
|
4869
|
-
* Wrapped addition.
|
|
4881
|
+
* Wrapped addition with another integer.
|
|
4870
4882
|
* @param {I8} other
|
|
4871
4883
|
* @returns {I8}
|
|
4872
4884
|
*/
|
|
@@ -4876,7 +4888,7 @@ class I8 {
|
|
|
4876
4888
|
return I8.__wrap(ret);
|
|
4877
4889
|
}
|
|
4878
4890
|
/**
|
|
4879
|
-
* Wrapped subtraction.
|
|
4891
|
+
* Wrapped subtraction with another integer.
|
|
4880
4892
|
* @param {I8} other
|
|
4881
4893
|
* @returns {I8}
|
|
4882
4894
|
*/
|
|
@@ -4886,7 +4898,7 @@ class I8 {
|
|
|
4886
4898
|
return I8.__wrap(ret);
|
|
4887
4899
|
}
|
|
4888
4900
|
/**
|
|
4889
|
-
* Wrapped multiplication.
|
|
4901
|
+
* Wrapped multiplication with another integer.
|
|
4890
4902
|
* @param {I8} other
|
|
4891
4903
|
* @returns {I8}
|
|
4892
4904
|
*/
|
|
@@ -4906,7 +4918,7 @@ class I8 {
|
|
|
4906
4918
|
return I8.__wrap(ret);
|
|
4907
4919
|
}
|
|
4908
4920
|
/**
|
|
4909
|
-
*
|
|
4921
|
+
* Exponentiate the integer with a u8 exponent.
|
|
4910
4922
|
* @param {U8} exponent
|
|
4911
4923
|
* @returns {I8}
|
|
4912
4924
|
*/
|
|
@@ -4916,7 +4928,7 @@ class I8 {
|
|
|
4916
4928
|
return I8.__wrap(ret);
|
|
4917
4929
|
}
|
|
4918
4930
|
/**
|
|
4919
|
-
*
|
|
4931
|
+
* Exponentiate the integer with a u16 exponent.
|
|
4920
4932
|
* @param {U16} exponent
|
|
4921
4933
|
* @returns {I8}
|
|
4922
4934
|
*/
|
|
@@ -4926,7 +4938,7 @@ class I8 {
|
|
|
4926
4938
|
return I8.__wrap(ret);
|
|
4927
4939
|
}
|
|
4928
4940
|
/**
|
|
4929
|
-
*
|
|
4941
|
+
* Exponentiate the integer with a u32 exponent.
|
|
4930
4942
|
* @param {U32} exponent
|
|
4931
4943
|
* @returns {I8}
|
|
4932
4944
|
*/
|
|
@@ -4936,7 +4948,7 @@ class I8 {
|
|
|
4936
4948
|
return I8.__wrap(ret);
|
|
4937
4949
|
}
|
|
4938
4950
|
/**
|
|
4939
|
-
*
|
|
4951
|
+
* Negate the integer (e.g., 5 → -5).
|
|
4940
4952
|
* @returns {I8}
|
|
4941
4953
|
*/
|
|
4942
4954
|
neg() {
|
|
@@ -4944,7 +4956,7 @@ class I8 {
|
|
|
4944
4956
|
return I8.__wrap(ret);
|
|
4945
4957
|
}
|
|
4946
4958
|
/**
|
|
4947
|
-
*
|
|
4959
|
+
* Check equality with another integer.
|
|
4948
4960
|
* @param {I8} other
|
|
4949
4961
|
* @returns {boolean}
|
|
4950
4962
|
*/
|
|
@@ -4954,7 +4966,7 @@ class I8 {
|
|
|
4954
4966
|
return ret !== 0;
|
|
4955
4967
|
}
|
|
4956
4968
|
/**
|
|
4957
|
-
*
|
|
4969
|
+
* Get the remainder from integer division.
|
|
4958
4970
|
* @param {I8} other
|
|
4959
4971
|
* @returns {I8}
|
|
4960
4972
|
*/
|
|
@@ -4964,7 +4976,7 @@ class I8 {
|
|
|
4964
4976
|
return I8.__wrap(ret);
|
|
4965
4977
|
}
|
|
4966
4978
|
/**
|
|
4967
|
-
*
|
|
4979
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
4968
4980
|
* @param {I8} other
|
|
4969
4981
|
* @returns {I8}
|
|
4970
4982
|
*/
|
|
@@ -4974,7 +4986,7 @@ class I8 {
|
|
|
4974
4986
|
return I8.__wrap(ret);
|
|
4975
4987
|
}
|
|
4976
4988
|
/**
|
|
4977
|
-
* Convert to Scalar.
|
|
4989
|
+
* Convert the integer to a Scalar value.
|
|
4978
4990
|
* @returns {Scalar}
|
|
4979
4991
|
*/
|
|
4980
4992
|
toScalar() {
|
|
@@ -4982,7 +4994,7 @@ class I8 {
|
|
|
4982
4994
|
return Scalar.__wrap(ret);
|
|
4983
4995
|
}
|
|
4984
4996
|
/**
|
|
4985
|
-
* Convert to
|
|
4997
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
4986
4998
|
* @returns {Plaintext}
|
|
4987
4999
|
*/
|
|
4988
5000
|
toPlaintext() {
|
|
@@ -4990,7 +5002,7 @@ class I8 {
|
|
|
4990
5002
|
return Plaintext.__wrap(ret);
|
|
4991
5003
|
}
|
|
4992
5004
|
/**
|
|
4993
|
-
*
|
|
5005
|
+
* Attempt to construct the integer from a field element.
|
|
4994
5006
|
* @param {Field} field
|
|
4995
5007
|
* @returns {I8}
|
|
4996
5008
|
*/
|
|
@@ -5011,7 +5023,7 @@ class I8 {
|
|
|
5011
5023
|
}
|
|
5012
5024
|
}
|
|
5013
5025
|
/**
|
|
5014
|
-
*
|
|
5026
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
5015
5027
|
* @param {Array<any>} fields
|
|
5016
5028
|
* @returns {I8}
|
|
5017
5029
|
*/
|
|
@@ -5031,7 +5043,7 @@ class I8 {
|
|
|
5031
5043
|
}
|
|
5032
5044
|
}
|
|
5033
5045
|
/**
|
|
5034
|
-
* Clone.
|
|
5046
|
+
* Clone the integer in wasm memory.
|
|
5035
5047
|
* @returns {I8}
|
|
5036
5048
|
*/
|
|
5037
5049
|
clone() {
|
|
@@ -7335,15 +7347,16 @@ class ProgramManager {
|
|
|
7335
7347
|
* @param {string} function_name
|
|
7336
7348
|
* @param {Array<any>} inputs
|
|
7337
7349
|
* @param {object | null} [imports]
|
|
7350
|
+
* @param {number | null} [edition]
|
|
7338
7351
|
* @returns {Promise<Authorization>}
|
|
7339
7352
|
*/
|
|
7340
|
-
static authorize(private_key, program, function_name, inputs, imports) {
|
|
7353
|
+
static authorize(private_key, program, function_name, inputs, imports, edition) {
|
|
7341
7354
|
_assertClass(private_key, PrivateKey);
|
|
7342
7355
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7343
7356
|
const len0 = WASM_VECTOR_LEN;
|
|
7344
7357
|
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7345
7358
|
const len1 = WASM_VECTOR_LEN;
|
|
7346
|
-
const ret = wasm.programmanager_authorize(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
|
|
7359
|
+
const ret = wasm.programmanager_authorize(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7347
7360
|
return takeObject(ret);
|
|
7348
7361
|
}
|
|
7349
7362
|
/**
|
|
@@ -7360,15 +7373,16 @@ class ProgramManager {
|
|
|
7360
7373
|
* @param {string} function_name
|
|
7361
7374
|
* @param {Array<any>} inputs
|
|
7362
7375
|
* @param {object | null} [imports]
|
|
7376
|
+
* @param {number | null} [edition]
|
|
7363
7377
|
* @returns {Promise<Authorization>}
|
|
7364
7378
|
*/
|
|
7365
|
-
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports) {
|
|
7379
|
+
static buildAuthorizationUnchecked(private_key, program, function_name, inputs, imports, edition) {
|
|
7366
7380
|
_assertClass(private_key, PrivateKey);
|
|
7367
7381
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7368
7382
|
const len0 = WASM_VECTOR_LEN;
|
|
7369
7383
|
const ptr1 = passStringToWasm0(function_name, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7370
7384
|
const len1 = WASM_VECTOR_LEN;
|
|
7371
|
-
const ret = wasm.programmanager_buildAuthorizationUnchecked(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
|
|
7385
|
+
const ret = wasm.programmanager_buildAuthorizationUnchecked(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7372
7386
|
return takeObject(ret);
|
|
7373
7387
|
}
|
|
7374
7388
|
/**
|
|
@@ -7538,9 +7552,10 @@ class ProgramManager {
|
|
|
7538
7552
|
* @param {VerifyingKey | null} [verifying_key]
|
|
7539
7553
|
* @param {string | null} [url]
|
|
7540
7554
|
* @param {OfflineQuery | null} [offline_query]
|
|
7555
|
+
* @param {number | null} [edition]
|
|
7541
7556
|
* @returns {Promise<ExecutionResponse>}
|
|
7542
7557
|
*/
|
|
7543
|
-
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, offline_query) {
|
|
7558
|
+
static executeFunctionOffline(private_key, program, _function, inputs, prove_execution, cache, imports, proving_key, verifying_key, url, offline_query, edition) {
|
|
7544
7559
|
_assertClass(private_key, PrivateKey);
|
|
7545
7560
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7546
7561
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7563,7 +7578,7 @@ class ProgramManager {
|
|
|
7563
7578
|
_assertClass(offline_query, OfflineQuery);
|
|
7564
7579
|
ptr5 = offline_query.__destroy_into_raw();
|
|
7565
7580
|
}
|
|
7566
|
-
const ret = wasm.programmanager_executeFunctionOffline(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), prove_execution, cache, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr2, ptr3, ptr4, len4, ptr5);
|
|
7581
|
+
const ret = wasm.programmanager_executeFunctionOffline(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), prove_execution, cache, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr2, ptr3, ptr4, len4, ptr5, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7567
7582
|
return takeObject(ret);
|
|
7568
7583
|
}
|
|
7569
7584
|
/**
|
|
@@ -7587,6 +7602,8 @@ class ProgramManager {
|
|
|
7587
7602
|
* @param verifying_key (optional) Provide a verifying key to use for the function execution
|
|
7588
7603
|
* @param fee_proving_key (optional) Provide a proving key to use for the fee execution
|
|
7589
7604
|
* @param fee_verifying_key (optional) Provide a verifying key to use for the fee execution
|
|
7605
|
+
* @param offline_query An offline query object to use if building a transaction without an internet connection.
|
|
7606
|
+
* @param edition The edition of the program to execute. Defaults to the latest found on the network, or 1 if the program does not exist on the network.
|
|
7590
7607
|
* @returns {Transaction}
|
|
7591
7608
|
* @param {PrivateKey} private_key
|
|
7592
7609
|
* @param {string} program
|
|
@@ -7601,9 +7618,10 @@ class ProgramManager {
|
|
|
7601
7618
|
* @param {ProvingKey | null} [fee_proving_key]
|
|
7602
7619
|
* @param {VerifyingKey | null} [fee_verifying_key]
|
|
7603
7620
|
* @param {OfflineQuery | null} [offline_query]
|
|
7621
|
+
* @param {number | null} [edition]
|
|
7604
7622
|
* @returns {Promise<Transaction>}
|
|
7605
7623
|
*/
|
|
7606
|
-
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, offline_query) {
|
|
7624
|
+
static buildExecutionTransaction(private_key, program, _function, inputs, priority_fee_credits, fee_record, url, imports, proving_key, verifying_key, fee_proving_key, fee_verifying_key, offline_query, edition) {
|
|
7607
7625
|
_assertClass(private_key, PrivateKey);
|
|
7608
7626
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7609
7627
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7641,7 +7659,7 @@ class ProgramManager {
|
|
|
7641
7659
|
_assertClass(offline_query, OfflineQuery);
|
|
7642
7660
|
ptr8 = offline_query.__destroy_into_raw();
|
|
7643
7661
|
}
|
|
7644
|
-
const ret = wasm.programmanager_buildExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr4, ptr5, ptr6, ptr7, ptr8);
|
|
7662
|
+
const ret = wasm.programmanager_buildExecutionTransaction(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), priority_fee_credits, ptr2, ptr3, len3, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr4, ptr5, ptr6, ptr7, ptr8, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7645
7663
|
return takeObject(ret);
|
|
7646
7664
|
}
|
|
7647
7665
|
/**
|
|
@@ -7671,9 +7689,10 @@ class ProgramManager {
|
|
|
7671
7689
|
* @param {ProvingKey | null} [proving_key]
|
|
7672
7690
|
* @param {VerifyingKey | null} [verifying_key]
|
|
7673
7691
|
* @param {OfflineQuery | null} [offline_query]
|
|
7692
|
+
* @param {number | null} [edition]
|
|
7674
7693
|
* @returns {Promise<bigint>}
|
|
7675
7694
|
*/
|
|
7676
|
-
static estimateExecutionFee(private_key, program, _function, inputs, url, imports, proving_key, verifying_key, offline_query) {
|
|
7695
|
+
static estimateExecutionFee(private_key, program, _function, inputs, url, imports, proving_key, verifying_key, offline_query, edition) {
|
|
7677
7696
|
_assertClass(private_key, PrivateKey);
|
|
7678
7697
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7679
7698
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7696,7 +7715,7 @@ class ProgramManager {
|
|
|
7696
7715
|
_assertClass(offline_query, OfflineQuery);
|
|
7697
7716
|
ptr5 = offline_query.__destroy_into_raw();
|
|
7698
7717
|
}
|
|
7699
|
-
const ret = wasm.programmanager_estimateExecutionFee(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5);
|
|
7718
|
+
const ret = wasm.programmanager_estimateExecutionFee(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), ptr2, len2, isLikeNone(imports) ? 0 : addHeapObject(imports), ptr3, ptr4, ptr5, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7700
7719
|
return takeObject(ret);
|
|
7701
7720
|
}
|
|
7702
7721
|
/**
|
|
@@ -7827,9 +7846,10 @@ class ProgramManager {
|
|
|
7827
7846
|
* @param {object | null | undefined} imports
|
|
7828
7847
|
* @param {boolean} broadcast
|
|
7829
7848
|
* @param {boolean} unchecked
|
|
7849
|
+
* @param {number | null} [edition]
|
|
7830
7850
|
* @returns {Promise<ProvingRequest>}
|
|
7831
7851
|
*/
|
|
7832
|
-
static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked) {
|
|
7852
|
+
static buildProvingRequest(private_key, program, function_name, inputs, base_fee_credits, priority_fee_credits, fee_record, imports, broadcast, unchecked, edition) {
|
|
7833
7853
|
_assertClass(private_key, PrivateKey);
|
|
7834
7854
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7835
7855
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -7840,7 +7860,7 @@ class ProgramManager {
|
|
|
7840
7860
|
_assertClass(fee_record, RecordPlaintext);
|
|
7841
7861
|
ptr2 = fee_record.__destroy_into_raw();
|
|
7842
7862
|
}
|
|
7843
|
-
const ret = wasm.programmanager_buildProvingRequest(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), base_fee_credits, priority_fee_credits, ptr2, isLikeNone(imports) ? 0 : addHeapObject(imports), broadcast, unchecked);
|
|
7863
|
+
const ret = wasm.programmanager_buildProvingRequest(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), base_fee_credits, priority_fee_credits, ptr2, isLikeNone(imports) ? 0 : addHeapObject(imports), broadcast, unchecked, isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7844
7864
|
return takeObject(ret);
|
|
7845
7865
|
}
|
|
7846
7866
|
/**
|
|
@@ -7976,15 +7996,16 @@ class ProgramManager {
|
|
|
7976
7996
|
* @param {string} function_id
|
|
7977
7997
|
* @param {Array<any>} inputs
|
|
7978
7998
|
* @param {object | null} [imports]
|
|
7999
|
+
* @param {number | null} [edition]
|
|
7979
8000
|
* @returns {Promise<KeyPair>}
|
|
7980
8001
|
*/
|
|
7981
|
-
static synthesizeKeyPair(private_key, program, function_id, inputs, imports) {
|
|
8002
|
+
static synthesizeKeyPair(private_key, program, function_id, inputs, imports, edition) {
|
|
7982
8003
|
_assertClass(private_key, PrivateKey);
|
|
7983
8004
|
const ptr0 = passStringToWasm0(program, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7984
8005
|
const len0 = WASM_VECTOR_LEN;
|
|
7985
8006
|
const ptr1 = passStringToWasm0(function_id, wasm.__wbindgen_export_3, wasm.__wbindgen_export_4);
|
|
7986
8007
|
const len1 = WASM_VECTOR_LEN;
|
|
7987
|
-
const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports));
|
|
8008
|
+
const ret = wasm.programmanager_synthesizeKeyPair(private_key.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(inputs), isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(edition) ? 0xFFFFFF : edition);
|
|
7988
8009
|
return takeObject(ret);
|
|
7989
8010
|
}
|
|
7990
8011
|
}
|
|
@@ -9377,6 +9398,25 @@ class Scalar {
|
|
|
9377
9398
|
const ret = wasm.scalar_toPlaintext(this.__wbg_ptr);
|
|
9378
9399
|
return Plaintext.__wrap(ret);
|
|
9379
9400
|
}
|
|
9401
|
+
/**
|
|
9402
|
+
* Cast the scalar element to a field element.
|
|
9403
|
+
* @returns {Field}
|
|
9404
|
+
*/
|
|
9405
|
+
toField() {
|
|
9406
|
+
try {
|
|
9407
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
9408
|
+
wasm.scalar_toField(retptr, this.__wbg_ptr);
|
|
9409
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
9410
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
9411
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
9412
|
+
if (r2) {
|
|
9413
|
+
throw takeObject(r1);
|
|
9414
|
+
}
|
|
9415
|
+
return Field.__wrap(r0);
|
|
9416
|
+
} finally {
|
|
9417
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
9418
|
+
}
|
|
9419
|
+
}
|
|
9380
9420
|
/**
|
|
9381
9421
|
* Clone the scalar element.
|
|
9382
9422
|
* @returns {Scalar}
|
|
@@ -10425,7 +10465,7 @@ class U128 {
|
|
|
10425
10465
|
wasm.__wbg_u128_free(ptr, 0);
|
|
10426
10466
|
}
|
|
10427
10467
|
/**
|
|
10428
|
-
*
|
|
10468
|
+
* Construct an integer from a string representation.
|
|
10429
10469
|
* @param {string} s
|
|
10430
10470
|
* @returns {U128}
|
|
10431
10471
|
*/
|
|
@@ -10447,7 +10487,7 @@ class U128 {
|
|
|
10447
10487
|
}
|
|
10448
10488
|
}
|
|
10449
10489
|
/**
|
|
10450
|
-
*
|
|
10490
|
+
* Get the string representation of the integer.
|
|
10451
10491
|
* @returns {string}
|
|
10452
10492
|
*/
|
|
10453
10493
|
toString() {
|
|
@@ -10467,7 +10507,7 @@ class U128 {
|
|
|
10467
10507
|
}
|
|
10468
10508
|
}
|
|
10469
10509
|
/**
|
|
10470
|
-
*
|
|
10510
|
+
* Get the byte array representation of the integer.
|
|
10471
10511
|
* @param {Uint8Array} bytes
|
|
10472
10512
|
* @returns {U128}
|
|
10473
10513
|
*/
|
|
@@ -10488,7 +10528,7 @@ class U128 {
|
|
|
10488
10528
|
}
|
|
10489
10529
|
}
|
|
10490
10530
|
/**
|
|
10491
|
-
*
|
|
10531
|
+
* Construct an integer from a byte array representation.
|
|
10492
10532
|
* @returns {Uint8Array}
|
|
10493
10533
|
*/
|
|
10494
10534
|
toBytesLe() {
|
|
@@ -10507,7 +10547,7 @@ class U128 {
|
|
|
10507
10547
|
}
|
|
10508
10548
|
}
|
|
10509
10549
|
/**
|
|
10510
|
-
*
|
|
10550
|
+
* Construct an integer from a boolean array representation.
|
|
10511
10551
|
* @param {Array<any>} bits
|
|
10512
10552
|
* @returns {U128}
|
|
10513
10553
|
*/
|
|
@@ -10528,7 +10568,7 @@ class U128 {
|
|
|
10528
10568
|
}
|
|
10529
10569
|
}
|
|
10530
10570
|
/**
|
|
10531
|
-
*
|
|
10571
|
+
* Get the boolean array representation of the integer.
|
|
10532
10572
|
* @returns {Array<any>}
|
|
10533
10573
|
*/
|
|
10534
10574
|
toBitsLe() {
|
|
@@ -10552,7 +10592,7 @@ class U128 {
|
|
|
10552
10592
|
return U128.__wrap(ret);
|
|
10553
10593
|
}
|
|
10554
10594
|
/**
|
|
10555
|
-
* Wrapped addition.
|
|
10595
|
+
* Wrapped addition with another integer.
|
|
10556
10596
|
* @param {U128} other
|
|
10557
10597
|
* @returns {U128}
|
|
10558
10598
|
*/
|
|
@@ -10562,7 +10602,7 @@ class U128 {
|
|
|
10562
10602
|
return U128.__wrap(ret);
|
|
10563
10603
|
}
|
|
10564
10604
|
/**
|
|
10565
|
-
* Wrapped subtraction.
|
|
10605
|
+
* Wrapped subtraction with another integer.
|
|
10566
10606
|
* @param {U128} other
|
|
10567
10607
|
* @returns {U128}
|
|
10568
10608
|
*/
|
|
@@ -10572,7 +10612,7 @@ class U128 {
|
|
|
10572
10612
|
return U128.__wrap(ret);
|
|
10573
10613
|
}
|
|
10574
10614
|
/**
|
|
10575
|
-
* Wrapped multiplication.
|
|
10615
|
+
* Wrapped multiplication with another integer.
|
|
10576
10616
|
* @param {U128} other
|
|
10577
10617
|
* @returns {U128}
|
|
10578
10618
|
*/
|
|
@@ -10592,7 +10632,7 @@ class U128 {
|
|
|
10592
10632
|
return U128.__wrap(ret);
|
|
10593
10633
|
}
|
|
10594
10634
|
/**
|
|
10595
|
-
*
|
|
10635
|
+
* Exponentiate the integer with a u8 exponent.
|
|
10596
10636
|
* @param {U8} exponent
|
|
10597
10637
|
* @returns {U128}
|
|
10598
10638
|
*/
|
|
@@ -10602,7 +10642,7 @@ class U128 {
|
|
|
10602
10642
|
return U128.__wrap(ret);
|
|
10603
10643
|
}
|
|
10604
10644
|
/**
|
|
10605
|
-
*
|
|
10645
|
+
* Exponentiate the integer with a u16 exponent.
|
|
10606
10646
|
* @param {U16} exponent
|
|
10607
10647
|
* @returns {U128}
|
|
10608
10648
|
*/
|
|
@@ -10612,7 +10652,7 @@ class U128 {
|
|
|
10612
10652
|
return U128.__wrap(ret);
|
|
10613
10653
|
}
|
|
10614
10654
|
/**
|
|
10615
|
-
*
|
|
10655
|
+
* Exponentiate the integer with a u32 exponent.
|
|
10616
10656
|
* @param {U32} exponent
|
|
10617
10657
|
* @returns {U128}
|
|
10618
10658
|
*/
|
|
@@ -10622,7 +10662,7 @@ class U128 {
|
|
|
10622
10662
|
return U128.__wrap(ret);
|
|
10623
10663
|
}
|
|
10624
10664
|
/**
|
|
10625
|
-
*
|
|
10665
|
+
* Negate the integer (e.g., 5 → -5).
|
|
10626
10666
|
* @returns {U128}
|
|
10627
10667
|
*/
|
|
10628
10668
|
neg() {
|
|
@@ -10630,7 +10670,7 @@ class U128 {
|
|
|
10630
10670
|
return U128.__wrap(ret);
|
|
10631
10671
|
}
|
|
10632
10672
|
/**
|
|
10633
|
-
*
|
|
10673
|
+
* Check equality with another integer.
|
|
10634
10674
|
* @param {U128} other
|
|
10635
10675
|
* @returns {boolean}
|
|
10636
10676
|
*/
|
|
@@ -10640,7 +10680,7 @@ class U128 {
|
|
|
10640
10680
|
return ret !== 0;
|
|
10641
10681
|
}
|
|
10642
10682
|
/**
|
|
10643
|
-
*
|
|
10683
|
+
* Get the remainder from integer division.
|
|
10644
10684
|
* @param {U128} other
|
|
10645
10685
|
* @returns {U128}
|
|
10646
10686
|
*/
|
|
@@ -10650,7 +10690,7 @@ class U128 {
|
|
|
10650
10690
|
return U128.__wrap(ret);
|
|
10651
10691
|
}
|
|
10652
10692
|
/**
|
|
10653
|
-
*
|
|
10693
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
10654
10694
|
* @param {U128} other
|
|
10655
10695
|
* @returns {U128}
|
|
10656
10696
|
*/
|
|
@@ -10660,7 +10700,7 @@ class U128 {
|
|
|
10660
10700
|
return U128.__wrap(ret);
|
|
10661
10701
|
}
|
|
10662
10702
|
/**
|
|
10663
|
-
* Convert to Scalar.
|
|
10703
|
+
* Convert the integer to a Scalar value.
|
|
10664
10704
|
* @returns {Scalar}
|
|
10665
10705
|
*/
|
|
10666
10706
|
toScalar() {
|
|
@@ -10668,7 +10708,7 @@ class U128 {
|
|
|
10668
10708
|
return Scalar.__wrap(ret);
|
|
10669
10709
|
}
|
|
10670
10710
|
/**
|
|
10671
|
-
* Convert to
|
|
10711
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
10672
10712
|
* @returns {Plaintext}
|
|
10673
10713
|
*/
|
|
10674
10714
|
toPlaintext() {
|
|
@@ -10676,7 +10716,7 @@ class U128 {
|
|
|
10676
10716
|
return Plaintext.__wrap(ret);
|
|
10677
10717
|
}
|
|
10678
10718
|
/**
|
|
10679
|
-
*
|
|
10719
|
+
* Attempt to construct the integer from a field element.
|
|
10680
10720
|
* @param {Field} field
|
|
10681
10721
|
* @returns {U128}
|
|
10682
10722
|
*/
|
|
@@ -10697,7 +10737,7 @@ class U128 {
|
|
|
10697
10737
|
}
|
|
10698
10738
|
}
|
|
10699
10739
|
/**
|
|
10700
|
-
*
|
|
10740
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
10701
10741
|
* @param {Array<any>} fields
|
|
10702
10742
|
* @returns {U128}
|
|
10703
10743
|
*/
|
|
@@ -10717,7 +10757,7 @@ class U128 {
|
|
|
10717
10757
|
}
|
|
10718
10758
|
}
|
|
10719
10759
|
/**
|
|
10720
|
-
* Clone.
|
|
10760
|
+
* Clone the integer in wasm memory.
|
|
10721
10761
|
* @returns {U128}
|
|
10722
10762
|
*/
|
|
10723
10763
|
clone() {
|
|
@@ -10752,7 +10792,7 @@ class U16 {
|
|
|
10752
10792
|
wasm.__wbg_u16_free(ptr, 0);
|
|
10753
10793
|
}
|
|
10754
10794
|
/**
|
|
10755
|
-
*
|
|
10795
|
+
* Construct an integer from a string representation.
|
|
10756
10796
|
* @param {string} s
|
|
10757
10797
|
* @returns {U16}
|
|
10758
10798
|
*/
|
|
@@ -10774,7 +10814,7 @@ class U16 {
|
|
|
10774
10814
|
}
|
|
10775
10815
|
}
|
|
10776
10816
|
/**
|
|
10777
|
-
*
|
|
10817
|
+
* Get the string representation of the integer.
|
|
10778
10818
|
* @returns {string}
|
|
10779
10819
|
*/
|
|
10780
10820
|
toString() {
|
|
@@ -10794,7 +10834,7 @@ class U16 {
|
|
|
10794
10834
|
}
|
|
10795
10835
|
}
|
|
10796
10836
|
/**
|
|
10797
|
-
*
|
|
10837
|
+
* Get the byte array representation of the integer.
|
|
10798
10838
|
* @param {Uint8Array} bytes
|
|
10799
10839
|
* @returns {U16}
|
|
10800
10840
|
*/
|
|
@@ -10815,7 +10855,7 @@ class U16 {
|
|
|
10815
10855
|
}
|
|
10816
10856
|
}
|
|
10817
10857
|
/**
|
|
10818
|
-
*
|
|
10858
|
+
* Construct an integer from a byte array representation.
|
|
10819
10859
|
* @returns {Uint8Array}
|
|
10820
10860
|
*/
|
|
10821
10861
|
toBytesLe() {
|
|
@@ -10834,7 +10874,7 @@ class U16 {
|
|
|
10834
10874
|
}
|
|
10835
10875
|
}
|
|
10836
10876
|
/**
|
|
10837
|
-
*
|
|
10877
|
+
* Construct an integer from a boolean array representation.
|
|
10838
10878
|
* @param {Array<any>} bits
|
|
10839
10879
|
* @returns {U16}
|
|
10840
10880
|
*/
|
|
@@ -10855,7 +10895,7 @@ class U16 {
|
|
|
10855
10895
|
}
|
|
10856
10896
|
}
|
|
10857
10897
|
/**
|
|
10858
|
-
*
|
|
10898
|
+
* Get the boolean array representation of the integer.
|
|
10859
10899
|
* @returns {Array<any>}
|
|
10860
10900
|
*/
|
|
10861
10901
|
toBitsLe() {
|
|
@@ -10879,7 +10919,7 @@ class U16 {
|
|
|
10879
10919
|
return U16.__wrap(ret);
|
|
10880
10920
|
}
|
|
10881
10921
|
/**
|
|
10882
|
-
* Wrapped addition.
|
|
10922
|
+
* Wrapped addition with another integer.
|
|
10883
10923
|
* @param {U16} other
|
|
10884
10924
|
* @returns {U16}
|
|
10885
10925
|
*/
|
|
@@ -10889,7 +10929,7 @@ class U16 {
|
|
|
10889
10929
|
return U16.__wrap(ret);
|
|
10890
10930
|
}
|
|
10891
10931
|
/**
|
|
10892
|
-
* Wrapped subtraction.
|
|
10932
|
+
* Wrapped subtraction with another integer.
|
|
10893
10933
|
* @param {U16} other
|
|
10894
10934
|
* @returns {U16}
|
|
10895
10935
|
*/
|
|
@@ -10899,7 +10939,7 @@ class U16 {
|
|
|
10899
10939
|
return U16.__wrap(ret);
|
|
10900
10940
|
}
|
|
10901
10941
|
/**
|
|
10902
|
-
* Wrapped multiplication.
|
|
10942
|
+
* Wrapped multiplication with another integer.
|
|
10903
10943
|
* @param {U16} other
|
|
10904
10944
|
* @returns {U16}
|
|
10905
10945
|
*/
|
|
@@ -10919,7 +10959,7 @@ class U16 {
|
|
|
10919
10959
|
return U16.__wrap(ret);
|
|
10920
10960
|
}
|
|
10921
10961
|
/**
|
|
10922
|
-
*
|
|
10962
|
+
* Exponentiate the integer with a u8 exponent.
|
|
10923
10963
|
* @param {U8} exponent
|
|
10924
10964
|
* @returns {U16}
|
|
10925
10965
|
*/
|
|
@@ -10929,7 +10969,7 @@ class U16 {
|
|
|
10929
10969
|
return U16.__wrap(ret);
|
|
10930
10970
|
}
|
|
10931
10971
|
/**
|
|
10932
|
-
*
|
|
10972
|
+
* Exponentiate the integer with a u16 exponent.
|
|
10933
10973
|
* @param {U16} exponent
|
|
10934
10974
|
* @returns {U16}
|
|
10935
10975
|
*/
|
|
@@ -10939,7 +10979,7 @@ class U16 {
|
|
|
10939
10979
|
return U16.__wrap(ret);
|
|
10940
10980
|
}
|
|
10941
10981
|
/**
|
|
10942
|
-
*
|
|
10982
|
+
* Exponentiate the integer with a u32 exponent.
|
|
10943
10983
|
* @param {U32} exponent
|
|
10944
10984
|
* @returns {U16}
|
|
10945
10985
|
*/
|
|
@@ -10949,7 +10989,7 @@ class U16 {
|
|
|
10949
10989
|
return U16.__wrap(ret);
|
|
10950
10990
|
}
|
|
10951
10991
|
/**
|
|
10952
|
-
*
|
|
10992
|
+
* Negate the integer (e.g., 5 → -5).
|
|
10953
10993
|
* @returns {U16}
|
|
10954
10994
|
*/
|
|
10955
10995
|
neg() {
|
|
@@ -10957,7 +10997,7 @@ class U16 {
|
|
|
10957
10997
|
return U16.__wrap(ret);
|
|
10958
10998
|
}
|
|
10959
10999
|
/**
|
|
10960
|
-
*
|
|
11000
|
+
* Check equality with another integer.
|
|
10961
11001
|
* @param {U16} other
|
|
10962
11002
|
* @returns {boolean}
|
|
10963
11003
|
*/
|
|
@@ -10967,7 +11007,7 @@ class U16 {
|
|
|
10967
11007
|
return ret !== 0;
|
|
10968
11008
|
}
|
|
10969
11009
|
/**
|
|
10970
|
-
*
|
|
11010
|
+
* Get the remainder from integer division.
|
|
10971
11011
|
* @param {U16} other
|
|
10972
11012
|
* @returns {U16}
|
|
10973
11013
|
*/
|
|
@@ -10977,7 +11017,7 @@ class U16 {
|
|
|
10977
11017
|
return U16.__wrap(ret);
|
|
10978
11018
|
}
|
|
10979
11019
|
/**
|
|
10980
|
-
*
|
|
11020
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
10981
11021
|
* @param {U16} other
|
|
10982
11022
|
* @returns {U16}
|
|
10983
11023
|
*/
|
|
@@ -10987,7 +11027,7 @@ class U16 {
|
|
|
10987
11027
|
return U16.__wrap(ret);
|
|
10988
11028
|
}
|
|
10989
11029
|
/**
|
|
10990
|
-
* Convert to Scalar.
|
|
11030
|
+
* Convert the integer to a Scalar value.
|
|
10991
11031
|
* @returns {Scalar}
|
|
10992
11032
|
*/
|
|
10993
11033
|
toScalar() {
|
|
@@ -10995,7 +11035,7 @@ class U16 {
|
|
|
10995
11035
|
return Scalar.__wrap(ret);
|
|
10996
11036
|
}
|
|
10997
11037
|
/**
|
|
10998
|
-
* Convert to
|
|
11038
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
10999
11039
|
* @returns {Plaintext}
|
|
11000
11040
|
*/
|
|
11001
11041
|
toPlaintext() {
|
|
@@ -11003,7 +11043,7 @@ class U16 {
|
|
|
11003
11043
|
return Plaintext.__wrap(ret);
|
|
11004
11044
|
}
|
|
11005
11045
|
/**
|
|
11006
|
-
*
|
|
11046
|
+
* Attempt to construct the integer from a field element.
|
|
11007
11047
|
* @param {Field} field
|
|
11008
11048
|
* @returns {U16}
|
|
11009
11049
|
*/
|
|
@@ -11024,7 +11064,7 @@ class U16 {
|
|
|
11024
11064
|
}
|
|
11025
11065
|
}
|
|
11026
11066
|
/**
|
|
11027
|
-
*
|
|
11067
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
11028
11068
|
* @param {Array<any>} fields
|
|
11029
11069
|
* @returns {U16}
|
|
11030
11070
|
*/
|
|
@@ -11044,7 +11084,7 @@ class U16 {
|
|
|
11044
11084
|
}
|
|
11045
11085
|
}
|
|
11046
11086
|
/**
|
|
11047
|
-
* Clone.
|
|
11087
|
+
* Clone the integer in wasm memory.
|
|
11048
11088
|
* @returns {U16}
|
|
11049
11089
|
*/
|
|
11050
11090
|
clone() {
|
|
@@ -11079,7 +11119,7 @@ class U32 {
|
|
|
11079
11119
|
wasm.__wbg_u32_free(ptr, 0);
|
|
11080
11120
|
}
|
|
11081
11121
|
/**
|
|
11082
|
-
*
|
|
11122
|
+
* Construct an integer from a string representation.
|
|
11083
11123
|
* @param {string} s
|
|
11084
11124
|
* @returns {U32}
|
|
11085
11125
|
*/
|
|
@@ -11101,7 +11141,7 @@ class U32 {
|
|
|
11101
11141
|
}
|
|
11102
11142
|
}
|
|
11103
11143
|
/**
|
|
11104
|
-
*
|
|
11144
|
+
* Get the string representation of the integer.
|
|
11105
11145
|
* @returns {string}
|
|
11106
11146
|
*/
|
|
11107
11147
|
toString() {
|
|
@@ -11121,7 +11161,7 @@ class U32 {
|
|
|
11121
11161
|
}
|
|
11122
11162
|
}
|
|
11123
11163
|
/**
|
|
11124
|
-
*
|
|
11164
|
+
* Get the byte array representation of the integer.
|
|
11125
11165
|
* @param {Uint8Array} bytes
|
|
11126
11166
|
* @returns {U32}
|
|
11127
11167
|
*/
|
|
@@ -11142,7 +11182,7 @@ class U32 {
|
|
|
11142
11182
|
}
|
|
11143
11183
|
}
|
|
11144
11184
|
/**
|
|
11145
|
-
*
|
|
11185
|
+
* Construct an integer from a byte array representation.
|
|
11146
11186
|
* @returns {Uint8Array}
|
|
11147
11187
|
*/
|
|
11148
11188
|
toBytesLe() {
|
|
@@ -11161,7 +11201,7 @@ class U32 {
|
|
|
11161
11201
|
}
|
|
11162
11202
|
}
|
|
11163
11203
|
/**
|
|
11164
|
-
*
|
|
11204
|
+
* Construct an integer from a boolean array representation.
|
|
11165
11205
|
* @param {Array<any>} bits
|
|
11166
11206
|
* @returns {U32}
|
|
11167
11207
|
*/
|
|
@@ -11182,7 +11222,7 @@ class U32 {
|
|
|
11182
11222
|
}
|
|
11183
11223
|
}
|
|
11184
11224
|
/**
|
|
11185
|
-
*
|
|
11225
|
+
* Get the boolean array representation of the integer.
|
|
11186
11226
|
* @returns {Array<any>}
|
|
11187
11227
|
*/
|
|
11188
11228
|
toBitsLe() {
|
|
@@ -11206,7 +11246,7 @@ class U32 {
|
|
|
11206
11246
|
return U32.__wrap(ret);
|
|
11207
11247
|
}
|
|
11208
11248
|
/**
|
|
11209
|
-
* Wrapped addition.
|
|
11249
|
+
* Wrapped addition with another integer.
|
|
11210
11250
|
* @param {U32} other
|
|
11211
11251
|
* @returns {U32}
|
|
11212
11252
|
*/
|
|
@@ -11216,7 +11256,7 @@ class U32 {
|
|
|
11216
11256
|
return U32.__wrap(ret);
|
|
11217
11257
|
}
|
|
11218
11258
|
/**
|
|
11219
|
-
* Wrapped subtraction.
|
|
11259
|
+
* Wrapped subtraction with another integer.
|
|
11220
11260
|
* @param {U32} other
|
|
11221
11261
|
* @returns {U32}
|
|
11222
11262
|
*/
|
|
@@ -11226,7 +11266,7 @@ class U32 {
|
|
|
11226
11266
|
return U32.__wrap(ret);
|
|
11227
11267
|
}
|
|
11228
11268
|
/**
|
|
11229
|
-
* Wrapped multiplication.
|
|
11269
|
+
* Wrapped multiplication with another integer.
|
|
11230
11270
|
* @param {U32} other
|
|
11231
11271
|
* @returns {U32}
|
|
11232
11272
|
*/
|
|
@@ -11246,7 +11286,7 @@ class U32 {
|
|
|
11246
11286
|
return U32.__wrap(ret);
|
|
11247
11287
|
}
|
|
11248
11288
|
/**
|
|
11249
|
-
*
|
|
11289
|
+
* Exponentiate the integer with a u8 exponent.
|
|
11250
11290
|
* @param {U8} exponent
|
|
11251
11291
|
* @returns {U32}
|
|
11252
11292
|
*/
|
|
@@ -11256,7 +11296,7 @@ class U32 {
|
|
|
11256
11296
|
return U32.__wrap(ret);
|
|
11257
11297
|
}
|
|
11258
11298
|
/**
|
|
11259
|
-
*
|
|
11299
|
+
* Exponentiate the integer with a u16 exponent.
|
|
11260
11300
|
* @param {U16} exponent
|
|
11261
11301
|
* @returns {U32}
|
|
11262
11302
|
*/
|
|
@@ -11266,7 +11306,7 @@ class U32 {
|
|
|
11266
11306
|
return U32.__wrap(ret);
|
|
11267
11307
|
}
|
|
11268
11308
|
/**
|
|
11269
|
-
*
|
|
11309
|
+
* Exponentiate the integer with a u32 exponent.
|
|
11270
11310
|
* @param {U32} exponent
|
|
11271
11311
|
* @returns {U32}
|
|
11272
11312
|
*/
|
|
@@ -11276,7 +11316,7 @@ class U32 {
|
|
|
11276
11316
|
return U32.__wrap(ret);
|
|
11277
11317
|
}
|
|
11278
11318
|
/**
|
|
11279
|
-
*
|
|
11319
|
+
* Negate the integer (e.g., 5 → -5).
|
|
11280
11320
|
* @returns {U32}
|
|
11281
11321
|
*/
|
|
11282
11322
|
neg() {
|
|
@@ -11284,7 +11324,7 @@ class U32 {
|
|
|
11284
11324
|
return U32.__wrap(ret);
|
|
11285
11325
|
}
|
|
11286
11326
|
/**
|
|
11287
|
-
*
|
|
11327
|
+
* Check equality with another integer.
|
|
11288
11328
|
* @param {U32} other
|
|
11289
11329
|
* @returns {boolean}
|
|
11290
11330
|
*/
|
|
@@ -11294,7 +11334,7 @@ class U32 {
|
|
|
11294
11334
|
return ret !== 0;
|
|
11295
11335
|
}
|
|
11296
11336
|
/**
|
|
11297
|
-
*
|
|
11337
|
+
* Get the remainder from integer division.
|
|
11298
11338
|
* @param {U32} other
|
|
11299
11339
|
* @returns {U32}
|
|
11300
11340
|
*/
|
|
@@ -11304,7 +11344,7 @@ class U32 {
|
|
|
11304
11344
|
return U32.__wrap(ret);
|
|
11305
11345
|
}
|
|
11306
11346
|
/**
|
|
11307
|
-
*
|
|
11347
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
11308
11348
|
* @param {U32} other
|
|
11309
11349
|
* @returns {U32}
|
|
11310
11350
|
*/
|
|
@@ -11314,7 +11354,7 @@ class U32 {
|
|
|
11314
11354
|
return U32.__wrap(ret);
|
|
11315
11355
|
}
|
|
11316
11356
|
/**
|
|
11317
|
-
* Convert to Scalar.
|
|
11357
|
+
* Convert the integer to a Scalar value.
|
|
11318
11358
|
* @returns {Scalar}
|
|
11319
11359
|
*/
|
|
11320
11360
|
toScalar() {
|
|
@@ -11322,7 +11362,7 @@ class U32 {
|
|
|
11322
11362
|
return Scalar.__wrap(ret);
|
|
11323
11363
|
}
|
|
11324
11364
|
/**
|
|
11325
|
-
* Convert to
|
|
11365
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
11326
11366
|
* @returns {Plaintext}
|
|
11327
11367
|
*/
|
|
11328
11368
|
toPlaintext() {
|
|
@@ -11330,7 +11370,7 @@ class U32 {
|
|
|
11330
11370
|
return Plaintext.__wrap(ret);
|
|
11331
11371
|
}
|
|
11332
11372
|
/**
|
|
11333
|
-
*
|
|
11373
|
+
* Attempt to construct the integer from a field element.
|
|
11334
11374
|
* @param {Field} field
|
|
11335
11375
|
* @returns {U32}
|
|
11336
11376
|
*/
|
|
@@ -11351,7 +11391,7 @@ class U32 {
|
|
|
11351
11391
|
}
|
|
11352
11392
|
}
|
|
11353
11393
|
/**
|
|
11354
|
-
*
|
|
11394
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
11355
11395
|
* @param {Array<any>} fields
|
|
11356
11396
|
* @returns {U32}
|
|
11357
11397
|
*/
|
|
@@ -11371,7 +11411,7 @@ class U32 {
|
|
|
11371
11411
|
}
|
|
11372
11412
|
}
|
|
11373
11413
|
/**
|
|
11374
|
-
* Clone.
|
|
11414
|
+
* Clone the integer in wasm memory.
|
|
11375
11415
|
* @returns {U32}
|
|
11376
11416
|
*/
|
|
11377
11417
|
clone() {
|
|
@@ -11406,7 +11446,7 @@ class U64 {
|
|
|
11406
11446
|
wasm.__wbg_u64_free(ptr, 0);
|
|
11407
11447
|
}
|
|
11408
11448
|
/**
|
|
11409
|
-
*
|
|
11449
|
+
* Construct an integer from a string representation.
|
|
11410
11450
|
* @param {string} s
|
|
11411
11451
|
* @returns {U64}
|
|
11412
11452
|
*/
|
|
@@ -11428,7 +11468,7 @@ class U64 {
|
|
|
11428
11468
|
}
|
|
11429
11469
|
}
|
|
11430
11470
|
/**
|
|
11431
|
-
*
|
|
11471
|
+
* Get the string representation of the integer.
|
|
11432
11472
|
* @returns {string}
|
|
11433
11473
|
*/
|
|
11434
11474
|
toString() {
|
|
@@ -11448,7 +11488,7 @@ class U64 {
|
|
|
11448
11488
|
}
|
|
11449
11489
|
}
|
|
11450
11490
|
/**
|
|
11451
|
-
*
|
|
11491
|
+
* Get the byte array representation of the integer.
|
|
11452
11492
|
* @param {Uint8Array} bytes
|
|
11453
11493
|
* @returns {U64}
|
|
11454
11494
|
*/
|
|
@@ -11469,7 +11509,7 @@ class U64 {
|
|
|
11469
11509
|
}
|
|
11470
11510
|
}
|
|
11471
11511
|
/**
|
|
11472
|
-
*
|
|
11512
|
+
* Construct an integer from a byte array representation.
|
|
11473
11513
|
* @returns {Uint8Array}
|
|
11474
11514
|
*/
|
|
11475
11515
|
toBytesLe() {
|
|
@@ -11488,7 +11528,7 @@ class U64 {
|
|
|
11488
11528
|
}
|
|
11489
11529
|
}
|
|
11490
11530
|
/**
|
|
11491
|
-
*
|
|
11531
|
+
* Construct an integer from a boolean array representation.
|
|
11492
11532
|
* @param {Array<any>} bits
|
|
11493
11533
|
* @returns {U64}
|
|
11494
11534
|
*/
|
|
@@ -11509,7 +11549,7 @@ class U64 {
|
|
|
11509
11549
|
}
|
|
11510
11550
|
}
|
|
11511
11551
|
/**
|
|
11512
|
-
*
|
|
11552
|
+
* Get the boolean array representation of the integer.
|
|
11513
11553
|
* @returns {Array<any>}
|
|
11514
11554
|
*/
|
|
11515
11555
|
toBitsLe() {
|
|
@@ -11533,7 +11573,7 @@ class U64 {
|
|
|
11533
11573
|
return U64.__wrap(ret);
|
|
11534
11574
|
}
|
|
11535
11575
|
/**
|
|
11536
|
-
* Wrapped addition.
|
|
11576
|
+
* Wrapped addition with another integer.
|
|
11537
11577
|
* @param {U64} other
|
|
11538
11578
|
* @returns {U64}
|
|
11539
11579
|
*/
|
|
@@ -11543,7 +11583,7 @@ class U64 {
|
|
|
11543
11583
|
return U64.__wrap(ret);
|
|
11544
11584
|
}
|
|
11545
11585
|
/**
|
|
11546
|
-
* Wrapped subtraction.
|
|
11586
|
+
* Wrapped subtraction with another integer.
|
|
11547
11587
|
* @param {U64} other
|
|
11548
11588
|
* @returns {U64}
|
|
11549
11589
|
*/
|
|
@@ -11553,7 +11593,7 @@ class U64 {
|
|
|
11553
11593
|
return U64.__wrap(ret);
|
|
11554
11594
|
}
|
|
11555
11595
|
/**
|
|
11556
|
-
* Wrapped multiplication.
|
|
11596
|
+
* Wrapped multiplication with another integer.
|
|
11557
11597
|
* @param {U64} other
|
|
11558
11598
|
* @returns {U64}
|
|
11559
11599
|
*/
|
|
@@ -11573,7 +11613,7 @@ class U64 {
|
|
|
11573
11613
|
return U64.__wrap(ret);
|
|
11574
11614
|
}
|
|
11575
11615
|
/**
|
|
11576
|
-
*
|
|
11616
|
+
* Exponentiate the integer with a u8 exponent.
|
|
11577
11617
|
* @param {U8} exponent
|
|
11578
11618
|
* @returns {U64}
|
|
11579
11619
|
*/
|
|
@@ -11583,7 +11623,7 @@ class U64 {
|
|
|
11583
11623
|
return U64.__wrap(ret);
|
|
11584
11624
|
}
|
|
11585
11625
|
/**
|
|
11586
|
-
*
|
|
11626
|
+
* Exponentiate the integer with a u16 exponent.
|
|
11587
11627
|
* @param {U16} exponent
|
|
11588
11628
|
* @returns {U64}
|
|
11589
11629
|
*/
|
|
@@ -11593,7 +11633,7 @@ class U64 {
|
|
|
11593
11633
|
return U64.__wrap(ret);
|
|
11594
11634
|
}
|
|
11595
11635
|
/**
|
|
11596
|
-
*
|
|
11636
|
+
* Exponentiate the integer with a u32 exponent.
|
|
11597
11637
|
* @param {U32} exponent
|
|
11598
11638
|
* @returns {U64}
|
|
11599
11639
|
*/
|
|
@@ -11603,7 +11643,7 @@ class U64 {
|
|
|
11603
11643
|
return U64.__wrap(ret);
|
|
11604
11644
|
}
|
|
11605
11645
|
/**
|
|
11606
|
-
*
|
|
11646
|
+
* Negate the integer (e.g., 5 → -5).
|
|
11607
11647
|
* @returns {U64}
|
|
11608
11648
|
*/
|
|
11609
11649
|
neg() {
|
|
@@ -11611,7 +11651,7 @@ class U64 {
|
|
|
11611
11651
|
return U64.__wrap(ret);
|
|
11612
11652
|
}
|
|
11613
11653
|
/**
|
|
11614
|
-
*
|
|
11654
|
+
* Check equality with another integer.
|
|
11615
11655
|
* @param {U64} other
|
|
11616
11656
|
* @returns {boolean}
|
|
11617
11657
|
*/
|
|
@@ -11621,7 +11661,7 @@ class U64 {
|
|
|
11621
11661
|
return ret !== 0;
|
|
11622
11662
|
}
|
|
11623
11663
|
/**
|
|
11624
|
-
*
|
|
11664
|
+
* Get the remainder from integer division.
|
|
11625
11665
|
* @param {U64} other
|
|
11626
11666
|
* @returns {U64}
|
|
11627
11667
|
*/
|
|
@@ -11631,7 +11671,7 @@ class U64 {
|
|
|
11631
11671
|
return U64.__wrap(ret);
|
|
11632
11672
|
}
|
|
11633
11673
|
/**
|
|
11634
|
-
*
|
|
11674
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
11635
11675
|
* @param {U64} other
|
|
11636
11676
|
* @returns {U64}
|
|
11637
11677
|
*/
|
|
@@ -11641,7 +11681,7 @@ class U64 {
|
|
|
11641
11681
|
return U64.__wrap(ret);
|
|
11642
11682
|
}
|
|
11643
11683
|
/**
|
|
11644
|
-
* Convert to Scalar.
|
|
11684
|
+
* Convert the integer to a Scalar value.
|
|
11645
11685
|
* @returns {Scalar}
|
|
11646
11686
|
*/
|
|
11647
11687
|
toScalar() {
|
|
@@ -11649,7 +11689,7 @@ class U64 {
|
|
|
11649
11689
|
return Scalar.__wrap(ret);
|
|
11650
11690
|
}
|
|
11651
11691
|
/**
|
|
11652
|
-
* Convert to
|
|
11692
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
11653
11693
|
* @returns {Plaintext}
|
|
11654
11694
|
*/
|
|
11655
11695
|
toPlaintext() {
|
|
@@ -11657,7 +11697,7 @@ class U64 {
|
|
|
11657
11697
|
return Plaintext.__wrap(ret);
|
|
11658
11698
|
}
|
|
11659
11699
|
/**
|
|
11660
|
-
*
|
|
11700
|
+
* Attempt to construct the integer from a field element.
|
|
11661
11701
|
* @param {Field} field
|
|
11662
11702
|
* @returns {U64}
|
|
11663
11703
|
*/
|
|
@@ -11678,7 +11718,7 @@ class U64 {
|
|
|
11678
11718
|
}
|
|
11679
11719
|
}
|
|
11680
11720
|
/**
|
|
11681
|
-
*
|
|
11721
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
11682
11722
|
* @param {Array<any>} fields
|
|
11683
11723
|
* @returns {U64}
|
|
11684
11724
|
*/
|
|
@@ -11698,7 +11738,7 @@ class U64 {
|
|
|
11698
11738
|
}
|
|
11699
11739
|
}
|
|
11700
11740
|
/**
|
|
11701
|
-
* Clone.
|
|
11741
|
+
* Clone the integer in wasm memory.
|
|
11702
11742
|
* @returns {U64}
|
|
11703
11743
|
*/
|
|
11704
11744
|
clone() {
|
|
@@ -11733,7 +11773,7 @@ class U8 {
|
|
|
11733
11773
|
wasm.__wbg_u8_free(ptr, 0);
|
|
11734
11774
|
}
|
|
11735
11775
|
/**
|
|
11736
|
-
*
|
|
11776
|
+
* Construct an integer from a string representation.
|
|
11737
11777
|
* @param {string} s
|
|
11738
11778
|
* @returns {U8}
|
|
11739
11779
|
*/
|
|
@@ -11755,7 +11795,7 @@ class U8 {
|
|
|
11755
11795
|
}
|
|
11756
11796
|
}
|
|
11757
11797
|
/**
|
|
11758
|
-
*
|
|
11798
|
+
* Get the string representation of the integer.
|
|
11759
11799
|
* @returns {string}
|
|
11760
11800
|
*/
|
|
11761
11801
|
toString() {
|
|
@@ -11775,7 +11815,7 @@ class U8 {
|
|
|
11775
11815
|
}
|
|
11776
11816
|
}
|
|
11777
11817
|
/**
|
|
11778
|
-
*
|
|
11818
|
+
* Get the byte array representation of the integer.
|
|
11779
11819
|
* @param {Uint8Array} bytes
|
|
11780
11820
|
* @returns {U8}
|
|
11781
11821
|
*/
|
|
@@ -11796,7 +11836,7 @@ class U8 {
|
|
|
11796
11836
|
}
|
|
11797
11837
|
}
|
|
11798
11838
|
/**
|
|
11799
|
-
*
|
|
11839
|
+
* Construct an integer from a byte array representation.
|
|
11800
11840
|
* @returns {Uint8Array}
|
|
11801
11841
|
*/
|
|
11802
11842
|
toBytesLe() {
|
|
@@ -11815,7 +11855,7 @@ class U8 {
|
|
|
11815
11855
|
}
|
|
11816
11856
|
}
|
|
11817
11857
|
/**
|
|
11818
|
-
*
|
|
11858
|
+
* Construct an integer from a boolean array representation.
|
|
11819
11859
|
* @param {Array<any>} bits
|
|
11820
11860
|
* @returns {U8}
|
|
11821
11861
|
*/
|
|
@@ -11836,7 +11876,7 @@ class U8 {
|
|
|
11836
11876
|
}
|
|
11837
11877
|
}
|
|
11838
11878
|
/**
|
|
11839
|
-
*
|
|
11879
|
+
* Get the boolean array representation of the integer.
|
|
11840
11880
|
* @returns {Array<any>}
|
|
11841
11881
|
*/
|
|
11842
11882
|
toBitsLe() {
|
|
@@ -11860,7 +11900,7 @@ class U8 {
|
|
|
11860
11900
|
return U8.__wrap(ret);
|
|
11861
11901
|
}
|
|
11862
11902
|
/**
|
|
11863
|
-
* Wrapped addition.
|
|
11903
|
+
* Wrapped addition with another integer.
|
|
11864
11904
|
* @param {U8} other
|
|
11865
11905
|
* @returns {U8}
|
|
11866
11906
|
*/
|
|
@@ -11870,7 +11910,7 @@ class U8 {
|
|
|
11870
11910
|
return U8.__wrap(ret);
|
|
11871
11911
|
}
|
|
11872
11912
|
/**
|
|
11873
|
-
* Wrapped subtraction.
|
|
11913
|
+
* Wrapped subtraction with another integer.
|
|
11874
11914
|
* @param {U8} other
|
|
11875
11915
|
* @returns {U8}
|
|
11876
11916
|
*/
|
|
@@ -11880,7 +11920,7 @@ class U8 {
|
|
|
11880
11920
|
return U8.__wrap(ret);
|
|
11881
11921
|
}
|
|
11882
11922
|
/**
|
|
11883
|
-
* Wrapped multiplication.
|
|
11923
|
+
* Wrapped multiplication with another integer.
|
|
11884
11924
|
* @param {U8} other
|
|
11885
11925
|
* @returns {U8}
|
|
11886
11926
|
*/
|
|
@@ -11900,7 +11940,7 @@ class U8 {
|
|
|
11900
11940
|
return U8.__wrap(ret);
|
|
11901
11941
|
}
|
|
11902
11942
|
/**
|
|
11903
|
-
*
|
|
11943
|
+
* Exponentiate the integer with a u8 exponent.
|
|
11904
11944
|
* @param {U8} exponent
|
|
11905
11945
|
* @returns {U8}
|
|
11906
11946
|
*/
|
|
@@ -11910,7 +11950,7 @@ class U8 {
|
|
|
11910
11950
|
return U8.__wrap(ret);
|
|
11911
11951
|
}
|
|
11912
11952
|
/**
|
|
11913
|
-
*
|
|
11953
|
+
* Exponentiate the integer with a u16 exponent.
|
|
11914
11954
|
* @param {U16} exponent
|
|
11915
11955
|
* @returns {U8}
|
|
11916
11956
|
*/
|
|
@@ -11920,7 +11960,7 @@ class U8 {
|
|
|
11920
11960
|
return U8.__wrap(ret);
|
|
11921
11961
|
}
|
|
11922
11962
|
/**
|
|
11923
|
-
*
|
|
11963
|
+
* Exponentiate the integer with a u32 exponent.
|
|
11924
11964
|
* @param {U32} exponent
|
|
11925
11965
|
* @returns {U8}
|
|
11926
11966
|
*/
|
|
@@ -11930,7 +11970,7 @@ class U8 {
|
|
|
11930
11970
|
return U8.__wrap(ret);
|
|
11931
11971
|
}
|
|
11932
11972
|
/**
|
|
11933
|
-
*
|
|
11973
|
+
* Negate the integer (e.g., 5 → -5).
|
|
11934
11974
|
* @returns {U8}
|
|
11935
11975
|
*/
|
|
11936
11976
|
neg() {
|
|
@@ -11938,7 +11978,7 @@ class U8 {
|
|
|
11938
11978
|
return U8.__wrap(ret);
|
|
11939
11979
|
}
|
|
11940
11980
|
/**
|
|
11941
|
-
*
|
|
11981
|
+
* Check equality with another integer.
|
|
11942
11982
|
* @param {U8} other
|
|
11943
11983
|
* @returns {boolean}
|
|
11944
11984
|
*/
|
|
@@ -11948,7 +11988,7 @@ class U8 {
|
|
|
11948
11988
|
return ret !== 0;
|
|
11949
11989
|
}
|
|
11950
11990
|
/**
|
|
11951
|
-
*
|
|
11991
|
+
* Get the remainder from integer division.
|
|
11952
11992
|
* @param {U8} other
|
|
11953
11993
|
* @returns {U8}
|
|
11954
11994
|
*/
|
|
@@ -11958,7 +11998,7 @@ class U8 {
|
|
|
11958
11998
|
return U8.__wrap(ret);
|
|
11959
11999
|
}
|
|
11960
12000
|
/**
|
|
11961
|
-
*
|
|
12001
|
+
* Get the remainder from an integer division which wraps if there's an overflow.
|
|
11962
12002
|
* @param {U8} other
|
|
11963
12003
|
* @returns {U8}
|
|
11964
12004
|
*/
|
|
@@ -11968,7 +12008,7 @@ class U8 {
|
|
|
11968
12008
|
return U8.__wrap(ret);
|
|
11969
12009
|
}
|
|
11970
12010
|
/**
|
|
11971
|
-
* Convert to Scalar.
|
|
12011
|
+
* Convert the integer to a Scalar value.
|
|
11972
12012
|
* @returns {Scalar}
|
|
11973
12013
|
*/
|
|
11974
12014
|
toScalar() {
|
|
@@ -11976,7 +12016,7 @@ class U8 {
|
|
|
11976
12016
|
return Scalar.__wrap(ret);
|
|
11977
12017
|
}
|
|
11978
12018
|
/**
|
|
11979
|
-
* Convert to
|
|
12019
|
+
* Convert the integer to the Plaintext type. This must be done before hashing an integer to ensure it matches hashes with a leo/aleo program.
|
|
11980
12020
|
* @returns {Plaintext}
|
|
11981
12021
|
*/
|
|
11982
12022
|
toPlaintext() {
|
|
@@ -11984,7 +12024,7 @@ class U8 {
|
|
|
11984
12024
|
return Plaintext.__wrap(ret);
|
|
11985
12025
|
}
|
|
11986
12026
|
/**
|
|
11987
|
-
*
|
|
12027
|
+
* Attempt to construct the integer from a field element.
|
|
11988
12028
|
* @param {Field} field
|
|
11989
12029
|
* @returns {U8}
|
|
11990
12030
|
*/
|
|
@@ -12005,7 +12045,7 @@ class U8 {
|
|
|
12005
12045
|
}
|
|
12006
12046
|
}
|
|
12007
12047
|
/**
|
|
12008
|
-
*
|
|
12048
|
+
* Atttempt to construct the integer from a list of field elements.
|
|
12009
12049
|
* @param {Array<any>} fields
|
|
12010
12050
|
* @returns {U8}
|
|
12011
12051
|
*/
|
|
@@ -12025,7 +12065,7 @@ class U8 {
|
|
|
12025
12065
|
}
|
|
12026
12066
|
}
|
|
12027
12067
|
/**
|
|
12028
|
-
* Clone.
|
|
12068
|
+
* Clone the integer in wasm memory.
|
|
12029
12069
|
* @returns {U8}
|
|
12030
12070
|
*/
|
|
12031
12071
|
clone() {
|
|
@@ -12489,6 +12529,16 @@ class VerifyingKey {
|
|
|
12489
12529
|
wasm.__wbindgen_export_2(deferred1_0, deferred1_1, 1);
|
|
12490
12530
|
}
|
|
12491
12531
|
}
|
|
12532
|
+
/**
|
|
12533
|
+
* Get the number of constraints associated with the circuit
|
|
12534
|
+
*
|
|
12535
|
+
* @returns {number} The number of constraints
|
|
12536
|
+
* @returns {number}
|
|
12537
|
+
*/
|
|
12538
|
+
numConstraints() {
|
|
12539
|
+
const ret = wasm.verifyingkey_numConstraints(this.__wbg_ptr);
|
|
12540
|
+
return ret >>> 0;
|
|
12541
|
+
}
|
|
12492
12542
|
}
|
|
12493
12543
|
|
|
12494
12544
|
const ViewKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -12583,6 +12633,25 @@ class ViewKey {
|
|
|
12583
12633
|
const ret = wasm.field_clone(this.__wbg_ptr);
|
|
12584
12634
|
return Scalar.__wrap(ret);
|
|
12585
12635
|
}
|
|
12636
|
+
/**
|
|
12637
|
+
* Cast the view key to a field.
|
|
12638
|
+
* @returns {Field}
|
|
12639
|
+
*/
|
|
12640
|
+
toField() {
|
|
12641
|
+
try {
|
|
12642
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
12643
|
+
wasm.scalar_toField(retptr, this.__wbg_ptr);
|
|
12644
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
12645
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
12646
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
12647
|
+
if (r2) {
|
|
12648
|
+
throw takeObject(r1);
|
|
12649
|
+
}
|
|
12650
|
+
return Field.__wrap(r0);
|
|
12651
|
+
} finally {
|
|
12652
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
12653
|
+
}
|
|
12654
|
+
}
|
|
12586
12655
|
/**
|
|
12587
12656
|
* Decrypt a record ciphertext with a view key
|
|
12588
12657
|
*
|
|
@@ -12733,6 +12802,10 @@ function __wbg_get_imports() {
|
|
|
12733
12802
|
const ret = fetch(getObject(arg0));
|
|
12734
12803
|
return addHeapObject(ret);
|
|
12735
12804
|
};
|
|
12805
|
+
imports.wbg.__wbg_fetch_f1856afdb49415d1 = function(arg0) {
|
|
12806
|
+
const ret = fetch(getObject(arg0));
|
|
12807
|
+
return addHeapObject(ret);
|
|
12808
|
+
};
|
|
12736
12809
|
imports.wbg.__wbg_field_new = function(arg0) {
|
|
12737
12810
|
const ret = Field.__wrap(arg0);
|
|
12738
12811
|
return addHeapObject(ret);
|
|
@@ -12794,7 +12867,7 @@ function __wbg_get_imports() {
|
|
|
12794
12867
|
const ret = getObject(arg0).length;
|
|
12795
12868
|
return ret;
|
|
12796
12869
|
};
|
|
12797
|
-
imports.wbg.
|
|
12870
|
+
imports.wbg.__wbg_log_c1cb0361f1f1b380 = function(arg0, arg1) {
|
|
12798
12871
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
12799
12872
|
};
|
|
12800
12873
|
imports.wbg.__wbg_msCrypto_0a36e2ec3a343d26 = function(arg0) {
|
|
@@ -12812,7 +12885,7 @@ function __wbg_get_imports() {
|
|
|
12812
12885
|
const a = state0.a;
|
|
12813
12886
|
state0.a = 0;
|
|
12814
12887
|
try {
|
|
12815
|
-
return
|
|
12888
|
+
return __wbg_adapter_854(a, state0.b, arg0, arg1);
|
|
12816
12889
|
} finally {
|
|
12817
12890
|
state0.a = a;
|
|
12818
12891
|
}
|
|
@@ -13003,7 +13076,7 @@ function __wbg_get_imports() {
|
|
|
13003
13076
|
const ret = Signature.__wrap(arg0);
|
|
13004
13077
|
return addHeapObject(ret);
|
|
13005
13078
|
};
|
|
13006
|
-
imports.wbg.
|
|
13079
|
+
imports.wbg.__wbg_spawnWorker_5336e77275412fce = function(arg0, arg1, arg2, arg3) {
|
|
13007
13080
|
const ret = spawnWorker(getObject(arg0), getObject(arg1), getObject(arg2), arg3 >>> 0);
|
|
13008
13081
|
return addHeapObject(ret);
|
|
13009
13082
|
};
|
|
@@ -13123,16 +13196,16 @@ function __wbg_get_imports() {
|
|
|
13123
13196
|
const ret = false;
|
|
13124
13197
|
return ret;
|
|
13125
13198
|
};
|
|
13126
|
-
imports.wbg.
|
|
13127
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13199
|
+
imports.wbg.__wbindgen_closure_wrapper6649 = function(arg0, arg1, arg2) {
|
|
13200
|
+
const ret = makeMutClosure(arg0, arg1, 481, __wbg_adapter_40);
|
|
13128
13201
|
return addHeapObject(ret);
|
|
13129
13202
|
};
|
|
13130
|
-
imports.wbg.
|
|
13131
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13203
|
+
imports.wbg.__wbindgen_closure_wrapper7241 = function(arg0, arg1, arg2) {
|
|
13204
|
+
const ret = makeMutClosure(arg0, arg1, 481, __wbg_adapter_43);
|
|
13132
13205
|
return addHeapObject(ret);
|
|
13133
13206
|
};
|
|
13134
|
-
imports.wbg.
|
|
13135
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
13207
|
+
imports.wbg.__wbindgen_closure_wrapper7245 = function(arg0, arg1, arg2) {
|
|
13208
|
+
const ret = makeMutClosure(arg0, arg1, 481, __wbg_adapter_43);
|
|
13136
13209
|
return addHeapObject(ret);
|
|
13137
13210
|
};
|
|
13138
13211
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|