From b66ad6c96ab057a48e986c968ea816a75c815e08 Mon Sep 17 00:00:00 2001 From: Nicholas Ward Date: Tue, 27 Jul 2021 12:34:47 -0700 Subject: [PATCH] added debug assert --- src/gates/exponentiation.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gates/exponentiation.rs b/src/gates/exponentiation.rs index ae0f5d49..b7d699f6 100644 --- a/src/gates/exponentiation.rs +++ b/src/gates/exponentiation.rs @@ -22,9 +22,10 @@ pub(crate) struct ExponentiationGate, const D: usize> { } impl, const D: usize> ExponentiationGate { - pub fn new(power_bits: usize) -> Self { + pub fn new(num_power_bits: usize) -> Self { + debug_assert!(num_power_bits < MAX_POWER_BITS); Self { - num_power_bits: power_bits, + num_power_bits, _phantom: PhantomData, } }