mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
fixup extendedpoint validity check
This commit is contained in:
parent
0c58de0367
commit
dfc9e7c0b7
1 changed files with 4 additions and 2 deletions
|
|
@ -271,9 +271,11 @@ impl Identity for EdwardsPoint {
|
|||
// ------------------------------------------------------------------------
|
||||
|
||||
impl ValidityCheck for EdwardsPoint {
|
||||
// XXX this should also check that T is correct
|
||||
fn is_valid(&self) -> bool {
|
||||
self.to_projective().is_valid()
|
||||
let point_on_curve = self.to_projective().is_valid();
|
||||
let on_segre_image = (&self.X * &self.Y) == (&self.Z * &self.T);
|
||||
|
||||
point_on_curve && on_segre_image
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue