From 3c8d57ace8205422951b5e7824961f9d74772d2d Mon Sep 17 00:00:00 2001 From: anim001k <140460766+anim001k@users.noreply.github.com> Date: Sun, 10 Aug 2025 19:32:21 +0200 Subject: [PATCH] Update mod.rs --- src/fields/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fields/mod.rs b/src/fields/mod.rs index 5c06013..41e2e88 100644 --- a/src/fields/mod.rs +++ b/src/fields/mod.rs @@ -186,7 +186,10 @@ pub trait FieldVar: match cs { // If we're in the constant case, we just allocate a new constant having value equalling // `self * d.inverse()`. - ConstraintSystemRef::None => Self::new_constant( + ConstraintSystemRef::None => { + let denom_inv = d.value()?.inverse().ok_or(SynthesisError::Unsatisfiable)?; + Self::new_constant(cs, self.value()? * denom_inv) + }, cs, self.value()? * d.value()?.inverse().expect("division by zero"), ),