diff --git a/src/fields/mod.rs b/src/fields/mod.rs index 5c060136..41e2e88f 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"), ),