Skip to content

Commit 0a898b1

Browse files
committed
Use fully qualified namespace for div_by_2 to avoid confusion
1 parent 2eba0e7 commit 0a898b1

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

src/modular/boxed_residue.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ mod pow;
99
mod sub;
1010

1111
use super::{
12-
div_by_2::boxed::div_by_2,
12+
div_by_2,
1313
reduction::{montgomery_reduction_boxed, montgomery_reduction_boxed_mut},
1414
Retrieve,
1515
};
@@ -242,7 +242,10 @@ impl BoxedResidue {
242242
/// (since the modulus `p` in Montgomery form is always odd, this divides entirely).
243243
pub fn div_by_2(&self) -> Self {
244244
Self {
245-
montgomery_form: div_by_2(&self.montgomery_form, &self.residue_params.modulus),
245+
montgomery_form: div_by_2::boxed::div_by_2(
246+
&self.montgomery_form,
247+
&self.residue_params.modulus,
248+
),
246249
residue_params: self.residue_params.clone(), // TODO: avoid clone?
247250
}
248251
}

src/uint/boxed/div.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
//! [`BoxedUint`] division operations.
22
33
use crate::{
4-
uint::boxed::div_limb, BoxedUint, CheckedDiv, Limb, NonZero, Reciprocal, Wrapping, ConstantTimeSelect};
4+
uint::boxed::div_limb, BoxedUint, CheckedDiv, ConstantTimeSelect, Limb, NonZero, Reciprocal,
5+
Wrapping,
6+
};
57
use core::ops::{Div, DivAssign, Rem, RemAssign};
68
use subtle::{Choice, ConstantTimeEq, ConstantTimeLess, CtOption};
79

src/uint/boxed/shl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! [`BoxedUint`] bitwise left shift operations.
22
3-
use crate::{BoxedUint, ConstantTimeSelect, ConstChoice, Limb, Word, WrappingShl, Zero};
3+
use crate::{BoxedUint, ConstChoice, ConstantTimeSelect, Limb, Word, WrappingShl, Zero};
44
use core::ops::{Shl, ShlAssign};
55
use subtle::{Choice, ConstantTimeLess};
66

src/uint/boxed/sqrt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use subtle::{ConstantTimeEq, ConstantTimeGreater, CtOption};
44

5-
use crate::{ConstantTimeSelect, BoxedUint, NonZero};
5+
use crate::{BoxedUint, ConstantTimeSelect, NonZero};
66

77
impl BoxedUint {
88
/// Computes √(`self`) in constant time.

0 commit comments

Comments
 (0)