mirror of
https://github.com/saymrwulf/betrusted-curve25519-dalek-source.git
synced 2026-09-07 20:50:38 +00:00
Implement Default for remaining point types.
* FIXES https://github.com/dalek-cryptography/curve25519-dalek/issues/154
This commit is contained in:
parent
9105d0977a
commit
38aa0ee2b7
3 changed files with 30 additions and 0 deletions
|
|
@ -257,6 +257,12 @@ impl Identity for CompressedEdwardsY {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for CompressedEdwardsY {
|
||||||
|
fn default() -> CompressedEdwardsY {
|
||||||
|
CompressedEdwardsY::identity()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl Identity for EdwardsPoint {
|
impl Identity for EdwardsPoint {
|
||||||
fn identity() -> EdwardsPoint {
|
fn identity() -> EdwardsPoint {
|
||||||
EdwardsPoint{ X: FieldElement::zero(),
|
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)
|
// Validity checks (for debugging, not CT)
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -155,6 +155,12 @@ impl Identity for ProjectivePoint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for ProjectivePoint {
|
||||||
|
fn default() -> ProjectivePoint {
|
||||||
|
ProjectivePoint::identity()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl ConditionallyAssignable for ProjectivePoint {
|
impl ConditionallyAssignable for ProjectivePoint {
|
||||||
fn conditional_assign(&mut self, that: &ProjectivePoint, choice: Choice) {
|
fn conditional_assign(&mut self, that: &ProjectivePoint, choice: Choice) {
|
||||||
self.U.conditional_assign(&that.U, choice);
|
self.U.conditional_assign(&that.U, choice);
|
||||||
|
|
|
||||||
|
|
@ -279,6 +279,12 @@ impl Identity for CompressedRistretto {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for CompressedRistretto {
|
||||||
|
fn default() -> CompressedRistretto {
|
||||||
|
CompressedRistretto::identity()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Serde support
|
// Serde support
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
@ -661,6 +667,12 @@ impl Identity for RistrettoPoint {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for RistrettoPoint {
|
||||||
|
fn default() -> RistrettoPoint {
|
||||||
|
RistrettoPoint::identity()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
// Equality
|
// Equality
|
||||||
// ------------------------------------------------------------------------
|
// ------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue