Skip to content

Commit

Permalink
fix: typos in curve.rs (#128)
Browse files Browse the repository at this point in the history
* fix: typos in curve.rs

* fix: typos in src/
  • Loading branch information
Thabokani authored Jan 16, 2024
1 parent e4185d6 commit c1745de
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/bn256/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ impl G2Prepared {

r.y -= &tmp2;

// up to here everything was by algorith, line 11
// up to here everything was by algorithm, line 11
// use R instead of new T

// tmp3 is the first part of line 12
Expand Down
4 changes: 2 additions & 2 deletions src/derive/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ macro_rules! new_curve_impl {
}

fn jacobian_coordinates(&self) -> ($base, $base, $base) {
// Homogenous to Jacobian
// Homogeneous to Jacobian
let x = self.x * self.z;
let y = self.y * self.z.square();
(x, y, self.z)
Expand Down Expand Up @@ -563,7 +563,7 @@ macro_rules! new_curve_impl {
}

fn new_jacobian(x: Self::Base, y: Self::Base, z: Self::Base) -> CtOption<Self> {
// Jacobian to homogenous
// Jacobian to homogeneous
let z_inv = z.invert().unwrap_or($base::zero());
let p_x = x * z_inv;
let p_y = y * z_inv.square();
Expand Down
2 changes: 1 addition & 1 deletion src/derive/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ macro_rules! field_common {
#[cfg(feature = "asm")]
const fn montgomery_form(val: [u64; 4], r: $field) -> $field {
// Converts a 4 64-bit limb value into its congruent field representation.
// If `val` representes a 256 bit value then `r` should be R^2,
// If `val` represents a 256 bit value then `r` should be R^2,
// if `val` represents the 256 MSB of a 512 bit value, then `r` should be R^3.

let (r0, carry) = mac(0, val[0], r.0[0], 0);
Expand Down
2 changes: 1 addition & 1 deletion src/ff_ext/jacobi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ pub fn jacobi<const L: usize>(n: &[u64], d: &[u64]) -> i64 {
// When each "approximation" variable has the same value as the corresponding "precise"
// one, the computation is accomplished using the short-arithmetic method of the Jacobi
// symbol calculation by means of the binary Euclidean algorithm. This approach aims at
// avoiding the parts of the final computations, which are related to long arithmetics
// avoiding the parts of the final computations, which are related to long arithmetic
if precise {
return jacobinary(a, b, t);
}
Expand Down
2 changes: 1 addition & 1 deletion src/msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ mod test {
}
}

// keeping older implementation it here for baseline comparision, debugging & benchmarking
// keeping older implementation it here for baseline comparison, debugging & benchmarking
fn multiexp_serial<C: CurveAffine>(coeffs: &[C::Scalar], bases: &[C], acc: &mut C::Curve) {
let coeffs: Vec<_> = coeffs.iter().map(|a| a.to_repr()).collect();

Expand Down
2 changes: 1 addition & 1 deletion src/pluto_eris/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl G2Prepared {

r.y -= &tmp2;

// up to here everything was by algorith, line 11
// up to here everything was by algorithm, line 11
// use R instead of new T

// tmp3 is the first part of line 12
Expand Down

0 comments on commit c1745de

Please sign in to comment.