Skip to content

Commit 57f4c31

Browse files
committed
typo in JohnsonBound formula
1 parent d5ab698 commit 57f4c31

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

crates/whir/src/config.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
use field::{Field, TwoAdicField};
44
use poly::*;
5-
use std::f64::consts::LOG2_10;
5+
const LOG2_3: f64 = 1.58496250072;
66

77
/// Defines the folding factor for polynomial commitments.
88
#[derive(Debug, Clone, Copy)]
@@ -431,16 +431,15 @@ impl SecurityAssumption {
431431
/// E.g. in JB proximity gaps holds for every δ ∈ (0, 1 - √ρ).
432432
/// η is the distance between the chosen proximity parameter and the bound.
433433
/// I.e. in JB δ = 1 - √ρ - η and in CB δ = 1 - ρ - η.
434-
// TODO: Maybe it makes more sense to be multiplicative. I think this can be set in a better way.
435434
#[must_use]
436435
pub const fn log_eta(&self, log_inv_rate: usize) -> f64 {
437436
match self {
438437
// We don't use η in UD
439438
Self::UniqueDecoding => panic!(),
440-
// Set as √ρ/20
441-
Self::JohnsonBound => -(0.5 * log_inv_rate as f64 + LOG2_10 + 1.),
442-
// Set as ρ/20
443-
Self::CapacityBound => -(log_inv_rate as f64 + LOG2_10 + 1.),
439+
// Set as √ρ/6 — gives m = 3 (theorem minimum), reducing folding PoW
440+
Self::JohnsonBound => -(0.5 * log_inv_rate as f64 + 1. + LOG2_3),
441+
// Set as ρ/6
442+
Self::CapacityBound => -(log_inv_rate as f64 + 1. + LOG2_3),
444443
}
445444
}
446445

@@ -480,15 +479,14 @@ impl SecurityAssumption {
480479
Self::UniqueDecoding => (log_degree + log_inv_rate) as f64,
481480

482481
Self::JohnsonBound => {
483-
// see https://eprint.iacr.org/2025/2055.pdf
484-
// TODO double check
482+
// From Theorem 1.5 in [BCSS25] "On Proximity Gaps for Reed-Solomon Codes":
485483
let eta = 2_f64.powf(log_eta);
486484
let rho = 1. / f64::from(1 << log_inv_rate);
487485
let rho_sqrt = rho.sqrt();
488486
let gamma = 1. - rho_sqrt - eta;
489487
let n = (1usize << (log_degree + log_inv_rate)) as f64;
490488
let m = (rho_sqrt / (2. * eta)).ceil().max(3.);
491-
let num_1 = 2. * (m + 0.5).powi(5) + 3. * (m + 0.5) * gamma * rho * n;
489+
let num_1 = (2. * (m + 0.5).powi(5) + 3. * (m + 0.5) * gamma * rho) * n;
492490
let den_1 = 3. * rho * rho_sqrt;
493491
let num_2 = m + 0.5;
494492
let den_2 = rho_sqrt;

0 commit comments

Comments
 (0)