Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangxiecrypto committed Jul 22, 2024
1 parent 6347cca commit 22ee48a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/mpz-core/src/lpn_estimator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl LpnEstimator {
if start < 10 {
start = 0;
} else {
start = start - 10;
start -= 10;
}

for l in start..=end + 10 {
Expand Down Expand Up @@ -303,7 +303,7 @@ impl LpnEstimator {
if start < 5 {
start = 0;
} else {
start = start - 5;
start -= 5;
}
for l in start..end + 5 {
let min_middle = Self::min_sub_bjmm_isd_binary_with_fixed_p2_and_l(n, k, t, p2, l);
Expand Down Expand Up @@ -349,7 +349,7 @@ impl LpnEstimator {
pub fn security_under_sd_binary(n: u64, k: u64, t: u64) -> f64 {
let cost = (n - t + 1) as f64 / (n - k - t) as f64;

let cost = cost.log2() * 2.0 * t as f64 + 2 as f64;
let cost = cost.log2() * 2.0 * t as f64 + 2.0;

((k + 1) as f64).log2() + cost
}
Expand Down Expand Up @@ -407,7 +407,7 @@ impl LpnEstimator {
let t = t as u128;
let f = f as u128;
let mu = mu as u128;
let beta = (n / t) as u128;
let beta = n / t;

let beta_minus_mu_minus_one = beta - mu - 1;

Expand All @@ -424,7 +424,7 @@ impl LpnEstimator {
}

let beta_minus_one = beta - 1;
let t_minus_f = t as u128 - f;
let t_minus_f = t - f;

let mut b1 = 0;
let mut b2 = 0;
Expand Down

0 comments on commit 22ee48a

Please sign in to comment.