From f84dfccf93bdd5d9d89e044875fd1b1c880a8bb8 Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:50:38 -0800 Subject: [PATCH 1/2] fix: `mul_by_3b` special case should be `CURVE_ID == "bn256_g1"` --- src/derive/curve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/derive/curve.rs b/src/derive/curve.rs index 467c1be0..fea9d7a8 100644 --- a/src/derive/curve.rs +++ b/src/derive/curve.rs @@ -393,7 +393,7 @@ macro_rules! new_curve_impl { } fn mul_by_3b(input: &$base) -> $base { - if $name::CURVE_ID == "bn256"{ + if $name::CURVE_ID == "bn256_g1"{ input.double().double().double() + input } else { input * $name::curve_constant_3b() From ec5c0b78e36e89fe7a2300b1aeab9282638788cd Mon Sep 17 00:00:00 2001 From: Jonathan Wang <31040440+jonathanpwang@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:52:39 -0800 Subject: [PATCH 2/2] chore: fix a clippy warning --- src/derive/curve.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/derive/curve.rs b/src/derive/curve.rs index fea9d7a8..f40b5e22 100644 --- a/src/derive/curve.rs +++ b/src/derive/curve.rs @@ -305,6 +305,7 @@ macro_rules! new_curve_impl { } paste::paste! { + #[allow(unused_imports)] use ::serde::de::Error as _; impl<'de> ::serde::Deserialize<'de> for $name { fn deserialize>( @@ -334,6 +335,7 @@ macro_rules! new_curve_impl { } paste::paste! { + #[allow(unused_imports)] use ::serde::de::Error as _; impl<'de> ::serde::Deserialize<'de> for $name_affine { fn deserialize>(