Skip to content

Commit

Permalink
Move all BASEPOINT_ORDER use private internally
Browse files Browse the repository at this point in the history
  • Loading branch information
pinkforest committed Sep 12, 2023
1 parent 0218b77 commit ebb0192
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions curve25519-dalek/src/edwards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,7 @@ impl EdwardsPoint {
/// assert_eq!((P+Q).is_torsion_free(), false);
/// ```
pub fn is_torsion_free(&self) -> bool {
(self * constants::BASEPOINT_ORDER).is_identity()
(self * constants::BASEPOINT_ORDER_PRIVATE).is_identity()
}
}

Expand Down Expand Up @@ -1580,7 +1580,7 @@ impl CofactorGroup for EdwardsPoint {
}

fn is_torsion_free(&self) -> Choice {
(self * constants::BASEPOINT_ORDER).ct_eq(&Self::identity())
(self * constants::BASEPOINT_ORDER_PRIVATE).ct_eq(&Self::identity())
}
}

Expand Down Expand Up @@ -1769,7 +1769,7 @@ mod test {
/// Test that multiplication by the basepoint order kills the basepoint
#[test]
fn basepoint_mult_by_basepoint_order() {
let should_be_id = EdwardsPoint::mul_base(&constants::BASEPOINT_ORDER);
let should_be_id = EdwardsPoint::mul_base(&constants::BASEPOINT_ORDER_PRIVATE);
assert!(should_be_id.is_identity());
}

Expand Down

0 comments on commit ebb0192

Please sign in to comment.