diff --git a/src/edwards.rs b/src/edwards.rs index 08eff32..aa22b67 100644 --- a/src/edwards.rs +++ b/src/edwards.rs @@ -257,6 +257,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(), @@ -266,6 +272,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 cb4e8e0..978f78c 100644 --- a/src/ristretto.rs +++ b/src/ristretto.rs @@ -279,6 +279,12 @@ impl Identity for CompressedRistretto { } } +impl Default for CompressedRistretto { + fn default() -> CompressedRistretto { + CompressedRistretto::identity() + } +} + // ------------------------------------------------------------------------ // Serde support // ------------------------------------------------------------------------ @@ -661,6 +667,12 @@ impl Identity for RistrettoPoint { } } +impl Default for RistrettoPoint { + fn default() -> RistrettoPoint { + RistrettoPoint::identity() + } +} + // ------------------------------------------------------------------------ // Equality // ------------------------------------------------------------------------