From 8da6b491468707f45f31bd061846656ea88bf789 Mon Sep 17 00:00:00 2001 From: nuno <41233686+qope@users.noreply.github.com> Date: Mon, 1 May 2023 00:13:56 +0900 Subject: [PATCH] fix capacity overflow error --- src/gadgets/nonnative.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/gadgets/nonnative.rs b/src/gadgets/nonnative.rs index f1c8f03..91ced0d 100644 --- a/src/gadgets/nonnative.rs +++ b/src/gadgets/nonnative.rs @@ -313,9 +313,7 @@ impl, const D: usize> CircuitBuilderNonNative ) -> NonNativeTarget { let prod = self.add_virtual_nonnative_target::(); let modulus = self.constant_biguint(&FF::order()); - let overflow = self.add_virtual_biguint_target( - a.value.num_limbs() + b.value.num_limbs() - modulus.num_limbs(), - ); + let overflow = self.add_virtual_biguint_target(modulus.num_limbs()); self.add_simple_generator(NonNativeMultiplicationGenerator:: { a: a.clone(),