Skip to content

Commit

Permalink
naming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Dec 22, 2023
1 parent fdf4c76 commit f49f8b0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions src/fri/fri.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fn fri_commit(
}
}

fn fri_decommit_layers(
fn fri_verify_layers(
fri_group: Span<felt252>,
n_layers: felt252,
commitment: Span<TableCommitment>,
Expand Down Expand Up @@ -184,7 +184,7 @@ fn fri_decommit_layers(
}

// FRI protocol component decommitment.
fn fri_decommit(
fn fri_verify(
queries: Span<felt252>,
commitment: FriCommitment,
decommitment: FriDecommitment,
Expand All @@ -200,8 +200,8 @@ fn fri_decommit(
// Compute fri_group.
let fri_group = get_fri_group();

// Decommit inner layers.
let last_queries = fri_decommit_layers(
// Verify inner layers.
let last_queries = fri_verify_layers(
fri_group.span(),
commitment.config.n_layers - 1,
commitment.inner_layers,
Expand Down
4 changes: 2 additions & 2 deletions src/fri/fri_first_layer.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use core::traits::TryInto;

use cairo_verifier::common::math;
use cairo_verifier::fri::fri_layer::FriLayerQuery;
use cairo_verifier::FIELD_GENERATOR_INV;
use cairo_verifier::FIELD_GENERATOR_INVERSE;

fn gather_first_layer_queries(
queries: Span<felt252>, evaluations: Span<felt252>, x_values: Span<felt252>
Expand All @@ -20,7 +20,7 @@ fn gather_first_layer_queries(
}

// Translate the coset to the homogenous group to have simple FRI equations.
let shifted_x_value = *(x_values.at(i)) * FIELD_GENERATOR_INV;
let shifted_x_value = *(x_values.at(i)) * FIELD_GENERATOR_INVERSE;

fri_queries
.append(
Expand Down
4 changes: 2 additions & 2 deletions src/fri/fri_last_layer.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ fn verify_last_layer(queries: Span<FriLayerQuery>, coefficients: Span<ChannelSen
break;
}
let value = horner_eval::horner_eval(
coefficients, math::mul_inverse(*(queries.at(i)).x_inv_value)
coefficients, math::mul_inverse(*queries.at(i).x_inv_value)
);
assert(value == *(queries.at(i)).y_value, '');
assert(value == *queries.at(i).y_value, '');
i += 1;
}
}
2 changes: 1 addition & 1 deletion src/fri/fri_layer.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ fn compute_coset_elements(
coset_x_inv = (*queries.at(i).x_inv_value) * (*fri_group.at(i + j));
i += 1;
} else {
coset_elements.append(*(sibling_witness.at(j)));
coset_elements.append(*sibling_witness.at(j));
j += 1;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const FIELD_GENERATOR: felt252 = 3;
const FIELD_GENERATOR_INV: felt252 =
const FIELD_GENERATOR_INVERSE: felt252 =
1206167596222043737899107594365023368541035738443865566657697352045290673494;

mod channel;
Expand Down

0 comments on commit f49f8b0

Please sign in to comment.