Skip to content

Commit

Permalink
Fix a panic bug in bls12_381 FieldScalar::deserialize
Browse files Browse the repository at this point in the history
  • Loading branch information
elichai committed Aug 8, 2021
1 parent b046013 commit 32b0263
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/elliptic/curves/bls12_381/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl ECScalar for FieldScalar {
repr.read_be(bytes.as_ref()).unwrap();
Ok(FieldScalar {
purpose: "deserialize",
fe: Fr::from_repr(repr).unwrap().into(),
fe: Fr::from_repr(repr).or(Err(DeserializationError))?.into(),
})
}

Expand Down

0 comments on commit 32b0263

Please sign in to comment.