mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-04 20:24:10 +00:00
Add Eq implementation for DecafPoint
This commit is contained in:
parent
bf19df64f0
commit
db17dc4b78
1 changed files with 16 additions and 0 deletions
16
src/decaf.rs
16
src/decaf.rs
|
|
@ -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
|
||||
// ------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Reference in a new issue