Skip to content

Commit

Permalink
arithmetic: Rename limbs_mont_square to limbs_square_mont.
Browse files Browse the repository at this point in the history
Be more consistent with the non-squaring Montgomery multiplication
functions.
  • Loading branch information
briansmith committed Jan 18, 2025
1 parent c229242 commit 666b60d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/arithmetic/bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn elem_squared<M, E>(
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,
Expand Down Expand Up @@ -638,7 +638,7 @@ pub fn elem_exp_consttime<M>(
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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/arithmetic/montgomery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 666b60d

Please sign in to comment.