From dd2b9ef7c43e7c4a50dff52607cf74dd7423e586 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Mon, 18 Dec 2023 18:56:08 +0100 Subject: [PATCH] fmt --- src/fri/fri_config.cairo | 15 +++++++++------ src/fri/fri_formula.cairo | 13 ++++++------- src/fri/fri_layer.cairo | 2 +- src/fri/tests/test_fri_formula.cairo | 1 + 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/fri/fri_config.cairo b/src/fri/fri_config.cairo index 85a908f88..fa1fccf53 100644 --- a/src/fri/fri_config.cairo +++ b/src/fri/fri_config.cairo @@ -26,7 +26,10 @@ fn fri_config_validate( config: FriConfig, log_n_cosets: felt252, n_verifier_friendly_commitment_layers: felt252 ) -> felt252 { assert(0_u256 <= config.log_last_layer_degree_bound.into(), 'Invalid value'); - assert(config.log_last_layer_degree_bound.try_into().unwrap() <= MAX_LAST_LAYER_LOG_DEGREE_BOUND, 'Invalid value'); + assert( + config.log_last_layer_degree_bound.try_into().unwrap() <= MAX_LAST_LAYER_LOG_DEGREE_BOUND, + 'Invalid value' + ); assert(2_u256 <= config.n_layers.into(), 'Invalid value'); assert(config.n_layers.try_into().unwrap() <= MAX_FRI_LAYERS + 1, 'Invalid value'); @@ -38,7 +41,9 @@ fn fri_config_validate( let mut sum_of_step_sizes: felt252 = 0; let mut log_input_size = config.log_input_size; loop { - if i == len { break; } + if i == len { + break; + } let fri_step: felt252 = *(config.fri_step_sizes.at(i)); let table_commitment = *(config.inner_layers.at(i)); @@ -53,9 +58,7 @@ fn fri_config_validate( sum_of_step_sizes += fri_step; validate_vector_commitment( - table_commitment.vector, - log_input_size, - n_verifier_friendly_commitment_layers, + table_commitment.vector, log_input_size, n_verifier_friendly_commitment_layers, ); }; @@ -69,4 +72,4 @@ fn validate_vector_commitment( config: VectorCommitmentConfig, expected_height: felt252, n_verifier_friendly_commitment_layers: felt252, -) {} \ No newline at end of file +) {} diff --git a/src/fri/fri_formula.cairo b/src/fri/fri_formula.cairo index be4dc7eae..4f2698178 100644 --- a/src/fri/fri_formula.cairo +++ b/src/fri/fri_formula.cairo @@ -61,18 +61,17 @@ fn fri_formula16(values: Span, eval_point: felt252, x_inv: felt252) -> // Folds 'coset_size' elements into one using log2(coset_size) layers of FRI. // 'coset_size' can be 2, 4, 8, or 16. -fn fri_formula(values: Span, eval_point: felt252, x_inv: felt252, coset_size: felt252) -> felt252 { +fn fri_formula( + values: Span, eval_point: felt252, x_inv: felt252, coset_size: felt252 +) -> felt252 { // Sort by usage frequency. if (coset_size == 8) { return fri_formula8(values, eval_point, x_inv); - } - else if (coset_size == 4) { + } else if (coset_size == 4) { return fri_formula4(values, eval_point, x_inv); - } - else if (coset_size == 16) { + } else if (coset_size == 16) { return fri_formula16(values, eval_point, x_inv); - } - else { + } else { assert(values.len() == 2, 'Values length not equal 2'); return fri_formula2(*values[0], *values[1], eval_point, x_inv); } diff --git a/src/fri/fri_layer.cairo b/src/fri/fri_layer.cairo index e70e3687d..7b3a54068 100644 --- a/src/fri/fri_layer.cairo +++ b/src/fri/fri_layer.cairo @@ -9,4 +9,4 @@ struct FriLayerQuery { index: felt252, y_value: felt252, x_inv_value: felt252, -} \ No newline at end of file +} diff --git a/src/fri/tests/test_fri_formula.cairo b/src/fri/tests/test_fri_formula.cairo index e69de29bb..8b1378917 100644 --- a/src/fri/tests/test_fri_formula.cairo +++ b/src/fri/tests/test_fri_formula.cairo @@ -0,0 +1 @@ +