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
118
118
}
119
119
let mut y_bytes = bytes. to_vec ( ) ;
120
120
// 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 ;
122
122
y_bytes[ Coordinate :: < C > :: NUM_LIMBS - 1 ] &= 0b01111111 ;
123
123
// from_le_bytes checks that y is reduced
124
124
let y = Coordinate :: < C > :: from_le_bytes ( & y_bytes) ?;
@@ -136,6 +136,7 @@ where
136
136
{
137
137
let mut y_bytes = p. y ( ) . as_le_bytes ( ) . to_vec ( ) ;
138
138
if p. x ( ) . as_le_bytes ( ) [ 0 ] & 1u8 == 1 {
139
+ debug_assert ! ( y_bytes[ Coordinate :: <C >:: NUM_LIMBS - 1 ] & 0b10000000 == 0 ) ;
139
140
y_bytes[ Coordinate :: < C > :: NUM_LIMBS - 1 ] |= 0b10000000 ;
140
141
}
141
142
y_bytes
You can’t perform that action at this time.
0 commit comments