Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Okm165 committed Dec 20, 2023
1 parent da9c2d3 commit 20a720d
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 33 deletions.
10 changes: 2 additions & 8 deletions src/fri/fri_config.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use core::array::ArrayTrait;
use core::option::OptionTrait;
use core::array::SpanTrait;
use core::traits::Into;
use cairo_verifier::structs::table_commitment_config::TableCommitmentConfig;
use cairo_verifier::structs::vector_commitment_config::VectorCommitmentConfig;
use cairo_verifier::table_commitment::TableCommitmentConfig;
use cairo_verifier::vector_commitment::{validate_vector_commitment, VectorCommitmentConfig};

const MAX_LAST_LAYER_LOG_DEGREE_BOUND: u32 = 15;
const MAX_FRI_LAYERS: u32 = 15;
Expand Down Expand Up @@ -69,9 +69,3 @@ fn fri_config_validate(
log_expected_input_degree
}

// ghost functions
fn validate_vector_commitment(
config: VectorCommitmentConfig,
expected_height: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {}
2 changes: 0 additions & 2 deletions src/structs.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
mod proof_of_work_config;
mod stark_config;
mod stark_proof;
mod table_commitment_config;
mod traces_config;
mod unsent_commitment;
mod vector_commitment_config;
mod witness;
2 changes: 1 addition & 1 deletion src/structs/stark_config.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use cairo_verifier::structs::traces_config::TracesConfig;
use cairo_verifier::structs::table_commitment_config::TableCommitmentConfig;
use cairo_verifier::table_commitment::TableCommitmentConfig;
use cairo_verifier::fri::fri_config::FriConfig;
use cairo_verifier::structs::proof_of_work_config::ProofOfWorkConfig;

Expand Down
7 changes: 0 additions & 7 deletions src/structs/table_commitment_config.cairo

This file was deleted.

2 changes: 1 addition & 1 deletion src/structs/traces_config.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use cairo_verifier::structs::table_commitment_config::TableCommitmentConfig;
use cairo_verifier::table_commitment::TableCommitmentConfig;

struct TracesConfig {
original: TableCommitmentConfig,
Expand Down
5 changes: 0 additions & 5 deletions src/structs/vector_commitment_config.cairo

This file was deleted.

7 changes: 4 additions & 3 deletions src/table_commitment.cairo
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use cairo_verifier::vector_commitment::VectorCommitmentConfig;

// Commitment values for a table commitment protocol. Used to generate a commitment by "reading"
// these values from the channel.
#[derive(Drop, Copy)]
Expand All @@ -16,9 +18,8 @@ struct TableCommitment {

#[derive(Drop, Copy)]
struct TableCommitmentConfig {
a: felt252, // dummy
// n_columns: felt,
// vector: VectorCommitmentConfig*,
columns: felt252,
vector: VectorCommitmentConfig
}

fn table_commit(
Expand Down
17 changes: 11 additions & 6 deletions src/vector_commitment.cairo
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
// Commitment values for a vector commitment. Used to generate a commitment by "reading" these
// values from the channel.
#[derive(Drop)]
#[derive(Drop, Copy)]
struct VectorUnsentCommitment {
a: felt252, // dummy
// commitment_hash: ChannelUnsentFelt,
}

// Commitment for a vector of field elements.
#[derive(Drop)]
#[derive(Drop, Copy)]
struct VectorCommitment {
a: felt252, // dummy
// config: VectorCommitmentConfig*,
// commitment_hash: ChannelSentFelt,
}

#[derive(Drop)]
#[derive(Drop, Copy)]
struct VectorCommitmentConfig {
a: felt252, // dummy
// height: felt,
// n_verifier_friendly_commitment_layers: felt,
height: felt252,
verifier_friendly_commitment_layers: felt252,
}

fn validate_vector_commitment(
config: VectorCommitmentConfig,
expected_height: felt252,
n_verifier_friendly_commitment_layers: felt252,
) {}

0 comments on commit 20a720d

Please sign in to comment.