@@ -31,13 +31,11 @@ pub trait GLVConfig: Send + Sync + 'static + SWCurveConfig {
31
31
) -> ( ( bool , Self :: ScalarField ) , ( bool , Self :: ScalarField ) ) {
32
32
let scalar: BigInt = k. into_bigint ( ) . into ( ) . into ( ) ;
33
33
34
- let coeff_bigints : [ BigInt ; 4 ] = Self :: SCALAR_DECOMP_COEFFS . map ( |x| {
34
+ let [ n11 , n12 , n21 , n22 ] = Self :: SCALAR_DECOMP_COEFFS . map ( |x| {
35
35
let sign = if x. 0 { Sign :: Plus } else { Sign :: Minus } ;
36
36
BigInt :: from_biguint ( sign, x. 1 . into ( ) )
37
37
} ) ;
38
38
39
- let [ n11, n12, n21, n22] = coeff_bigints;
40
-
41
39
let r = BigInt :: from ( Self :: ScalarField :: MODULUS . into ( ) ) ;
42
40
43
41
// beta = vector([k,0]) * self.curve.N_inv
@@ -81,8 +79,8 @@ pub trait GLVConfig: Send + Sync + 'static + SWCurveConfig {
81
79
let k2_abs = BigUint :: try_from ( k2. abs ( ) ) . unwrap ( ) ;
82
80
83
81
(
84
- ( k1. sign ( ) == Sign :: Plus , Self :: ScalarField :: from ( k1_abs) ) ,
85
- ( k2. sign ( ) == Sign :: Plus , Self :: ScalarField :: from ( k2_abs) ) ,
82
+ ( k1. sign ( ) == Sign :: Plus , k1_abs. into ( ) ) ,
83
+ ( k2. sign ( ) == Sign :: Plus , k2_abs. into ( ) ) ,
86
84
)
87
85
}
88
86
0 commit comments