diff --git a/CHANGELOG.md b/CHANGELOG.md index a0bda13c4..f45ff4b4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ## Pending - (`ark-poly`) Reduce the number of field multiplications performed by `SparseMultilinearExtension::evaluate` and `DenseMultilinearExtension::evaluate` +- [\#610](https://github.com/arkworks-rs/algebra/pull/610) (`ark-ec`) Fix panic in `final_exponentiation` step for MNT4/6 curves if inverse does not exist. ### Breaking changes diff --git a/ec/src/models/mnt4/mod.rs b/ec/src/models/mnt4/mod.rs index dc292ba73..cd9490e7c 100644 --- a/ec/src/models/mnt4/mod.rs +++ b/ec/src/models/mnt4/mod.rs @@ -60,7 +60,7 @@ pub trait MNT4Config: 'static + Sized { fn final_exponentiation(f: MillerLoopOutput>) -> Option>> { let value = f.0; - let value_inv = value.inverse().unwrap(); + let value_inv = value.inverse()?; let value_to_first_chunk = MNT4::::final_exponentiation_first_chunk(&value, &value_inv); let value_inv_to_first_chunk = diff --git a/ec/src/models/mnt6/mod.rs b/ec/src/models/mnt6/mod.rs index 53d4f2ca8..d01dadac7 100644 --- a/ec/src/models/mnt6/mod.rs +++ b/ec/src/models/mnt6/mod.rs @@ -61,7 +61,7 @@ pub trait MNT6Config: 'static + Sized { fn final_exponentiation(f: MillerLoopOutput>) -> Option>> { let value = f.0; - let value_inv = value.inverse().unwrap(); + let value_inv = value.inverse()?; let value_to_first_chunk = MNT6::::final_exponentiation_first_chunk(&value, &value_inv); let value_inv_to_first_chunk =