Skip to content

Commit

Permalink
adjust structs
Browse files Browse the repository at this point in the history
  • Loading branch information
neotheprogramist committed Jan 8, 2024
1 parent ee31a2c commit d84619c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/domains.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use cairo_verifier::{
};

// Information about the domains that are used in the stark proof.
#[derive(Drop)]
struct StarkDomains {
// Log2 of the evaluation domain size.
log_eval_domain_size: felt252,
Expand Down
8 changes: 4 additions & 4 deletions src/structs/stark_config.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const MAX_N_COLUMNS: felt252 = 128;
const AIR_LAYOUT_N_ORIGINAL_COLUMNS: felt252 = 12;
const AIR_LAYOUT_N_INTERACTION_COLUMNS: felt252 = 3;

#[derive(Drop, Serde)]
#[derive(Drop, Clone, Serde)]
struct StarkConfig {
traces: TracesConfig,
composition: TableCommitmentConfig,
Expand Down Expand Up @@ -45,7 +45,7 @@ fn stark_config_validate(stark_config: StarkConfig, security_bits: felt252) {
);
}

#[derive(Drop, Serde)]
#[derive(Drop, Clone, Serde)]
struct TracesConfig {
original: TableCommitmentConfig,
interaction: TableCommitmentConfig,
Expand Down Expand Up @@ -73,7 +73,7 @@ fn traces_config_validate(
);
}

#[derive(Drop, Serde)]
#[derive(Drop, Clone, Serde)]
struct FriConfig {
// Log2 of the size of the input layer to FRI.
log_input_size: felt252,
Expand Down Expand Up @@ -120,7 +120,7 @@ impl IntoDeserializationUnfriendlyFriConfig of Into<FriConfig, DeserializationUn
}
}

#[derive(Drop, Serde)]
#[derive(Drop, Clone, Serde)]
struct ProofOfWorkConfig {
// Proof of work difficulty (number of bits required to be 0).
n_bits: felt252,
Expand Down
14 changes: 10 additions & 4 deletions src/structs/stark_proof.cairo
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use cairo_verifier::structs::{
stark_config::{StarkConfig, stark_config_validate}, public_input::PublicInput,
stark_unsent_commitment::StarkUnsentCommitment, stark_witness::StarkWitness,
use core::clone::Clone;
use cairo_verifier::{
domains::stark_domains_create,
structs::{
stark_config::{StarkConfig, stark_config_validate}, public_input::PublicInput,
stark_unsent_commitment::StarkUnsentCommitment, stark_witness::StarkWitness
}
};

const SECURITY_BITS: felt252 = 9;
Expand All @@ -15,5 +19,7 @@ struct StarkProof {
}

fn verify_stark_proof(proof: StarkProof) {
stark_config_validate(proof.config, SECURITY_BITS);
let config = proof.config;
stark_config_validate(config.clone(), SECURITY_BITS);
let stark_domains = stark_domains_create(config);
}
2 changes: 1 addition & 1 deletion src/vector_commitment/vector_commitment.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct VectorCommitment {
commitment_hash: felt252
}

#[derive(Drop, Copy, Serde)]
#[derive(Drop, Copy, Clone, Serde)]
struct VectorCommitmentConfig {
height: felt252,
n_verifier_friendly_commitment_layers: felt252,
Expand Down

0 comments on commit d84619c

Please sign in to comment.