File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ where
118118 }
119119 let mut y_bytes = bytes. to_vec ( ) ;
120120 // most significant bit stores the parity of the x-coordinate
121- let rec_id = y_bytes[ Coordinate :: < C > :: NUM_LIMBS - 1 ] & 0b10000000 ;
121+ let rec_id = ( y_bytes[ Coordinate :: < C > :: NUM_LIMBS - 1 ] & 0b10000000 ) >> 7 ;
122122 y_bytes[ Coordinate :: < C > :: NUM_LIMBS - 1 ] &= 0b01111111 ;
123123 // from_le_bytes checks that y is reduced
124124 let y = Coordinate :: < C > :: from_le_bytes ( & y_bytes) ?;
@@ -136,6 +136,7 @@ where
136136{
137137 let mut y_bytes = p. y ( ) . as_le_bytes ( ) . to_vec ( ) ;
138138 if p. x ( ) . as_le_bytes ( ) [ 0 ] & 1u8 == 1 {
139+ debug_assert ! ( y_bytes[ Coordinate :: <C >:: NUM_LIMBS - 1 ] & 0b10000000 == 0 ) ;
139140 y_bytes[ Coordinate :: < C > :: NUM_LIMBS - 1 ] |= 0b10000000 ;
140141 }
141142 y_bytes
You can’t perform that action at this time.
0 commit comments