File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -530,17 +530,17 @@ where
530
530
for < ' a1 , ' a2 > & ' a1 T : NumOps < & ' a2 T , T > ,
531
531
{
532
532
fn ceil_quotient ( & self , k : & Self ) -> Self {
533
- assert ! ( k > & Self :: zero( ) ) ;
533
+ assert ! ( * k > Self :: zero( ) ) ;
534
534
& ( & ( self + k) - & Self :: one ( ) ) / k
535
535
}
536
536
537
537
fn floor_quotient ( & self , k : & Self ) -> Self {
538
- assert ! ( k > & Self :: zero( ) ) ;
538
+ assert ! ( * k > Self :: zero( ) ) ;
539
539
self / k
540
540
}
541
541
542
542
fn remainder ( & self , k : & Self ) -> Self {
543
- assert ! ( k > & Self :: zero( ) ) ;
543
+ assert ! ( * k > Self :: zero( ) ) ;
544
544
545
545
let mut r = self % k;
546
546
if r < Self :: zero ( ) {
@@ -550,7 +550,7 @@ where
550
550
}
551
551
552
552
fn root ( & self , k : usize ) -> ( Self , bool ) {
553
- assert ! ( self > & Self :: zero( ) , "base is not positive" ) ;
553
+ assert ! ( * self > Self :: zero( ) , "base is not positive" ) ;
554
554
assert ! ( k > 0 , "exponent is not positive" ) ;
555
555
556
556
let one = Self :: one ( ) ;
Original file line number Diff line number Diff line change 1
- #![ cfg_attr( feature="cargo-clippy" , feature( tool_lints) ) ]
2
-
3
1
extern crate bignum;
4
2
extern crate num_traits;
5
3
extern crate rsa;
@@ -44,13 +42,12 @@ where
44
42
self . secret_key_from_k ( m1, s1, & k)
45
43
}
46
44
47
- #[ cfg_attr( feature = "cargo-clippy" , allow( clippy:: op_ref) ) ]
48
45
pub fn verify_signature ( & self , m : & T , & Signature { ref r, ref s } : & Signature < T > ) -> bool {
49
46
let zero = T :: zero ( ) ;
50
47
let p = & self . params . p ;
51
48
let q = & self . params . q ;
52
49
let g = & self . params . g ;
53
- if r <= & zero || r >= q || s <= & zero || s >= q {
50
+ if * r <= zero || r >= q || * s <= zero || s >= q {
54
51
return false ;
55
52
}
56
53
let w = T :: invmod ( s, q) . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments