From 409bbf36a0a1a538883cfc7cd2cf2790b1278ed3 Mon Sep 17 00:00:00 2001 From: therealyingtong Date: Thu, 18 Nov 2021 15:03:40 -0500 Subject: [PATCH] mul::complete: Replace k_minus_one with one_minus_k. --- src/circuit/gadget/ecc/chip/mul/complete.rs | 4 +- src/circuit_description | 48 ++++++++++----------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/circuit/gadget/ecc/chip/mul/complete.rs b/src/circuit/gadget/ecc/chip/mul/complete.rs index f3c73de0..d0b71a1a 100644 --- a/src/circuit/gadget/ecc/chip/mul/complete.rs +++ b/src/circuit/gadget/ecc/chip/mul/complete.rs @@ -70,8 +70,8 @@ impl Config { // k_i = 0 => y_p = -base_y // k_i = 1 => y_p = base_y let y_switch = { - let k_minus_one = k.clone() - Expression::Constant(pallas::Base::one()); - k_minus_one * (base_y.clone() + y_p.clone()) + k * (base_y - y_p) + let one_minus_k = Expression::Constant(pallas::Base::one()) - k.clone(); + one_minus_k * (base_y.clone() + y_p.clone()) + k * (base_y - y_p) }; std::array::IntoIter::new([("bool_check", bool_check), ("y_switch", y_switch)]) diff --git a/src/circuit_description b/src/circuit_description index 00fee0d1..30ce1e99 100644 --- a/src/circuit_description +++ b/src/circuit_description @@ -7524,32 +7524,32 @@ PinnedVerificationKey { Sum( Product( Sum( - Sum( - Advice { - query_index: 10, - column_index: 9, - rotation: Rotation( - 1, - ), - }, - Negated( - Product( - Constant( - 0x0000000000000000000000000000000000000000000000000000000000000002, - ), - Advice { - query_index: 11, - column_index: 9, - rotation: Rotation( - -1, - ), - }, - ), - ), + Constant( + 0x0000000000000000000000000000000000000000000000000000000000000001, ), Negated( - Constant( - 0x0000000000000000000000000000000000000000000000000000000000000001, + Sum( + Advice { + query_index: 10, + column_index: 9, + rotation: Rotation( + 1, + ), + }, + Negated( + Product( + Constant( + 0x0000000000000000000000000000000000000000000000000000000000000002, + ), + Advice { + query_index: 11, + column_index: 9, + rotation: Rotation( + -1, + ), + }, + ), + ), ), ), ),