From e75c176181dcca744f0bd71a3f5ce7201a44ec5c Mon Sep 17 00:00:00 2001 From: therealyingtong Date: Fri, 2 Jul 2021 19:30:04 +0800 Subject: [PATCH] mul::incomplete.rs: Make offsets more intuitive --- src/circuit/gadget/ecc/chip/mul/incomplete.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/circuit/gadget/ecc/chip/mul/incomplete.rs b/src/circuit/gadget/ecc/chip/mul/incomplete.rs index 16aff5b3..08c8cbc4 100644 --- a/src/circuit/gadget/ecc/chip/mul/incomplete.rs +++ b/src/circuit/gadget/ecc/chip/mul/incomplete.rs @@ -261,8 +261,9 @@ impl Config { || Ok(pallas::Base::one()), )?; + let offset = offset + 1; // q_mul = 2 on all rows after offset 0, excluding the last row. - for idx in 1..(self.num_bits) { + for idx in 0..(self.num_bits - 1) { region.assign_fixed( || "q_mul = 2", self.q_mul, @@ -275,7 +276,7 @@ impl Config { region.assign_fixed( || "q_mul = 3", self.q_mul, - offset + self.num_bits + 1, + offset + self.num_bits, || Ok(pallas::Base::from_u64(3)), )?; }