@@ -7,8 +7,8 @@ pub use num_traits::{
7
7
use crate :: { Limb , NonZero } ;
8
8
use core:: fmt:: Debug ;
9
9
use core:: ops:: {
10
- BitAnd , BitAndAssign , BitOr , BitOrAssign , BitXor , BitXorAssign , Div , DivAssign , Not , Rem , Shl ,
11
- ShlAssign , Shr , ShrAssign ,
10
+ Add , BitAnd , BitAndAssign , BitOr , BitOrAssign , BitXor , BitXorAssign , Div , DivAssign , Mul , Not ,
11
+ Rem , Shl , ShlAssign , Shr , ShrAssign , Sub ,
12
12
} ;
13
13
use subtle:: {
14
14
Choice , ConditionallySelectable , ConstantTimeEq , ConstantTimeGreater , ConstantTimeLess ,
@@ -30,16 +30,21 @@ pub trait Bounded {
30
30
/// Integer trait: represents common functionality of integer types provided by this crate.
31
31
pub trait Integer :
32
32
' static
33
- + AddMod
33
+ + Add < Output = Self >
34
+ + for < ' a > Add < & ' a Self , Output = Self >
35
+ + AddMod < Output = Self >
34
36
+ AsRef < [ Limb ] >
35
- + BitAndAssign
36
- + BitOrAssign
37
- + BitXorAssign
38
37
+ BitAnd < Output = Self >
39
- + BitOr < Output = Self >
40
- + BitXor < Output = Self >
38
+ + for < ' a > BitAnd < & ' a Self , Output = Self >
39
+ + BitAndAssign
41
40
+ for < ' a > BitAndAssign < & ' a Self >
41
+ + BitOr < Output = Self >
42
+ + for < ' a > BitOr < & ' a Self , Output = Self >
43
+ + BitOrAssign
42
44
+ for < ' a > BitOrAssign < & ' a Self >
45
+ + BitXor < Output = Self >
46
+ + for < ' a > BitXor < & ' a Self , Output = Self >
47
+ + BitXorAssign
43
48
+ for < ' a > BitXorAssign < & ' a Self >
44
49
+ CheckedAdd
45
50
+ CheckedSub
@@ -53,17 +58,19 @@ pub trait Integer:
53
58
+ Debug
54
59
+ Default
55
60
+ Div < NonZero < Self > , Output = Self >
56
- + DivAssign < NonZero < Self > >
57
61
+ for < ' a > Div < & ' a NonZero < Self > , Output = Self >
62
+ + DivAssign < NonZero < Self > >
58
63
+ for < ' a > DivAssign < & ' a NonZero < Self > >
59
64
+ Eq
60
65
+ From < u8 >
61
66
+ From < u16 >
62
67
+ From < u32 >
63
68
+ From < u64 >
64
- + MulMod
65
- + NegMod
66
- + Not
69
+ + Mul < Output = Self >
70
+ + for < ' a > Mul < & ' a Self , Output = Self >
71
+ + MulMod < Output = Self >
72
+ + NegMod < Output = Self >
73
+ + Not < Output = Self >
67
74
+ Ord
68
75
+ Rem < NonZero < Self > , Output = Self >
69
76
+ for < ' a > Rem < & ' a NonZero < Self > , Output = Self >
@@ -73,7 +80,9 @@ pub trait Integer:
73
80
+ ShlAssign < u32 >
74
81
+ Shr < u32 , Output = Self >
75
82
+ ShrAssign < u32 >
76
- + SubMod
83
+ + Sub < Output = Self >
84
+ + for < ' a > Sub < & ' a Self , Output = Self >
85
+ + SubMod < Output = Self >
77
86
+ Sync
78
87
+ WrappingAdd
79
88
+ WrappingSub
@@ -345,7 +354,7 @@ pub trait Encoding: Sized {
345
354
/// Support for optimized squaring
346
355
pub trait Square : Sized
347
356
where
348
- for < ' a > & ' a Self : core :: ops :: Mul < & ' a Self , Output = Self > ,
357
+ for < ' a > & ' a Self : Mul < & ' a Self , Output = Self > ,
349
358
{
350
359
/// Computes the same as `self.mul(self)`, but may be more efficient.
351
360
fn square ( & self ) -> Self {
0 commit comments