Skip to content

Commit

Permalink
use Fq::from_bytes_checked
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Jan 30, 2024
1 parent 52f644f commit f58b01e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/smol_curve/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl Encoding {

// 1/2. Reject unless s is canonically encoded and nonnegative.
// Check bytes correspond to valid field element (i.e. less than field modulus)
let s = Fq::from_bytes_check_order(&self.0).ok_or(EncodingError::InvalidEncoding)?;
let s = Fq::from_bytes_checked(&self.0).ok_or(EncodingError::InvalidEncoding)?;
if s.is_negative() {
return Err(EncodingError::InvalidEncoding);
}
Expand Down

0 comments on commit f58b01e

Please sign in to comment.