Skip to content

Commit caa536d

Browse files
committed
Use AffinePoint where appropriate
1 parent 9e8656b commit caa536d

File tree

11 files changed

+390
-355
lines changed

11 files changed

+390
-355
lines changed

ed448-goldilocks/src/curve/scalar_mul/variable_base.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod test {
5656

5757
// Lets see if this is conserved over the isogenies
5858
let edwards_point = twisted_point.to_untwisted();
59-
let got_untwisted_point = edwards_point.scalar_mul(&scalar);
59+
let got_untwisted_point = edwards_point.to_affine().scalar_mul(&scalar);
6060
let expected_untwisted_point = got.to_untwisted();
6161
assert_eq!(got_untwisted_point, expected_untwisted_point);
6262
}

ed448-goldilocks/src/curve/twedwards/extended.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ mod tests {
197197
"ae05e9634ad7048db359d6205086c2b0036ed7a035884dd7b7e36d728ad8c4b80d6565833a2a3098bbbcb2bed1cda06bdaeafbcdea9386ed",
198198
);
199199
let a = AffinePoint { x, y }.to_extended();
200-
let twist_a = a.to_untwisted().to_twisted();
200+
let twist_a = a.to_untwisted().to_affine().to_twisted();
201201
assert_eq!(twist_a, a.double().double())
202202
}
203203

ed448-goldilocks/src/decaf/points.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ impl CurveGroup for DecafPoint {
249249
}
250250
}
251251

252-
impl From<EdwardsPoint> for DecafPoint {
253-
fn from(point: EdwardsPoint) -> Self {
252+
impl From<AffinePoint> for DecafPoint {
253+
fn from(point: AffinePoint) -> Self {
254254
Self(point.to_twisted())
255255
}
256256
}
257257

258-
impl From<&EdwardsPoint> for DecafPoint {
259-
fn from(point: &EdwardsPoint) -> Self {
258+
impl From<&AffinePoint> for DecafPoint {
259+
fn from(point: &AffinePoint) -> Self {
260260
Self(point.to_twisted())
261261
}
262262
}

ed448-goldilocks/src/edwards.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
pub(crate) mod affine;
1313
pub(crate) mod extended;
1414
mod scalar;
15-
pub use affine::AffinePoint;
16-
pub use extended::{CompressedEdwardsY, EdwardsPoint};
15+
pub use affine::{AffinePoint, CompressedEdwardsY};
16+
pub use extended::EdwardsPoint;
1717
pub use scalar::{EdwardsScalar, EdwardsScalarBytes, WideEdwardsScalarBytes};

0 commit comments

Comments
 (0)