diff --git a/src/jubjub/edwards.rs b/src/jubjub/edwards.rs index 73f0dfc..e91455c 100644 --- a/src/jubjub/edwards.rs +++ b/src/jubjub/edwards.rs @@ -164,6 +164,7 @@ impl Point { } /// This guarantees the point is in the prime order subgroup + #[must_use] pub fn mul_by_cofactor(&self, params: &E::Params) -> Point { let tmp = self.double(params) @@ -346,6 +347,7 @@ impl Point { (x, y) } + #[must_use] pub fn negate(&self) -> Self { let mut p = self.clone(); @@ -355,6 +357,7 @@ impl Point { p } + #[must_use] pub fn double(&self, _: &E::Params) -> Self { // See "Twisted Edwards Curves Revisited" // Huseyin Hisil, Kenneth Koon-Ho Wong, Gary Carter, and Ed Dawson @@ -423,6 +426,7 @@ impl Point { } } + #[must_use] pub fn add(&self, other: &Self, params: &E::Params) -> Self { // See "Twisted Edwards Curves Revisited" @@ -495,6 +499,7 @@ impl Point { } } + #[must_use] pub fn mul::Repr>>( &self, scalar: S, diff --git a/src/jubjub/montgomery.rs b/src/jubjub/montgomery.rs index 2243877..18d0fcb 100644 --- a/src/jubjub/montgomery.rs +++ b/src/jubjub/montgomery.rs @@ -97,6 +97,7 @@ impl Point { } /// This guarantees the point is in the prime order subgroup + #[must_use] pub fn mul_by_cofactor(&self, params: &E::Params) -> Point { let tmp = self.double(params) @@ -216,6 +217,7 @@ impl Point { } } + #[must_use] pub fn negate(&self) -> Self { let mut p = self.clone(); @@ -224,6 +226,7 @@ impl Point { p } + #[must_use] pub fn double(&self, params: &E::Params) -> Self { if self.infinity { return Point::zero(); @@ -280,6 +283,7 @@ impl Point { } } + #[must_use] pub fn add(&self, other: &Self, params: &E::Params) -> Self { // This is a standard affine point addition formula @@ -330,6 +334,7 @@ impl Point { } } + #[must_use] pub fn mul::Repr>>( &self, scalar: S,