Add Eq implementation for DecafPoint

This commit is contained in:
Henry & Isis 2017-02-20 03:14:25 -08:00 committed by Henry de Valence
parent bf19df64f0
commit db17dc4b78

View file

@ -156,6 +156,22 @@ impl DecafPoint {
}
}
// ------------------------------------------------------------------------
// Equality
// ------------------------------------------------------------------------
/// XXX check whether there's a simple way to do equality checking
/// with cofactor 8, not just cofactor 4, and add a CT equality function?
impl PartialEq for DecafPoint {
fn eq(&self, other: &DecafPoint) -> bool {
let self_compressed = self.compress();
let other_compressed = other.compress();
self_compressed == other_compressed
}
}
impl Eq for DecafPoint {}
// ------------------------------------------------------------------------
// Arithmetic
// ------------------------------------------------------------------------