Skip to content

Commit bac17e4

Browse files
committed
Use AffinePoint where appropriate
1 parent 999e0c9 commit bac17e4

File tree

11 files changed

+392
-355
lines changed

11 files changed

+392
-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
@@ -252,14 +252,14 @@ impl CurveGroup for DecafPoint {
252252
}
253253
}
254254

255-
impl From<EdwardsPoint> for DecafPoint {
256-
fn from(point: EdwardsPoint) -> Self {
255+
impl From<AffinePoint> for DecafPoint {
256+
fn from(point: AffinePoint) -> Self {
257257
Self(point.to_twisted())
258258
}
259259
}
260260

261-
impl From<&EdwardsPoint> for DecafPoint {
262-
fn from(point: &EdwardsPoint) -> Self {
261+
impl From<&AffinePoint> for DecafPoint {
262+
fn from(point: &AffinePoint) -> Self {
263263
Self(point.to_twisted())
264264
}
265265
}

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)