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::{
1111} ;
1212
1313impl 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-
3114 /// Returns the truthy value if `self >= rhs` and the falsy value otherwise.
3215 #[ inline]
3316 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 {
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 :: select ( & x_prev, & x, BoxedUint :: gt ( & x_prev, & x) )
51+ Self :: conditional_select ( & x_prev, & x, Self :: gt ( & x_prev, & x) . into ( ) )
5252 }
5353
5454 /// Computes √(`self`)
You can’t perform that action at this time.
0 commit comments