mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-04 20:03:39 +00:00
Simplify $name_affine.ct_eq().
By @ebfull's suggestion.
This commit is contained in:
parent
3507ba6ffe
commit
ef39fba64c
1 changed files with 1 additions and 4 deletions
|
|
@ -755,10 +755,7 @@ macro_rules! new_curve_impl {
|
||||||
|
|
||||||
impl ConstantTimeEq for $name_affine {
|
impl ConstantTimeEq for $name_affine {
|
||||||
fn ct_eq(&self, other: &Self) -> Choice {
|
fn ct_eq(&self, other: &Self) -> Choice {
|
||||||
let z1 = self.is_identity();
|
self.x.ct_eq(&other.x) & self.y.ct_eq(&other.y)
|
||||||
let z2 = other.is_identity();
|
|
||||||
|
|
||||||
(z1 & z2) | ((!z1) & (!z2) & (self.x.ct_eq(&other.x)) & (self.y.ct_eq(&other.y)))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue