Skip to content

Commit

Permalink
if greatest is selected, second coordinate should be picked (#495)
Browse files Browse the repository at this point in the history
Co-authored-by: Pratyush Mishra <[email protected]>
  • Loading branch information
mmagician and Pratyush authored Oct 16, 2022
1 parent ec6fc4d commit 09d3102
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ec/src/models/short_weierstrass/affine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ impl<P: SWCurveConfig> Affine<P> {
/// largest y-coordinate be selected.
#[allow(dead_code)]
pub fn get_point_from_x_unchecked(x: P::BaseField, greatest: bool) -> Option<Self> {
Self::get_ys_from_x_unchecked(x).map(|(y, neg_y)| {
Self::get_ys_from_x_unchecked(x).map(|(smaller, larger)| {
if greatest {
Self::new_unchecked(x, y)
Self::new_unchecked(x, larger)
} else {
Self::new_unchecked(x, neg_y)
Self::new_unchecked(x, smaller)
}
})
}
Expand Down

0 comments on commit 09d3102

Please sign in to comment.