mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-04 20:03:39 +00:00
Fix naming of Tonelli-Shanks
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
parent
9999964d17
commit
2b350118b0
3 changed files with 4 additions and 4 deletions
|
|
@ -138,13 +138,13 @@ pub trait FieldExt: ff::PrimeField + From<bool> + Ord + Group<Scalar = Self> {
|
|||
}
|
||||
}
|
||||
|
||||
/// 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<F: ff::PrimeField, S: AsRef<[u64]>>(
|
||||
pub(crate) fn sqrt_tonelli_shanks<F: ff::PrimeField, S: AsRef<[u64]>>(
|
||||
f: &F,
|
||||
tm1d2: S,
|
||||
) -> CtOption<F> {
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue