diff --git a/src/curve_models/mod.rs b/src/curve_models/mod.rs index 45c2919..d2ded64 100644 --- a/src/curve_models/mod.rs +++ b/src/curve_models/mod.rs @@ -212,12 +212,6 @@ impl Identity for ProjectivePoint { } } -impl Default for ProjectivePoint { - fn default() -> ProjectivePoint { - ProjectivePoint::identity() - } -} - impl Identity for ProjectiveNielsPoint { fn identity() -> ProjectiveNielsPoint { ProjectiveNielsPoint{ diff --git a/src/edwards.rs b/src/edwards.rs index d3155a1..97e97c9 100644 --- a/src/edwards.rs +++ b/src/edwards.rs @@ -260,6 +260,12 @@ impl Identity for CompressedEdwardsY { } } +impl Default for CompressedEdwardsY { + fn default() -> CompressedEdwardsY { + CompressedEdwardsY::identity() + } +} + impl Identity for EdwardsPoint { fn identity() -> EdwardsPoint { EdwardsPoint{ X: FieldElement::zero(), @@ -269,6 +275,12 @@ impl Identity for EdwardsPoint { } } +impl Default for EdwardsPoint { + fn default() -> EdwardsPoint { + EdwardsPoint::identity() + } +} + // ------------------------------------------------------------------------ // Validity checks (for debugging, not CT) // ------------------------------------------------------------------------ diff --git a/src/montgomery.rs b/src/montgomery.rs index 0c21b00..68b871a 100644 --- a/src/montgomery.rs +++ b/src/montgomery.rs @@ -155,6 +155,12 @@ impl Identity for ProjectivePoint { } } +impl Default for ProjectivePoint { + fn default() -> ProjectivePoint { + ProjectivePoint::identity() + } +} + impl ConditionallyAssignable for ProjectivePoint { fn conditional_assign(&mut self, that: &ProjectivePoint, choice: Choice) { self.U.conditional_assign(&that.U, choice); diff --git a/src/ristretto.rs b/src/ristretto.rs index 1a6f8dd..8b02e07 100644 --- a/src/ristretto.rs +++ b/src/ristretto.rs @@ -281,6 +281,12 @@ impl Identity for CompressedRistretto { } } +impl Default for CompressedRistretto { + fn default() -> CompressedRistretto { + CompressedRistretto::identity() + } +} + // ------------------------------------------------------------------------ // Serde support // ------------------------------------------------------------------------ @@ -663,6 +669,12 @@ impl Identity for RistrettoPoint { } } +impl Default for RistrettoPoint { + fn default() -> RistrettoPoint { + RistrettoPoint::identity() + } +} + // ------------------------------------------------------------------------ // Equality // ------------------------------------------------------------------------