File tree Expand file tree Collapse file tree 2 files changed +1
-18
lines changed Expand file tree Collapse file tree 2 files changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -11,23 +11,6 @@ use subtle::{
11
11
} ;
12
12
13
13
impl BoxedUint {
14
- /// Return `b` if `c` is truthy, otherwise return `a`.
15
- #[ inline]
16
- pub ( crate ) fn select ( a : & Self , b : & Self , c : ConstChoice ) -> Self {
17
- debug_assert_eq ! ( a. limbs. len( ) , b. limbs. len( ) ) ;
18
- let mut limbs = vec ! [ Limb :: ZERO ; a. limbs. len( ) ] ;
19
-
20
- let mut i = 0 ;
21
- while i < limbs. len ( ) {
22
- limbs[ i] = Limb :: select ( a. limbs [ i] , b. limbs [ i] , c) ;
23
- i += 1 ;
24
- }
25
-
26
- Self {
27
- limbs : limbs. into ( ) ,
28
- }
29
- }
30
-
31
14
/// Returns the truthy value if `self >= rhs` and the falsy value otherwise.
32
15
#[ inline]
33
16
pub ( crate ) fn gt ( lhs : & Self , rhs : & Self ) -> ConstChoice {
Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ impl BoxedUint {
48
48
// At this point `x_prev == x_{n}` and `x == x_{n+1}`
49
49
// where `n == i - 1 == LOG2_BITS + 1 == floor(log2(BITS)) + 1`.
50
50
// Thus, according to Hast, `sqrt(self) = min(x_n, x_{n+1})`.
51
- Self :: select ( & x_prev, & x, BoxedUint :: gt ( & x_prev, & x) )
51
+ Self :: conditional_select ( & x_prev, & x, Self :: gt ( & x_prev, & x) . into ( ) )
52
52
}
53
53
54
54
/// Computes √(`self`)
You can’t perform that action at this time.
0 commit comments