Skip to content

Commit

Permalink
stark-verify finalized
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Jan 12, 2024
1 parent 9699e45 commit 541c84d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/air/traces.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct TracesCommitment {

// Responses for queries to the AIR commitment.
// The queries are usually generated by the next component down the line (e.g. FRI).
#[derive(Drop)]
#[derive(Drop, Copy)]
struct TracesDecommitment {
// Responses for queries to the original trace.
original: TableDecommitment,
Expand All @@ -46,7 +46,7 @@ struct TracesDecommitment {
}

// A witness for a decommitment of the AIR traces over queries.
#[derive(Drop)]
#[derive(Drop, Copy)]
struct TracesWitness {
original: TableCommitmentWitness,
interaction: TableCommitmentWitness,
Expand Down
2 changes: 1 addition & 1 deletion src/stark.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct StarkCommitment {
fri: FriCommitment,
}

#[derive(Drop)]
#[derive(Drop, Copy)]
struct StarkWitness {
traces_decommitment: TracesDecommitment,
traces_witness: TracesWitness,
Expand Down
20 changes: 18 additions & 2 deletions src/stark/stark_verify.cairo
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
use core::array::ArrayTrait;
use cairo_verifier::{
queries::queries::queries_to_points, domains::StarkDomains,
fri::fri::{FriDecommitment, fri_verify},
stark::{StarkUnsentCommitment, StarkWitness, StarkCommitment}, air::traces::traces_decommit,
table_commitment::table_decommit,
oods::{OodsEvaluationInfo, eval_oods_boundary_poly_at_points},
};

// STARK decommitment phase.
fn stark_verify(
n_original_columns: u32,
n_interaction_columns: u32,
queries: Span<felt252>,
commitment: StarkCommitment,
witness: StarkWitness,
Expand All @@ -28,8 +32,20 @@ fn stark_verify(
let points = queries_to_points(queries, @stark_domains);

// Evaluate the FRI input layer at query points.
let eval_info = 0;
let oods_poly_evals = ArrayTrait::<felt252>::new();
let eval_info = OodsEvaluationInfo {
oods_values: commitment.oods_values,
oods_point: commitment.interaction_after_composition,
trace_generator: stark_domains.trace_generator,
constraint_coefficients: commitment.interaction_after_oods,
};
let oods_poly_evals = eval_oods_boundary_poly_at_points(
n_original_columns,
n_interaction_columns,
eval_info,
points.span(),
witness.traces_decommitment,
witness.composition_decommitment,
);

// Decommit FRI.
let fri_decommitment = FriDecommitment {
Expand Down

0 comments on commit 541c84d

Please sign in to comment.