Skip to content

Commit

Permalink
Rename mult_by_cofactor to mul_by_cofactor for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
hdevalence committed Mar 22, 2018
1 parent 8de3d75 commit 296cd16
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/edwards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
//! To test if a point is in \\( \mathcal E[\ell] \\), use
//! `EdwardsPoint::is_torsion_free()`.
//!
//! To multiply by the cofactor, use `EdwardsPoint::mult_by_cofactor()`.
//! To multiply by the cofactor, use `EdwardsPoint::mul_by_cofactor()`.
//!
//! To avoid dealing with cofactors entirely, consider using Ristretto.
//!
Expand Down Expand Up @@ -751,7 +751,7 @@ impl EdwardsBasepointTable {

impl EdwardsPoint {
/// Multiply by the cofactor: return \\([8]P\\).
pub fn mult_by_cofactor(&self) -> EdwardsPoint {
pub fn mul_by_cofactor(&self) -> EdwardsPoint {
self.mul_by_pow_2(3)
}

Expand Down Expand Up @@ -791,7 +791,7 @@ impl EdwardsPoint {
/// assert_eq!(Q.is_small_order(), true);
/// ```
pub fn is_small_order(&self) -> bool {
self.mult_by_cofactor().is_identity()
self.mul_by_cofactor().is_identity()
}

/// Determine if this point is “torsion-free”, i.e., is contained in
Expand Down Expand Up @@ -1503,10 +1503,10 @@ mod bench {
}

#[bench]
fn mult_by_cofactor(b: &mut Bencher) {
fn mul_by_cofactor(b: &mut Bencher) {
let p1 = constants::ED25519_BASEPOINT_POINT;

b.iter(|| p1.mult_by_cofactor());
b.iter(|| p1.mul_by_cofactor());
}

#[bench]
Expand Down

0 comments on commit 296cd16

Please sign in to comment.