Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stwo logup-gkr, proving a single lookup #2579

Draft
wants to merge 23 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ p3-commit = { git = "https://github.com/plonky3/Plonky3.git", rev = "2192432ddf2
], optional = true }
p3-matrix = { git = "https://github.com/plonky3/Plonky3.git", rev = "2192432ddf28e7359dd2c577447886463e6124f0", optional = true }
p3-uni-stark = { git = "https://github.com/plonky3/Plonky3.git", rev = "2192432ddf28e7359dd2c577447886463e6124f0", optional = true }
stwo-prover = { git = "https://github.com/starkware-libs/stwo.git", optional = true, rev = "81d1fe349b490089f65723ad49ef72b9d09495ba", features = [
stwo-prover = { git = "https://github.com/ShuangWu121/stwo-GKR-serialized-proof.git", optional = true, features = [
"parallel",
] }

Expand Down
26 changes: 13 additions & 13 deletions backend/src/stwo/circuit_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ where

CircleEvaluation::new(domain, column)
}

#[derive(Default, Clone)]
pub struct PowdrEval {
log_degree: u32,
analyzed: Analyzed<M31>,
pub analyzed: Analyzed<M31>,
// the pre-processed are indexed in the whole proof, instead of in each component.
// this offset represents the index of the first pre-processed column in this component
preprocess_col_offset: usize,
// The name of the public, the poly-id of the witness poly that this public is related to, the public value
pub(crate) publics_values: Vec<(String, PolyID, M31)>,
stage0_witness_columns: BTreeMap<PolyID, usize>,
pub stage0_witness_columns: BTreeMap<PolyID, usize>,
stage1_witness_columns: BTreeMap<PolyID, usize>,
constant_shifted: BTreeMap<PolyID, usize>,
constant_columns: BTreeMap<PolyID, usize>,
// stwo supports maximum 2 stages, challenges are only created after stage 0
pub challenges: BTreeMap<u64, M31>,
poly_stage_map: BTreeMap<PolyID, usize>,
challenges: BTreeMap<u64, M31>,
pub poly_stage_map: BTreeMap<PolyID, usize>,
}

impl PowdrEval {
Expand Down Expand Up @@ -134,15 +134,15 @@ impl PowdrEval {
}
}

struct Data<'a, F> {
stage0_witness_eval: &'a BTreeMap<PolyID, [F; 2]>,
stage1_witness_eval: &'a BTreeMap<PolyID, [F; 2]>,
constant_shifted_eval: &'a BTreeMap<PolyID, F>,
constant_eval: &'a BTreeMap<PolyID, F>,
publics_values: &'a BTreeMap<String, F>,
pub struct Data<'a, F> {
pub stage0_witness_eval: &'a BTreeMap<PolyID, [F; 2]>,
pub stage1_witness_eval: &'a BTreeMap<PolyID, [F; 2]>,
pub constant_shifted_eval: &'a BTreeMap<PolyID, F>,
pub constant_eval: &'a BTreeMap<PolyID, F>,
pub publics_values: &'a BTreeMap<String, F>,
// challenges for stage 1
challenges: &'a BTreeMap<u64, F>,
poly_stage_map: &'a BTreeMap<PolyID, usize>,
pub challenges: &'a BTreeMap<u64, F>,
pub poly_stage_map: &'a BTreeMap<PolyID, usize>,
}

impl<F: Clone> TerminalAccess<F> for &Data<'_, F> {
Expand Down
Loading
Loading