Merge branch 'feature/154-defaults' into develop

This commit is contained in:
Isis Lovecruft 2018-07-20 19:52:34 +00:00
commit 4d527cae4b
Failed to extract signature
4 changed files with 30 additions and 6 deletions

View file

@ -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{

View file

@ -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)
// ------------------------------------------------------------------------

View file

@ -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);

View file

@ -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
// ------------------------------------------------------------------------