|
2 | 2 |
|
3 | 3 | use field::{Field, TwoAdicField}; |
4 | 4 | use poly::*; |
5 | | -use std::f64::consts::LOG2_10; |
| 5 | +const LOG2_3: f64 = 1.58496250072; |
6 | 6 |
|
7 | 7 | /// Defines the folding factor for polynomial commitments. |
8 | 8 | #[derive(Debug, Clone, Copy)] |
@@ -431,16 +431,15 @@ impl SecurityAssumption { |
431 | 431 | /// E.g. in JB proximity gaps holds for every δ ∈ (0, 1 - √ρ). |
432 | 432 | /// η is the distance between the chosen proximity parameter and the bound. |
433 | 433 | /// 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. |
435 | 434 | #[must_use] |
436 | 435 | pub const fn log_eta(&self, log_inv_rate: usize) -> f64 { |
437 | 436 | match self { |
438 | 437 | // We don't use η in UD |
439 | 438 | 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), |
444 | 443 | } |
445 | 444 | } |
446 | 445 |
|
@@ -480,15 +479,14 @@ impl SecurityAssumption { |
480 | 479 | Self::UniqueDecoding => (log_degree + log_inv_rate) as f64, |
481 | 480 |
|
482 | 481 | 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": |
485 | 483 | let eta = 2_f64.powf(log_eta); |
486 | 484 | let rho = 1. / f64::from(1 << log_inv_rate); |
487 | 485 | let rho_sqrt = rho.sqrt(); |
488 | 486 | let gamma = 1. - rho_sqrt - eta; |
489 | 487 | let n = (1usize << (log_degree + log_inv_rate)) as f64; |
490 | 488 | 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; |
492 | 490 | let den_1 = 3. * rho * rho_sqrt; |
493 | 491 | let num_2 = m + 0.5; |
494 | 492 | let den_2 = rho_sqrt; |
|
0 commit comments