Skip to content

Commit

Permalink
Remove unused code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyalesokhin-starkware committed Dec 16, 2024
1 parent d541bf4 commit a079276
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 42 deletions.
2 changes: 0 additions & 2 deletions stwo_cairo_verifier/src/lib.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ pub mod verifier;

pub use fields::{BaseField, SecureField};

fn main() {}

/// An array in which each element relates (by index) to a column in the trace.
pub type ColumnArray<T> = Array<T>;

Expand Down
2 changes: 0 additions & 2 deletions stwo_cairo_verifier/src/pcs/quotients.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::fields::cm31::{CM31, CM31Impl};
use crate::fields::m31::{M31, UnreducedM31};
use crate::fields::qm31::{PackedUnreducedQM31, PackedUnreducedQM31Impl, QM31, QM31Impl};
use crate::poly::circle::{CanonicCosetImpl, CircleDomainImpl, CircleEvaluationImpl};
use crate::queries::SubCircleDomainImpl;
use crate::utils::{ArrayImpl as ArrayUtilImpl, SpanImpl, bit_reverse_index, pack4};
use crate::verifier::VerificationError;
use crate::{ColumnSpan, TreeArray, TreeSpan};
Expand Down Expand Up @@ -505,7 +504,6 @@ mod tests {
use crate::fields::m31::m31;
use crate::fields::qm31::{PackedUnreducedQM31Impl, qm31};
use crate::poly::circle::{CanonicCosetImpl, CircleDomainImpl, CircleEvaluationImpl};
use crate::queries::SubCircleDomainImpl;
use crate::utils::DictImpl;
use super::{
ColumnSampleBatch, ColumnSampleBatchImpl, ComplexConjugateLineCoeffsImpl, PointSample,
Expand Down
39 changes: 1 addition & 38 deletions stwo_cairo_verifier/src/queries.cairo
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::channel::{Channel, ChannelTrait};
use crate::circle::CosetImpl;
use crate::poly::circle::{CircleDomain, CircleDomainImpl};
use super::utils::{ArrayImpl, bit_reverse_index, pow2};
use super::utils::{ArrayImpl, pow2};

/// An ordered set of query positions.
#[derive(Drop, Copy, Debug, PartialEq)]
Expand Down Expand Up @@ -57,14 +56,6 @@ pub impl QueriesImpl of QueriesImplTrait {
}
}

/// Represents a circle domain relative to a larger circle domain. The `coset_index` is the bit
/// reversed query index in the larger domain.
#[derive(Drop, Debug, Copy)]
pub struct SubCircleDomain {
pub coset_index: usize,
pub log_size: u32,
}

/// Returns a deduped list of folded query positions.
///
/// # Panics
Expand All @@ -87,34 +78,6 @@ pub fn get_folded_query_positions(mut query_positions: Span<usize>, n_folds: u32
folded_positions.span()
}

#[generate_trait]
pub impl SubCircleDomainImpl of SubCircleDomainTrait {
/// Calculates the decommitment positions needed for each query given the fri step size.
fn to_decommitment_positions(self: @SubCircleDomain) -> Array<usize> {
let sub_circle_size = pow2(*self.log_size);
let start = *self.coset_index * sub_circle_size;
let end = start + sub_circle_size;
let mut res = array![];
for i in start..end {
res.append(i);
};
res
}

/// Returns the represented [CircleDomain].
fn to_circle_domain(self: @SubCircleDomain, query_domain: CircleDomain) -> CircleDomain {
let index = *self.coset_index * pow2(*self.log_size);
let query = bit_reverse_index(index, query_domain.log_size());
let initial_index = query_domain.index_at(query);
let half_coset = CosetImpl::new(initial_index, *self.log_size - 1);
CircleDomainImpl::new(half_coset)
}

fn size(self: @SubCircleDomain) -> usize {
pow2(*self.log_size).into()
}
}

#[cfg(test)]
mod test {
use crate::channel::ChannelTrait;
Expand Down

0 comments on commit a079276

Please sign in to comment.