Skip to content

Commit

Permalink
[fix/optimization] mul_by_3b was not triggering optimization for `b…
Browse files Browse the repository at this point in the history
…n256_g1` (#12)
  • Loading branch information
jonathanpwang authored Nov 17, 2023
2 parents 0057190 + ec5c0b7 commit 099e233
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/derive/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<D: ::serde::Deserializer<'de>>(
Expand Down Expand Up @@ -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<D: ::serde::Deserializer<'de>>(
Expand Down Expand Up @@ -393,7 +395,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()
Expand Down

0 comments on commit 099e233

Please sign in to comment.