mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-07 20:30:39 +00:00
Remove unnecessary if statements
This commit is contained in:
parent
e74bf8e789
commit
b3041f2adc
2 changed files with 2 additions and 14 deletions
|
|
@ -470,13 +470,7 @@ pub trait IsIdentity {
|
||||||
/// constructor.
|
/// constructor.
|
||||||
impl<T> IsIdentity for T where T: CTEq + Identity {
|
impl<T> IsIdentity for T where T: CTEq + Identity {
|
||||||
fn is_identity(&self) -> bool {
|
fn is_identity(&self) -> bool {
|
||||||
let identity: T = T::identity();
|
self.ct_eq(&T::identity()) == 1u8
|
||||||
|
|
||||||
if self.ct_eq(&identity) == 1u8 {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -72,13 +72,7 @@ impl PartialEq for Scalar {
|
||||||
///
|
///
|
||||||
/// True if they are equal, and false otherwise.
|
/// True if they are equal, and false otherwise.
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
let equal: u8 = arrays_equal_ct(&self.0, &other.0);
|
arrays_equal_ct(&self.0, &other.0) == 1u8
|
||||||
|
|
||||||
if equal == 1u8 {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue