@@ -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,65 @@ 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+ commit_proof_of_work_bits : 16 ,
86+ query_proof_of_work_bits : 20 ,
87+ } ,
88+ 2 => FriParameters {
89+ log_blowup,
90+ log_final_poly_len : 0 ,
91+ num_queries : 118 ,
92+ commit_proof_of_work_bits : 12 ,
93+ query_proof_of_work_bits : 20 ,
94+ } ,
95+ 3 => FriParameters {
96+ log_blowup,
97+ log_final_poly_len : 0 ,
98+ num_queries : 97 ,
99+ commit_proof_of_work_bits : 12 ,
100+ query_proof_of_work_bits : 20 ,
101+ } ,
102+ 4 => FriParameters {
103+ log_blowup,
104+ log_final_poly_len : 0 ,
105+ num_queries : 88 ,
106+ commit_proof_of_work_bits : 12 ,
107+ query_proof_of_work_bits : 20 ,
108+ } ,
109+ _ => todo ! ( "No standard FRI params defined for log blowup {log_blowup}" , ) ,
110+ } ;
111+ tracing:: debug!( "FRI parameters | log_blowup: {log_blowup:<2} | num_queries: {:<2} | commit_proof_of_work_bits: {:<2} | query_proof_of_work_bits: {:<2}" , fri_params. num_queries, fri_params. commit_proof_of_work_bits, fri_params. query_proof_of_work_bits) ;
112+ fri_params
113+ }
114+
60115/// Pre-defined FRI parameters with 100 bits of conjectured security.
61116/// Security bits calculated following ethSTARK (<https://eprint.iacr.org/2021/582.pdf>) 5.10.1 eq (19)
62117///
63118/// Assumes that the challenge field used as more than 100 bits.
119+ #[ deprecated( note = "use standard_fri_params_with_100_bits_security instead" ) ]
64120pub fn standard_fri_params_with_100_bits_conjectured_security ( log_blowup : usize ) -> FriParameters {
65121 let fri_params = match log_blowup {
66122 // plonky2 standard fast config uses num_queries=84: https://github.com/0xPolygonZero/plonky2/blob/41dc325e61ab8d4c0491e68e667c35a4e8173ffa/starky/src/config.rs#L49
@@ -116,7 +172,7 @@ impl SecurityParameters {
116172 }
117173 pub fn standard_100_bits_with_fri_log_blowup ( log_blowup : usize ) -> Self {
118174 Self {
119- fri_params : FriParameters :: standard_with_100_bits_conjectured_security ( log_blowup) ,
175+ fri_params : FriParameters :: standard_with_100_bits_security ( log_blowup) ,
120176 log_up_params : log_up_security_params_baby_bear_100_bits ( ) ,
121177 }
122178 }
0 commit comments