Skip to content

Commit a14399a

Browse files
committed
Use ct_gt instead of gt
1 parent 0ceacb0 commit a14399a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

src/uint/boxed/cmp.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@ use subtle::{
1111
};
1212

1313
impl BoxedUint {
14-
/// Returns the truthy value if `self >= rhs` and the falsy value otherwise.
15-
#[inline]
16-
pub(crate) fn gt(lhs: &Self, rhs: &Self) -> ConstChoice {
17-
let (_res, borrow) = rhs.sbb(lhs, Limb::ZERO);
18-
ConstChoice::from_word_mask(borrow.0)
19-
}
20-
2114
/// Returns the Ordering between `self` and `rhs` in variable time.
2215
pub fn cmp_vartime(&self, rhs: &Self) -> Ordering {
2316
debug_assert_eq!(self.limbs.len(), rhs.limbs.len());

src/uint/boxed/sqrt.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! [`BoxedUint`] square root operations.
22
3-
use subtle::{ConstantTimeEq, CtOption};
3+
use subtle::{ConstantTimeEq, ConstantTimeGreater, CtOption};
44

55
use crate::{BoxedUint, NonZero};
66

@@ -48,7 +48,7 @@ impl BoxedUint {
4848
// At this point `x_prev == x_{n}` and `x == x_{n+1}`
4949
// where `n == i - 1 == LOG2_BITS + 1 == floor(log2(BITS)) + 1`.
5050
// Thus, according to Hast, `sqrt(self) = min(x_n, x_{n+1})`.
51-
Self::conditional_select(&x_prev, &x, Self::gt(&x_prev, &x).into())
51+
Self::conditional_select(&x_prev, &x, Self::ct_gt(&x_prev, &x))
5252
}
5353

5454
/// Computes √(`self`)

0 commit comments

Comments
 (0)