From 082d66d6e7e9e20757efdb1d519f85783fcab699 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Mon, 22 Feb 2021 18:41:41 +0000 Subject: [PATCH] pasta: Reorganize the curve macro This will make the migration to group easier to review. --- src/pasta/curves.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pasta/curves.rs b/src/pasta/curves.rs index 72eaa05b..9a2b9db1 100644 --- a/src/pasta/curves.rs +++ b/src/pasta/curves.rs @@ -95,6 +95,11 @@ macro_rules! new_curve_impl { $name::curve_constant_b() } + fn new_jacobian(x: Self::Base, y: Self::Base, z: Self::Base) -> CtOption { + let p = $name { x, y, z }; + CtOption::new(p, p.is_on_curve()) + } + fn jacobian_coordinates(&self) -> ($base, $base, $base) { (self.x, self.y, self.z) } @@ -148,11 +153,6 @@ macro_rules! new_curve_impl { *q = $name_affine::conditional_select(&q, &$name_affine::identity(), skip); } } - - fn new_jacobian(x: Self::Base, y: Self::Base, z: Self::Base) -> CtOption { - let p = $name { x, y, z }; - CtOption::new(p, p.is_on_curve()) - } } impl<'a> From<&'a $name_affine> for $name {