Skip to content

Commit

Permalink
chore: fix post rebase issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Al-Kindi-0 committed Aug 30, 2024
1 parent 344c995 commit 4d6514c
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 55 deletions.
5 changes: 0 additions & 5 deletions air/src/air/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,6 @@ impl<B: StarkField, P> AirContext<B, P> {
self.logup_gkr
}

/// Returns true if the auxiliary trace segment contains a Lagrange kernel column
pub fn is_with_logup_gkr(&self) -> bool {
self.logup_gkr
}

/// Returns the total number of assertions defined for a computation, excluding the Lagrange
/// kernel assertion, which is managed separately.
///
Expand Down
2 changes: 1 addition & 1 deletion air/src/air/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub use lagrange::{

mod logup_gkr;
pub use logup_gkr::{
LogUpGkrEvaluator, LogUpGkrOracle, PhantomLogUpGkrEval, LAGRANGE_KERNEL_OFFSET, S_COLUMN_OFFSET,
LogUpGkrEvaluator, LogUpGkrOracle, LAGRANGE_KERNEL_OFFSET, S_COLUMN_OFFSET,
};

mod coefficients;
Expand Down
2 changes: 1 addition & 1 deletion air/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ pub use air::{
DeepCompositionCoefficients, EvaluationFrame, GkrData,
LagrangeConstraintsCompositionCoefficients, LagrangeKernelBoundaryConstraint,
LagrangeKernelConstraints, LagrangeKernelEvaluationFrame, LagrangeKernelRandElements,
LagrangeKernelTransitionConstraints, LogUpGkrEvaluator, LogUpGkrOracle, PhantomLogUpGkrEval,
LagrangeKernelTransitionConstraints, LogUpGkrEvaluator, LogUpGkrOracle,
TraceInfo, TransitionConstraintDegree, TransitionConstraints, LAGRANGE_KERNEL_OFFSET,
S_COLUMN_OFFSET,
};
2 changes: 1 addition & 1 deletion prover/src/constraints/evaluator/logup_gkr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ where

let mut lagrange_frame = LagrangeKernelEvaluationFrame::new_empty();

let evaluator = self.air.get_logup_gkr_evaluator::<E::BaseField>();
let evaluator = self.air.get_logup_gkr_evaluator();
let s_col_constraint_divisor =
compute_s_col_divisor::<E>(domain.ce_domain_size(), domain, self.air.trace_length());
let s_col_idx = trace.trace_info().aux_segment_width() - S_COLUMN_OFFSET;
Expand Down
2 changes: 1 addition & 1 deletion prover/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub trait Prover {
fn build_aux_trace<E>(
&self,
main_trace: &Self::Trace,
aux_rand_elements: &AuxRandElements<E>,
aux_rand_elements: &[E],
) -> ColMatrix<E>
where
E: FieldElement<BaseField = Self::BaseField>,
Expand Down
2 changes: 1 addition & 1 deletion prover/src/logup_gkr/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn prove_gkr<E: FieldElement>(
build_mls_from_main_trace_segment(evaluator.get_oracles(), main_trace.main_segment())?;

let final_layer_proof =
prove_input_layer(evaluator, logup_randomness, &mut main_trace_mls, gkr_claim, public_coin)?;
prove_input_layer(evaluator, logup_randomness, main_trace_mls, gkr_claim, public_coin)?;

Ok(GkrCircuitProof {
circuit_outputs: CircuitOutput { numerators, denominators },
Expand Down
9 changes: 1 addition & 8 deletions prover/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use alloc::vec::Vec;

use air::{
Air, AirContext, Assertion, EvaluationFrame, FieldExtension, PhantomLogUpGkrEval, ProofOptions,
Air, AirContext, Assertion, EvaluationFrame, FieldExtension, ProofOptions,
TraceInfo, TransitionConstraintDegree,
};
use math::{fields::f64::BaseElement, FieldElement, StarkField};
Expand Down Expand Up @@ -104,13 +104,6 @@ impl Air for MockAir {
fn get_periodic_column_values(&self) -> Vec<Vec<Self::BaseField>> {
self.periodic_columns.clone()
}

fn get_logup_gkr_evaluator<B: StarkField>(
&self,
) -> impl air::LogUpGkrEvaluator<BaseField = Self::BaseField, PublicInputs = Self::PublicInputs>
{
PhantomLogUpGkrEval::default()
}
}

// HELPER FUNCTIONS
Expand Down
4 changes: 2 additions & 2 deletions verifier/src/evaluator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ pub fn evaluate_constraints<A: Air, E: FieldElement<BaseField = A::BaseField>>(
.mul_base(E::BaseField::ONE / E::BaseField::from(air.trace_length() as u32));

let mut query =
vec![E::ZERO; air.get_logup_gkr_evaluator::<E::BaseField>().get_oracles().len()];
air.get_logup_gkr_evaluator::<E::BaseField>().build_query(
vec![E::ZERO; air.get_logup_gkr_evaluator().get_oracles().len()];
air.get_logup_gkr_evaluator().build_query(
main_trace_frame,
&[],
&mut query,
Expand Down
35 changes: 0 additions & 35 deletions verifier/src/logup_gkr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,38 +113,3 @@ pub enum VerifierError {
#[error("failed to verify the sum-check proof")]
FailedToVerifySumCheck(#[from] SumCheckVerifierError),
}

// UNIVARIATE IOP FOR MULTI-LINEAR EVALUATION
// ===============================================================================================

/// Generates the batching randomness used to batch a number of multi-linear evaluation claims.
///
/// This is the $\lambda$ randomness in section 5.2 in [1] but using different random values for
/// each term instead of powers of a single random element.
///
/// [1]: https://eprint.iacr.org/2023/1284
pub fn generate_gkr_randomness<
E: FieldElement,
C: RandomCoin<Hasher = H, BaseField = E::BaseField>,
H: ElementHasher<BaseField = E::BaseField>,
>(
final_opening_claim: FinalOpeningClaim<E>,
oracles: &[LogUpGkrOracle<E::BaseField>],
public_coin: &mut C,
) -> GkrData<E> {
let FinalOpeningClaim { eval_point, openings } = final_opening_claim;

public_coin.reseed(H::hash_elements(&openings));

let mut batching_randomness = Vec::with_capacity(openings.len() - 1);
for _ in 0..openings.len() - 1 {
batching_randomness.push(public_coin.draw().expect("failed to generate randomness"))
}

GkrData::new(
LagrangeKernelRandElements::new(eval_point),
batching_randomness,
openings,
oracles.to_vec(),
)
}

0 comments on commit 4d6514c

Please sign in to comment.