From a079276dbc4b6ee4271bee76a69337d4f323d666 Mon Sep 17 00:00:00 2001 From: Ilya Lesokhin Date: Mon, 16 Dec 2024 16:37:48 +0200 Subject: [PATCH] Remove unused code. --- stwo_cairo_verifier/src/lib.cairo | 2 -- stwo_cairo_verifier/src/pcs/quotients.cairo | 2 -- stwo_cairo_verifier/src/queries.cairo | 39 +-------------------- 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/stwo_cairo_verifier/src/lib.cairo b/stwo_cairo_verifier/src/lib.cairo index de7a813a..40e32b5b 100644 --- a/stwo_cairo_verifier/src/lib.cairo +++ b/stwo_cairo_verifier/src/lib.cairo @@ -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 = Array; diff --git a/stwo_cairo_verifier/src/pcs/quotients.cairo b/stwo_cairo_verifier/src/pcs/quotients.cairo index 45ae0515..2f47b8a4 100644 --- a/stwo_cairo_verifier/src/pcs/quotients.cairo +++ b/stwo_cairo_verifier/src/pcs/quotients.cairo @@ -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}; @@ -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, diff --git a/stwo_cairo_verifier/src/queries.cairo b/stwo_cairo_verifier/src/queries.cairo index e98f1276..4831b436 100644 --- a/stwo_cairo_verifier/src/queries.cairo +++ b/stwo_cairo_verifier/src/queries.cairo @@ -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)] @@ -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 @@ -87,34 +78,6 @@ pub fn get_folded_query_positions(mut query_positions: Span, 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 { - 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;