From 2498baad4aa15cb765eb96f23a5b6bd17a1dbaf1 Mon Sep 17 00:00:00 2001 From: fatih Date: Fri, 23 Aug 2024 14:39:55 +0300 Subject: [PATCH 1/2] perf: ATE_LOOP_COUNT hamming weight reduced from 26 to 22 --- curves/bn254/src/curves/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curves/bn254/src/curves/mod.rs b/curves/bn254/src/curves/mod.rs index 349488786..429284f11 100644 --- a/curves/bn254/src/curves/mod.rs +++ b/curves/bn254/src/curves/mod.rs @@ -19,9 +19,9 @@ impl BnConfig for Config { /// `x` is positive. const X_IS_NEGATIVE: bool = false; const ATE_LOOP_COUNT: &'static [i8] = &[ - 0, 0, 0, 1, 0, 1, 0, -1, 0, 0, 1, -1, 0, 0, 1, 0, 0, 1, 1, 0, -1, 0, 0, 1, 0, -1, 0, 0, 0, - 0, 1, 1, 1, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 1, 0, 0, -1, 0, 0, 0, 1, 1, 0, - -1, 0, 0, 1, 0, 1, 1, + 0, 0, 0, 1, 0, 1, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, + 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 1, 0, -1, 0, 0, 0, -1, 0, -1, + 0, 0, 0, 1, 0, 1, 1, ]; const TWIST_MUL_BY_Q_X: Fq2 = Fq2::new( From 9cd8beec9807708496c9fbf582c04c34fc2a4593 Mon Sep 17 00:00:00 2001 From: fatih Date: Fri, 23 Aug 2024 15:06:05 +0300 Subject: [PATCH 2/2] style: fix --- curves/bn254/src/curves/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curves/bn254/src/curves/mod.rs b/curves/bn254/src/curves/mod.rs index 429284f11..68e15233b 100644 --- a/curves/bn254/src/curves/mod.rs +++ b/curves/bn254/src/curves/mod.rs @@ -20,8 +20,8 @@ impl BnConfig for Config { const X_IS_NEGATIVE: bool = false; const ATE_LOOP_COUNT: &'static [i8] = &[ 0, 0, 0, 1, 0, 1, 0, -1, 0, 0, -1, 0, 0, 0, 1, 0, 0, -1, 0, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, - 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 1, 0, -1, 0, 0, 0, -1, 0, -1, - 0, 0, 0, 1, 0, 1, 1, + 0, -1, 0, 0, 1, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 1, 0, -1, 0, 0, 0, -1, 0, + -1, 0, 0, 0, 1, 0, 1, 1, ]; const TWIST_MUL_BY_Q_X: Fq2 = Fq2::new(