Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
jotabulacios committed Dec 20, 2024
1 parent 2cc13bc commit 32ed5e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions math/src/field/fields/u32_montgomery_backend_prime_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl MontgomeryAlgorithms {
///
/// Converts a value from Montgomery domain using reductions mod p
#[inline(always)]
const fn monty_reduce(x: u64, mu: &u32, q: &u32) -> u32 {
const fn montgomery_reduction(x: u64, mu: &u32, q: &u32) -> u32 {
let t = x.wrapping_mul(*mu as u64) & (u32::MAX as u64);
let u = t * (*q as u64);
let (x_sub_u, over) = x.overflowing_sub(u);
Expand All @@ -277,7 +277,7 @@ impl MontgomeryAlgorithms {
#[inline(always)]
pub const fn mul(a: &u32, b: &u32, q: &u32, mu: &u32) -> u32 {
let x = *a as u64 * *b as u64;
Self::monty_reduce(x, mu, q)
Self::montgomery_reduction(x, mu, q)
}

pub fn exp_power_of_2(a: &u32, power_log: usize, q: &u32, mu: &u32) -> u32 {
Expand Down

0 comments on commit 32ed5e3

Please sign in to comment.