Skip to content

Commit

Permalink
fix random_range with openssl backend
Browse files Browse the repository at this point in the history
Co-authored-by: Mario Scuro <[email protected]>
Co-authored-by: Nicola Smaniotto <[email protected]>
Signed-off-by: Nicola Smaniotto <[email protected]>
  • Loading branch information
2 people authored and mikelodder7 committed Jun 12, 2024
1 parent 0821adf commit 899155e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openssl_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl Bn {
panic!("lower bound is greater than or equal to upper bound");
}
let mut range = BigNum::new().unwrap();
BigNumRef::checked_sub(&mut range, &lower.0, &upper.0).unwrap();
BigNumRef::checked_sub(&mut range, &upper.0, &lower.0).unwrap();
let mut r = Self::random(&Self(range));
r += lower;
r
Expand Down

0 comments on commit 899155e

Please sign in to comment.