From bdf5aa5713f9ad77e1821c62bb403b03690b0d3d Mon Sep 17 00:00:00 2001 From: Dimitris Apostolou Date: Wed, 28 Feb 2024 11:18:21 +0200 Subject: [PATCH] fix: fix typos (#140) --- script/bn256.py | 2 +- src/bn256/fq2.rs | 2 +- src/ff_ext/jacobi.rs | 2 +- src/pluto_eris/fields/fp2.rs | 2 +- src/pluto_eris/mod.rs | 2 +- src/secp256k1/fp.rs | 2 +- src/secp256r1/fp.rs | 2 +- src/secp256r1/fq.rs | 2 +- src/tests/field.rs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/script/bn256.py b/script/bn256.py index a67fe542..a13dce6d 100644 --- a/script/bn256.py +++ b/script/bn256.py @@ -1,4 +1,4 @@ -# This file generates the montogomary form integers for x in [0, 2^16) \intersect +# This file generates the montgomery form integers for x in [0, 2^16) \intersect # BN::ScalarField verbose = False diff --git a/src/bn256/fq2.rs b/src/bn256/fq2.rs index d5f25fca..96e2f000 100644 --- a/src/bn256/fq2.rs +++ b/src/bn256/fq2.rs @@ -242,7 +242,7 @@ impl Fq2 { } } - // conjucate by negating c1 + // conjugate by negating c1 pub fn conjugate(&mut self) { self.c1 = -self.c1; } diff --git a/src/ff_ext/jacobi.rs b/src/ff_ext/jacobi.rs index c7296f59..519e702c 100644 --- a/src/ff_ext/jacobi.rs +++ b/src/ff_ext/jacobi.rs @@ -329,7 +329,7 @@ fn jacobinary(mut n: u64, mut d: u64, mut t: u64) -> i64 { /// - M. Hamburg, "Computing the Jacobi symbol using Bernstein-Yang", /// https://eprint.iacr.org/2021/1271.pdf pub fn jacobi(n: &[u64], d: &[u64]) -> i64 { - // Instead of the variable "j" taking the values from {-1, 1} and satysfying + // Instead of the variable "j" taking the values from {-1, 1} and satisfying // at the end of the outer loop iteration the equation J = "j" * ("n" / |"d"|) // for the modified Jacobi symbol ("n" / |"d"|) and the sought Jacobi symbol J, // we store the sign bit of "j" in the second-lowest bit of "t" for optimization diff --git a/src/pluto_eris/fields/fp2.rs b/src/pluto_eris/fields/fp2.rs index 9b455480..9bb68782 100644 --- a/src/pluto_eris/fields/fp2.rs +++ b/src/pluto_eris/fields/fp2.rs @@ -318,7 +318,7 @@ impl Fp2 { /// Norm of Fp2 as extension field in u over Fp fn norm(&self) -> Fp { - // norm = self * self.cojungate() + // norm = self * self.conjugate() let t0 = self.c0.square(); let t1 = self.c1.square() * U_SQUARE; t1 - t0 diff --git a/src/pluto_eris/mod.rs b/src/pluto_eris/mod.rs index fd5c0aac..72118ca3 100644 --- a/src/pluto_eris/mod.rs +++ b/src/pluto_eris/mod.rs @@ -1,4 +1,4 @@ -//! # `Pluto\Eris half-pairing ccyle` +//! # `Pluto\Eris half-pairing cycle` //! //! Implementation of the Pluto / Eris half-pairing cycle of prime order elliptic curves. //! diff --git a/src/secp256k1/fp.rs b/src/secp256k1/fp.rs index bf7ffc5a..415017fa 100644 --- a/src/secp256k1/fp.rs +++ b/src/secp256k1/fp.rs @@ -52,7 +52,7 @@ const MODULUS_LIMBS_32: [u32; 8] = [ 0xffff_ffff, ]; -/// Constant representing the modolus as static str +/// Constant representing the modulus as static str const MODULUS_STR: &str = "0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"; /// INV = -(p^{-1} mod 2^64) mod 2^64 diff --git a/src/secp256r1/fp.rs b/src/secp256r1/fp.rs index 31005371..bce80808 100644 --- a/src/secp256r1/fp.rs +++ b/src/secp256r1/fp.rs @@ -52,7 +52,7 @@ const MODULUS_LIMBS_32: [u32; 8] = [ 0xffff_ffff, ]; -/// Constant representing the modolus as static str +/// Constant representing the modulus as static str const MODULUS_STR: &str = "0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"; /// INV = -(p^{-1} mod 2^64) mod 2^64 diff --git a/src/secp256r1/fq.rs b/src/secp256r1/fq.rs index 63a0d0a6..c6f1dd86 100644 --- a/src/secp256r1/fq.rs +++ b/src/secp256r1/fq.rs @@ -251,7 +251,7 @@ impl ff::PrimeField for Fq { // of 0xffff...ffff. Otherwise, it'll be zero. let is_some = (borrow as u8) & 1; - // Convert to Montgomery form by computi + // Convert to Montgomery form by computing // (a.R^0 * R^2) / R = a.R tmp *= &R2; diff --git a/src/tests/field.rs b/src/tests/field.rs index cd0f79fb..95c91ed2 100644 --- a/src/tests/field.rs +++ b/src/tests/field.rs @@ -103,7 +103,7 @@ macro_rules! field_testing_suite { for _ in 0..n { let mut a = F::random(&mut rng); - let b = a.invert().unwrap(); // probablistically nonzero + let b = a.invert().unwrap(); // probabilistically nonzero a.mul_assign(&b); assert_eq!(a, F::ONE);