@@ -26,13 +26,19 @@ impl FriParameters {
2626 }
2727
2828 pub fn standard_fast ( ) -> Self {
29- standard_fri_params_with_100_bits_conjectured_security ( 1 )
29+ standard_fri_params_with_100_bits_security ( 1 )
3030 }
3131
32+ #[ deprecated( note = "use standard_with_100_bits_security instead" ) ]
3233 pub fn standard_with_100_bits_conjectured_security ( log_blowup : usize ) -> Self {
34+ #[ allow( deprecated) ]
3335 standard_fri_params_with_100_bits_conjectured_security ( log_blowup)
3436 }
3537
38+ pub fn standard_with_100_bits_security ( log_blowup : usize ) -> Self {
39+ standard_fri_params_with_100_bits_security ( log_blowup)
40+ }
41+
3642 pub fn max_constraint_degree ( & self ) -> usize {
3743 ( 1 << self . log_blowup ) + 1
3844 }
@@ -41,7 +47,7 @@ impl FriParameters {
4147 /// If the environment variable `OPENVM_FAST_TEST` is set to "1", then the parameters are **not
4248 /// secure** and meant for fast testing only.
4349 ///
44- /// In production, use `Self::standard_with_100_bits_conjectured_security ` instead.
50+ /// In production, use `Self::standard_with_100_bits_security ` instead.
4551 pub fn new_for_testing ( log_blowup : usize ) -> Self {
4652 if let Ok ( "1" ) = std:: env:: var ( "OPENVM_FAST_TEST" ) . as_deref ( ) {
4753 Self {
@@ -52,15 +58,61 @@ impl FriParameters {
5258 query_proof_of_work_bits : 0 ,
5359 }
5460 } else {
55- Self :: standard_with_100_bits_conjectured_security ( log_blowup)
61+ Self :: standard_with_100_bits_security ( log_blowup)
5662 }
5763 }
5864}
5965
66+ /// Pre-defined FRI parameters with 100 bits of provable security, meaning we do
67+ /// not rely on any conjectures about Reed–Solomon codes (e.g., about proximity
68+ /// gaps) or the ethSTARK Toy Problem Conjecture.
69+ ///
70+ /// The value `num_queries` is chosen so that the verifier accepts a δ-far
71+ /// codeword for δ = (1 - 2**(-log_blowup)) with probability at most 2^{-80}.
72+ /// I.e., we target the unique-decoding radius. We require 20 PoW bits
73+ /// just before the query phase begins to boost the soundness to 100 bits.
74+ ///
75+ /// Assumes that:
76+ /// - the challenge field has size at least 2^123
77+ /// - for `log_blowup = 1`, multi-FRI will be run with at most width 30000 at any level
78+ /// - for `log_blowup > 1`, multi-FRI will be run with at most width 2000 at any level
79+ pub fn standard_fri_params_with_100_bits_security ( log_blowup : usize ) -> FriParameters {
80+ let fri_params = match log_blowup {
81+ 1 => FriParameters {
82+ log_blowup,
83+ log_final_poly_len : 0 ,
84+ num_queries : 193 ,
85+ proof_of_work_bits : 20 ,
86+ } ,
87+ 2 => FriParameters {
88+ log_blowup,
89+ log_final_poly_len : 0 ,
90+ num_queries : 118 ,
91+ proof_of_work_bits : 20 ,
92+ } ,
93+ 3 => FriParameters {
94+ log_blowup,
95+ log_final_poly_len : 0 ,
96+ num_queries : 97 ,
97+ proof_of_work_bits : 20 ,
98+ } ,
99+ 4 => FriParameters {
100+ log_blowup,
101+ log_final_poly_len : 0 ,
102+ num_queries : 88 ,
103+ proof_of_work_bits : 20 ,
104+ } ,
105+ _ => todo ! ( "No standard FRI params defined for log blowup {log_blowup}" , ) ,
106+ } ;
107+ tracing:: debug!( "FRI parameters | log_blowup: {log_blowup:<2} | num_queries: {:<2} | proof_of_work_bits: {:<2}" , fri_params. num_queries, fri_params. proof_of_work_bits) ;
108+ fri_params
109+ }
110+
60111/// Pre-defined FRI parameters with 100 bits of conjectured security.
61112/// Security bits calculated following ethSTARK (<https://eprint.iacr.org/2021/582.pdf>) 5.10.1 eq (19)
62113///
63114/// Assumes that the challenge field used as more than 100 bits.
115+ #[ deprecated( note = "use standard_fri_params_with_100_bits_security instead" ) ]
64116pub fn standard_fri_params_with_100_bits_conjectured_security ( log_blowup : usize ) -> FriParameters {
65117 let fri_params = match log_blowup {
66118 // plonky2 standard fast config uses num_queries=84: https://github.com/0xPolygonZero/plonky2/blob/41dc325e61ab8d4c0491e68e667c35a4e8173ffa/starky/src/config.rs#L49
@@ -116,7 +168,7 @@ impl SecurityParameters {
116168 }
117169 pub fn standard_100_bits_with_fri_log_blowup ( log_blowup : usize ) -> Self {
118170 Self {
119- fri_params : FriParameters :: standard_with_100_bits_conjectured_security ( log_blowup) ,
171+ fri_params : FriParameters :: standard_with_100_bits_security ( log_blowup) ,
120172 log_up_params : log_up_security_params_baby_bear_100_bits ( ) ,
121173 }
122174 }
0 commit comments