@@ -19,26 +19,26 @@ pub fn double_in_place(
1919 r : & mut ark_bn254:: G2Projective ,
2020) -> ( ark_bn254:: Fq2 , ark_bn254:: Fq2 , ark_bn254:: Fq2 ) {
2121 let half = ark_bn254:: Fq :: from ( Fq :: half_modulus ( ) ) ;
22- let mut a = r. x * & r. y ;
22+ let mut a = r. x * r. y ;
2323 a. mul_assign_by_fp ( & half) ;
2424 let b = r. y . square ( ) ;
2525 let c = r. z . square ( ) ;
26- let e = ark_bn254:: g2:: Config :: COEFF_B * & ( c. double ( ) + & c) ;
27- let f = e. double ( ) + & e;
28- let mut g = b + & f;
26+ let e = ark_bn254:: g2:: Config :: COEFF_B * ( c. double ( ) + c) ;
27+ let f = e. double ( ) + e;
28+ let mut g = b + f;
2929 g. mul_assign_by_fp ( & half) ;
30- let h = ( r. y + & r. z ) . square ( ) - & ( b + & c) ;
31- let i = e - & b;
30+ let h = ( r. y + r. z ) . square ( ) - ( b + c) ;
31+ let i = e - b;
3232 let j = r. x . square ( ) ;
3333 let e_square = e. square ( ) ;
3434
3535 let new_r = ark_bn254:: G2Projective {
36- x : a * & ( b - & f) ,
37- y : g. square ( ) - & ( e_square. double ( ) + & e_square) ,
38- z : b * & h,
36+ x : a * ( b - f) ,
37+ y : g. square ( ) - ( e_square. double ( ) + e_square) ,
38+ z : b * h,
3939 } ;
4040 * r = new_r;
41- ( -h, j. double ( ) + & j, i)
41+ ( -h, j. double ( ) + j, i)
4242}
4343
4444pub fn double_in_place2 (
@@ -48,25 +48,25 @@ pub fn double_in_place2(
4848 ( ark_bn254:: Fq2 , ark_bn254:: Fq2 , ark_bn254:: Fq2 ) ,
4949) {
5050 let half = ark_bn254:: Fq :: from ( Fq :: half_modulus ( ) ) ;
51- let mut a = r. x * & r. y ;
51+ let mut a = r. x * r. y ;
5252 a. mul_assign_by_fp ( & half) ;
5353 let b = r. y . square ( ) ;
5454 let c = r. z . square ( ) ;
55- let e = ark_bn254:: g2:: Config :: COEFF_B * & ( c. double ( ) + & c) ;
56- let f = e. double ( ) + & e;
57- let mut g = b + & f;
55+ let e = ark_bn254:: g2:: Config :: COEFF_B * ( c. double ( ) + c) ;
56+ let f = e. double ( ) + e;
57+ let mut g = b + f;
5858 g. mul_assign_by_fp ( & half) ;
59- let h = ( r. y + & r. z ) . square ( ) - & ( b + & c) ;
60- let i = e - & b;
59+ let h = ( r. y + r. z ) . square ( ) - ( b + c) ;
60+ let i = e - b;
6161 let j = r. x . square ( ) ;
6262 let e_square = e. square ( ) ;
6363
6464 let new_r = ark_bn254:: G2Projective {
65- x : a * & ( b - & f) ,
66- y : g. square ( ) - & ( e_square. double ( ) + & e_square) ,
67- z : b * & h,
65+ x : a * ( b - f) ,
66+ y : g. square ( ) - ( e_square. double ( ) + e_square) ,
67+ z : b * h,
6868 } ;
69- ( new_r, ( -h, j. double ( ) + & j, i) )
69+ ( new_r, ( -h, j. double ( ) + j, i) )
7070}
7171
7272pub fn double_in_place_circuit ( r : Wires ) -> Circuit {
@@ -131,20 +131,20 @@ pub fn add_in_place(
131131 r : & mut ark_bn254:: G2Projective ,
132132 q : & ark_bn254:: G2Affine ,
133133) -> ( ark_bn254:: Fq2 , ark_bn254:: Fq2 , ark_bn254:: Fq2 ) {
134- let theta = r. y - & ( q. y * & r. z ) ;
135- let lambda = r. x - & ( q. x * & r. z ) ;
134+ let theta = r. y - ( q. y * r. z ) ;
135+ let lambda = r. x - ( q. x * r. z ) ;
136136 let c = theta. square ( ) ;
137137 let d = lambda. square ( ) ;
138- let e = lambda * & d;
139- let f = r. z * & c;
140- let g = r. x * & d;
141- let h = e + & f - & g. double ( ) ;
142- let j = theta * & q. x - & ( lambda * & q. y ) ;
138+ let e = lambda * d;
139+ let f = r. z * c;
140+ let g = r. x * d;
141+ let h = e + f - g. double ( ) ;
142+ let j = theta * q. x - ( lambda * q. y ) ;
143143
144144 let new_r = ark_bn254:: G2Projective {
145- x : lambda * & h,
146- y : theta * & ( g - & h) - & ( e * & r. y ) ,
147- z : r. z * & e,
145+ x : lambda * h,
146+ y : theta * ( g - h) - ( e * r. y ) ,
147+ z : r. z * e,
148148 } ;
149149 * r = new_r;
150150
@@ -158,20 +158,20 @@ pub fn add_in_place2(
158158 ark_bn254:: G2Projective ,
159159 ( ark_bn254:: Fq2 , ark_bn254:: Fq2 , ark_bn254:: Fq2 ) ,
160160) {
161- let theta = r. y - & ( q. y * & r. z ) ;
162- let lambda = r. x - & ( q. x * & r. z ) ;
161+ let theta = r. y - ( q. y * r. z ) ;
162+ let lambda = r. x - ( q. x * r. z ) ;
163163 let c = theta. square ( ) ;
164164 let d = lambda. square ( ) ;
165- let e = lambda * & d;
166- let f = r. z * & c;
167- let g = r. x * & d;
168- let h = e + & f - & g. double ( ) ;
169- let j = theta * & q. x - & ( lambda * & q. y ) ;
165+ let e = lambda * d;
166+ let f = r. z * c;
167+ let g = r. x * d;
168+ let h = e + f - g. double ( ) ;
169+ let j = theta * q. x - ( lambda * q. y ) ;
170170
171171 let new_r = ark_bn254:: G2Projective {
172- x : lambda * & h,
173- y : theta * & ( g - & h) - & ( e * & r. y ) ,
174- z : r. z * & e,
172+ x : lambda * h,
173+ y : theta * ( g - h) - ( e * r. y ) ,
174+ z : r. z * e,
175175 } ;
176176
177177 ( new_r, ( lambda, -theta, j) )
@@ -1044,7 +1044,7 @@ mod tests {
10441044 let c1 = fq2_from_wires ( circuit. 0 [ Fq2 :: N_BITS ..2 * Fq2 :: N_BITS ] . to_vec ( ) ) ;
10451045 let c2 = fq2_from_wires ( circuit. 0 [ 2 * Fq2 :: N_BITS ..3 * Fq2 :: N_BITS ] . to_vec ( ) ) ;
10461046 let new_r_x = fq2_from_wires (
1047- circuit. 0 [ 3 * Fq2 :: N_BITS + 0 * Fq2 :: N_BITS ..3 * Fq2 :: N_BITS + Fq2 :: N_BITS ]
1047+ circuit. 0 [ 3 * Fq2 :: N_BITS ..3 * Fq2 :: N_BITS + Fq2 :: N_BITS ]
10481048 . to_vec ( ) ,
10491049 ) ;
10501050 let new_r_y = fq2_from_wires (
0 commit comments