Skip to content

Commit

Permalink
o1vm/pickles: Fix typo for vanishing poly
Browse files Browse the repository at this point in the history
  • Loading branch information
Fizzixnerd committed Oct 18, 2024
1 parent 20624f1 commit c04003a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions o1vm/src/pickles/column_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pub struct ColumnEnvironment<'a, F: FftField> {
}

pub fn get_all_columns() -> Vec<Column> {
let mut cols = Vec::<Column>::with_capacity(SCRATCH_SIZE + N_MIPS_SEL_COLS);
for i in 0..SCRATCH_SIZE {
let mut cols = Vec::<Column>::with_capacity(SCRATCH_SIZE + 2 + N_MIPS_SEL_COLS);
for i in 0..SCRATCH_SIZE + 2 {
cols.push(Column::Relation(i));
}
for i in 0..N_MIPS_SEL_COLS {
Expand Down
10 changes: 1 addition & 9 deletions o1vm/src/pickles/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,6 @@ fn test_regression_selectors_for_instructions() {

#[test]
fn test_small_circuit() {
/* domain: EvaluationDomains<G::ScalarField>,
srs: &SRS<G>,
inputs: ProofInputs<G>,
constraints: &[E<G::ScalarField>],
rng: &mut RNG,
*/
debug!("0");
let domain = EvaluationDomains::<Fq>::create(8).unwrap();
let srs = SRS::create(8);
let proof_input = ProofInputs::<Pallas> {
Expand Down Expand Up @@ -129,9 +122,8 @@ fn test_small_circuit() {
],
},
};
debug!("1");
let mut expr = Expr::literal(Fq::zero());
for i in 0..SCRATCH_SIZE {
for i in 0..SCRATCH_SIZE + 2 {
expr += Expr::cell(Column::Relation(i), CurrOrNext::Curr);
}
expr *= Expr::cell(Column::DynamicSelector(0), CurrOrNext::Curr);
Expand Down
18 changes: 11 additions & 7 deletions o1vm/src/pickles/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use ark_ec::{AffineRepr, Group};
use ark_ff::{Field, One, PrimeField, Zero};
use rand::thread_rng;
use log::debug;

use kimchi::{
circuits::{
Expand Down Expand Up @@ -148,8 +149,14 @@ where
fr_sponge.absorb(&zeta_omega_evaluations.instruction_counter);
fr_sponge.absorb(&zeta_evaluations.error);
fr_sponge.absorb(&zeta_omega_evaluations.error);
fr_sponge.absorb_multiple(&zeta_evaluations.selector);
fr_sponge.absorb_multiple(&zeta_omega_evaluations.selector);
for (zeta_eval, zeta_omega_eval) in zeta_evaluations
.selector
.iter()
.zip(zeta_omega_evaluations.selector.iter())
{
fr_sponge.absorb(zeta_eval);
fr_sponge.absorb(zeta_omega_eval);
}
fr_sponge.absorb(&quotient_evaluations.zeta);
fr_sponge.absorb(&quotient_evaluations.zeta_omega);

Expand Down Expand Up @@ -193,9 +200,6 @@ where
)
.unwrap_or_else(|_| panic!("Could not evaluate quotient polynomial at zeta_omega"));

fr_sponge.absorb(&quotient_eval_zeta);
fr_sponge.absorb(&quotient_eval_zeta_omega);

let v_chal = fr_sponge.challenge();
let v = v_chal.to_field(endo_r);
let u_chal = fr_sponge.challenge();
Expand Down Expand Up @@ -245,7 +249,7 @@ where

let batch = BatchEvaluationProof {
sponge: fq_sponge_before_commitments_and_evaluations,
evaluations: evaluations,
evaluations,
evaluation_points: vec![zeta, zeta_omega],
polyscale: v,
evalscale: u,
Expand All @@ -257,6 +261,6 @@ where

// Check the actual quotient works.
(quotient_eval_zeta
== quotient_evaluations.zeta * zeta.pow([domain.d1.size]) - G::ScalarField::one())
== quotient_evaluations.zeta * (zeta.pow([domain.d1.size]) - G::ScalarField::one()))
&& OpeningProof::verify(srs, &group_map, &mut [batch], &mut thread_rng())
}

0 comments on commit c04003a

Please sign in to comment.