Skip to content
This repository was archived by the owner on Aug 7, 2026. It is now read-only.
Open
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
13 changes: 11 additions & 2 deletions miden-crypto/src/dsa/falcon512_poseidon2/math/polynomial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ where
panic!();
}
if self.is_zero() {
Self::zero();
return Self::zero();
}
let mut remainder = self;
let mut quotient = Polynomial::<F>::zero();
Expand Down Expand Up @@ -671,4 +671,13 @@ mod tests {
Polynomial::reduce_negacyclic(&Polynomial::mul_modulo_p(&poly1, &poly2))
);
}
}

#[test]
fn div_zero_numerator_returns_zero() {
let zero = Polynomial::<i64>::zero();
let nonzero = Polynomial::new(vec![1i64, 2, 3]);
let result = zero / nonzero;
assert!(result.is_zero());
}

}
Loading