From 607d0a89cbf18eeaab026790cfda56820a14b679 Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Wed, 28 Jul 2021 10:09:35 -0700 Subject: [PATCH] fixed max_power_bits --- src/gates/exponentiation.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gates/exponentiation.rs b/src/gates/exponentiation.rs index 7498e4ab..2dd3b009 100644 --- a/src/gates/exponentiation.rs +++ b/src/gates/exponentiation.rs @@ -28,7 +28,9 @@ impl, const D: usize> ExponentiationGate { } pub fn max_power_bits(num_wires: usize, num_routed_wires: usize) -> usize { - num_wires / num_routed_wires + let max_for_routed_wires = num_routed_wires - 3; + let max_for_wires = (num_wires - 2) / 2; + max_for_routed_wires.min(max_for_wires) } pub fn wire_base(&self) -> usize {