We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ab049f commit 4966407Copy full SHA for 4966407
src/limb/cmp.rs
@@ -44,19 +44,26 @@ impl ConstantTimeEq for Limb {
44
fn ct_eq(&self, other: &Self) -> Choice {
45
self.0.ct_eq(&other.0)
46
}
47
+
48
+ #[inline]
49
+ fn ct_ne(&self, other: &Self) -> Choice {
50
+ self.0.ct_ne(&other.0)
51
+ }
52
53
54
impl ConstantTimeGreater for Limb {
55
#[inline]
56
fn ct_gt(&self, other: &Self) -> Choice {
- self.0.ct_gt(&other.0)
57
+ let borrow = other.sbb(*self, Limb::ZERO).1;
58
+ Choice::from(borrow.0 as u8 & 1)
59
60
61
62
impl ConstantTimeLess for Limb {
63
64
fn ct_lt(&self, other: &Self) -> Choice {
- self.0.ct_lt(&other.0)
65
+ let borrow = self.sbb(*other, Limb::ZERO).1;
66
67
68
69
0 commit comments