Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

fix: Divide field by zero #485

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions acir_field/src/generic_ark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,9 @@ impl<F: PrimeField> Mul for FieldElement<F> {
}
impl<F: PrimeField> Div for FieldElement<F> {
type Output = FieldElement<F>;
#[allow(clippy::suspicious_arithmetic_impl)]
fn div(self, rhs: FieldElement<F>) -> Self::Output {
self * rhs.inverse()
fn div(mut self, rhs: FieldElement<F>) -> Self::Output {
self.0.div_assign(&rhs.0);
FieldElement(self.0)
}
}
impl<F: PrimeField> Add for FieldElement<F> {
Expand Down