Skip to content

Commit

Permalink
Apply cargo fmt
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Wood <[email protected]>
  • Loading branch information
doowt authored and andrewwhitehead committed Nov 20, 2023
1 parent 107c5f1 commit e033379
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/bn/openssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -528,14 +528,13 @@ impl BigNumber {
}

pub fn random_qr(n: &BigNumber) -> ClResult<BigNumber> {

let mut sqr_candidate = n.rand_range()?;
let big_one = BigNumber::from_u32(1)?;

// Number sqr_candidate to square must be between 1 and n-1 and
// have gcd(sqr_candidate,n)=1
while Self::gcd(&sqr_candidate, n, None)? != big_one {
sqr_candidate = n.rand_range()?;
sqr_candidate = n.rand_range()?;
}

let qr = sqr_candidate.sqr(None)?.modulus(n, None)?;
Expand Down

0 comments on commit e033379

Please sign in to comment.