From 2b350118b0c51dab5aed48e218d1ffeceb44f1ff Mon Sep 17 00:00:00 2001 From: str4d Date: Tue, 21 Sep 2021 10:44:07 +1200 Subject: [PATCH] Fix naming of Tonelli-Shanks Co-authored-by: Daira Hopwood --- src/arithmetic/fields.rs | 4 ++-- src/fields/fp.rs | 2 +- src/fields/fq.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/arithmetic/fields.rs b/src/arithmetic/fields.rs index d755c9d..53554fc 100644 --- a/src/arithmetic/fields.rs +++ b/src/arithmetic/fields.rs @@ -138,13 +138,13 @@ pub trait FieldExt: ff::PrimeField + From + Ord + Group { } } -/// Tonelli-Shank's square-root algorithm for `p mod 16 = 1`. +/// Tonelli–Shanks' square-root algorithm for `p mod 16 = 1`. /// /// https://eprint.iacr.org/2012/685.pdf (page 12, algorithm 5) /// /// `tm1d2` should be set to `(t - 1) // 2`, where `t = (modulus - 1) >> F::S`. #[cfg(not(feature = "std"))] -pub(crate) fn sqrt_tonelli_shank>( +pub(crate) fn sqrt_tonelli_shanks>( f: &F, tm1d2: S, ) -> CtOption { diff --git a/src/fields/fp.rs b/src/fields/fp.rs index 200e20d..0650751 100644 --- a/src/fields/fp.rs +++ b/src/fields/fp.rs @@ -513,7 +513,7 @@ impl ff::Field for Fp { } #[cfg(not(feature = "std"))] - crate::arithmetic::sqrt_tonelli_shank( + crate::arithmetic::sqrt_tonelli_shanks( self, &[ 0x04a6_7c8d_cc96_9876, diff --git a/src/fields/fq.rs b/src/fields/fq.rs index 95fed38..1a137fc 100644 --- a/src/fields/fq.rs +++ b/src/fields/fq.rs @@ -513,7 +513,7 @@ impl ff::Field for Fq { } #[cfg(not(feature = "std"))] - crate::arithmetic::sqrt_tonelli_shank( + crate::arithmetic::sqrt_tonelli_shanks( self, &[ 0x04ca_546e_c623_7590,