File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -86,25 +86,23 @@ pub trait AffinePoint<const N: usize>: Clone + Sized {
8686 /// a_bits_le and b_bits_le should be in little endian order.
8787 fn multi_scalar_multiplication (
8888 a_bits_le : & [ bool ] ,
89- a : Self ,
89+ mut a : Self ,
9090 b_bits_le : & [ bool ] ,
91- b : Self ,
91+ mut b : Self ,
9292 ) -> Self {
9393 // The length of the bit vectors must be the same.
9494 debug_assert ! ( a_bits_le. len( ) == b_bits_le. len( ) ) ;
9595
9696 let mut res: Self = Self :: identity ( ) ;
97- let mut temp_a = a. clone ( ) ;
98- let mut temp_b = b. clone ( ) ;
9997 for ( a_bit, b_bit) in a_bits_le. iter ( ) . zip ( b_bits_le. iter ( ) ) {
10098 if * a_bit {
101- res. complete_add_assign ( & temp_a ) ;
99+ res. complete_add_assign ( & a ) ;
102100 }
103101 if * b_bit {
104- res. complete_add_assign ( & temp_b ) ;
102+ res. complete_add_assign ( & b ) ;
105103 }
106- temp_a . double ( ) ;
107- temp_b . double ( ) ;
104+ a . double ( ) ;
105+ b . double ( ) ;
108106 }
109107 res
110108 }
You can’t perform that action at this time.
0 commit comments