diff --git a/src/arithmetic/bigint.rs b/src/arithmetic/bigint.rs index f058c88d20..4f127b55dd 100644 --- a/src/arithmetic/bigint.rs +++ b/src/arithmetic/bigint.rs @@ -758,18 +758,6 @@ fn limbs_mont_square(r: &mut [Limb], m: &[Limb], n0: &N0, _cpu_features: cpu::Fe } } -prefixed_extern! { - // `r` and/or 'a' and/or 'b' may alias. - fn bn_mul_mont( - r: *mut Limb, - a: *const Limb, - b: *const Limb, - n: *const Limb, - n0: &N0, - num_limbs: c::size_t, - ); -} - #[cfg(test)] mod tests { use super::*; diff --git a/src/arithmetic/montgomery.rs b/src/arithmetic/montgomery.rs index 2f0fadf606..a155ec36bc 100644 --- a/src/arithmetic/montgomery.rs +++ b/src/arithmetic/montgomery.rs @@ -120,7 +120,7 @@ use crate::{bssl, c, limb::Limb}; // TODO: Stop calling this from C and un-export it. #[allow(deprecated)] prefixed_export! { - unsafe fn bn_mul_mont( + pub(super) unsafe fn bn_mul_mont( r: *mut Limb, a: *const Limb, b: *const Limb, @@ -218,6 +218,24 @@ prefixed_extern! { fn limbs_mul_add_limb(r: *mut Limb, a: *const Limb, b: Limb, num_limbs: c::size_t) -> Limb; } +#[cfg(any( + target_arch = "aarch64", + target_arch = "arm", + target_arch = "x86_64", + target_arch = "x86" +))] +prefixed_extern! { + // `r` and/or 'a' and/or 'b' may alias. + pub(super) fn bn_mul_mont( + r: *mut Limb, + a: *const Limb, + b: *const Limb, + n: *const Limb, + n0: &N0, + num_limbs: c::size_t, + ); +} + #[cfg(test)] mod tests { use super::*;