File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -843,7 +843,7 @@ impl Scalar {
843
843
844
844
let carry = scalar. shr1_assign ( ) ;
845
845
debug_assert_eq ! ( carry, 0 ) ;
846
-
846
+
847
847
scalar. pack ( )
848
848
}
849
849
@@ -1698,18 +1698,16 @@ pub(crate) mod test {
1698
1698
// test a range of small scalars
1699
1699
for i in 0u64 ..32 {
1700
1700
let scalar = Scalar :: from ( i) ;
1701
- let double = scalar + scalar;
1702
- let dividend = double. div_by_2 ( ) ;
1703
- assert_eq ! ( scalar, dividend) ;
1701
+ let dividend = scalar. div_by_2 ( ) ;
1702
+ assert_eq ! ( scalar, dividend + dividend) ;
1704
1703
}
1705
1704
1706
- // test odd value near the order
1707
- let scalar = Scalar :: ZERO - Scalar :: from ( 2u64 ) ;
1708
- #[ cfg( feature = "group" ) ]
1709
- assert ! ( bool :: from( scalar. is_odd( ) ) ) ;
1710
-
1711
- let dividend = scalar. div_by_2 ( ) ;
1712
- assert_eq ! ( scalar, dividend + dividend) ;
1705
+ // test a range of scalars near the modulus
1706
+ for i in 0u64 ..32 {
1707
+ let scalar = Scalar :: ZERO - Scalar :: from ( i) ;
1708
+ let dividend = scalar. div_by_2 ( ) ;
1709
+ assert_eq ! ( scalar, dividend + dividend) ;
1710
+ }
1713
1711
}
1714
1712
1715
1713
#[ test]
You can’t perform that action at this time.
0 commit comments