File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
curve25519-dalek/src/lizard Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 33use digest:: {
44 Digest , HashMarker ,
55 array:: Array ,
6- consts:: { U16 , U32 } ,
6+ consts:: { U8 , U16 , U32 } ,
77} ;
88use subtle:: CtOption ;
99
@@ -95,14 +95,15 @@ impl RistrettoPoint {
9595 let jcs = self . to_jacobi_quartic_ristretto ( ) ;
9696
9797 // Compute the positive solution to e⁻¹ on every point and its dual
98- let pos_invs = jcs
99- . iter ( )
100- . flat_map ( |jc| [ jc. e_inv_positive ( ) , jc. dual ( ) . e_inv_positive ( ) ] ) ;
98+ let pos_invs = Array :: < _ , U8 > :: from_iter (
99+ jcs. iter ( )
100+ . flat_map ( |jc| [ jc. e_inv_positive ( ) , jc. dual ( ) . e_inv_positive ( ) ] ) ,
101+ ) ;
101102 // Compute the other solutions to e⁻¹, ie the negatives of the above solutions
102- let neg_invs = pos_invs. clone ( ) . map ( |mx| mx. map ( |x| -& x) ) ;
103+ let neg_invs = pos_invs. iter ( ) . map ( |mx| mx. map ( |x| -& x) ) ;
103104 // This cannot panic because jcs is guaranteed to be size 4, and the above iterator expands
104105 // it to size 8
105- Array :: < _ , U16 > :: from_iter ( pos_invs. chain ( neg_invs) ) . 0
106+ Array :: < _ , U16 > :: from_iter ( pos_invs. into_iter ( ) . chain ( neg_invs) ) . 0
106107 }
107108
108109 /// Find a point on the Jacobi quartic associated to each of the four
You can’t perform that action at this time.
0 commit comments