From 7f2c57bec183e52b3ccb2b1de1b3f78ede287596 Mon Sep 17 00:00:00 2001 From: GarmashAlex Date: Tue, 2 Sep 2025 14:24:18 +0300 Subject: [PATCH] fix: use BigInt::from(-1) instead of invalid -1 % field --- circom_algebra/src/algebra.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circom_algebra/src/algebra.rs b/circom_algebra/src/algebra.rs index 235b7e951..856bac72f 100644 --- a/circom_algebra/src/algebra.rs +++ b/circom_algebra/src/algebra.rs @@ -898,7 +898,7 @@ impl Substitution { let symbol = substitution.from; let mut coefficients = substitution.to; ArithmeticExpression::initialize_hashmap_for_expression(&mut coefficients); - coefficients.insert(symbol, BigInt::from(-1 % field)); + coefficients.insert(symbol, BigInt::from(-1)); let arith = ArithmeticExpression::Linear { coefficients }; ArithmeticExpression::transform_expression_to_constraint_form(arith, field).unwrap() }