From 666b60d35873288b69ffaf18dc7e44574b69d1f3 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 17 Jan 2025 20:38:14 -0800 Subject: [PATCH] arithmetic: Rename `limbs_mont_square` to `limbs_square_mont`. Be more consistent with the non-squaring Montgomery multiplication functions. --- src/arithmetic/bigint.rs | 4 ++-- src/arithmetic/montgomery.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/arithmetic/bigint.rs b/src/arithmetic/bigint.rs index 33269a0b46..f3d867550b 100644 --- a/src/arithmetic/bigint.rs +++ b/src/arithmetic/bigint.rs @@ -205,7 +205,7 @@ fn elem_squared( where (E, E): ProductEncoding, { - limbs_mont_square(&mut a.limbs, m.limbs(), m.n0(), m.cpu_features()); + limbs_square_mont(&mut a.limbs, m.limbs(), m.n0(), m.cpu_features()); Elem { limbs: a.limbs, encoding: PhantomData, @@ -638,7 +638,7 @@ pub fn elem_exp_consttime( if i >= TABLE_ENTRIES as LeakyWindow { break; } - limbs_mont_square(acc, m_cached, n0, cpu_features); + limbs_square_mont(acc, m_cached, n0, cpu_features); } } diff --git a/src/arithmetic/montgomery.rs b/src/arithmetic/montgomery.rs index 1a695f19d0..5f5a14a847 100644 --- a/src/arithmetic/montgomery.rs +++ b/src/arithmetic/montgomery.rs @@ -300,7 +300,7 @@ pub(super) fn limbs_mont_product( } /// r = r**2 -pub(super) fn limbs_mont_square(r: &mut [Limb], m: &[Limb], n0: &N0, cpu_features: cpu::Features) { +pub(super) fn limbs_square_mont(r: &mut [Limb], m: &[Limb], n0: &N0, cpu_features: cpu::Features) { debug_assert_eq!(r.len(), m.len()); unsafe { mul_mont(