Merge pull request #210 from DebugSteven/default-montgomerypoint

Default & Identity trait for MontgomeryPoint
This commit is contained in:
Henry de Valence 2018-11-14 20:35:35 -08:00 committed by GitHub
commit 55b96aab6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,6 +76,12 @@ impl ConstantTimeEq for MontgomeryPoint {
}
}
impl Default for MontgomeryPoint {
fn default() -> MontgomeryPoint {
MontgomeryPoint([0u8; 32])
}
}
impl PartialEq for MontgomeryPoint {
fn eq(&self, other: &MontgomeryPoint) -> bool {
self.ct_eq(other).unwrap_u8() == 1u8