Skip to content

Commit

Permalink
gkr and keccak example works
Browse files Browse the repository at this point in the history
  • Loading branch information
hero78119 committed Jul 11, 2024
1 parent 24fd98f commit 5874771
Show file tree
Hide file tree
Showing 29 changed files with 806 additions and 4,262 deletions.
4 changes: 2 additions & 2 deletions gkr-graph/src/circuit_graph_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::{collections::BTreeSet, sync::Arc};

use ark_std::Zero;
use ff_ext::ExtensionField;
use gkr::structs::{Circuit, CircuitWitnessV2};
use gkr::structs::{Circuit, CircuitWitness};
use itertools::{chain, izip, Itertools};
use multilinear_extensions::{
mle::DenseMultilinearExtension, virtual_poly_v2::ArcMultilinearExtension,
Expand Down Expand Up @@ -60,7 +60,7 @@ impl<'a, E: ExtensionField> CircuitGraphBuilder<'a, E> {
.collect_vec()
);

let mut witness = CircuitWitnessV2::new(circuit, challenges);
let mut witness = CircuitWitness::new(circuit, challenges);
let wits_in = izip!(preds.iter(), sources.into_iter())
.map(|(pred, source)| match pred {
PredType::Source => source.into(),
Expand Down
8 changes: 4 additions & 4 deletions gkr-graph/src/structs.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use ff_ext::ExtensionField;
use gkr::structs::{Circuit, CircuitWitnessV2, PointAndEval};
use gkr::structs::{Circuit, CircuitWitness, PointAndEval};
use simple_frontend::structs::WitnessId;
use std::{marker::PhantomData, sync::Arc};

pub(crate) type GKRProverState<F> = gkr::structs::IOPProverStateV2<F>;
pub(crate) type GKRVerifierState<F> = gkr::structs::IOPVerifierStateV2<F>;
pub(crate) type GKRProverState<F> = gkr::structs::IOPProverState<F>;
pub(crate) type GKRVerifierState<F> = gkr::structs::IOPVerifierState<F>;
pub(crate) type GKRProof<F> = gkr::structs::IOPProof<F>;

/// Corresponds to the `output_evals` and `wires_out_evals` in gkr
Expand Down Expand Up @@ -60,7 +60,7 @@ pub struct CircuitGraph<E: ExtensionField> {

#[derive(Default)]
pub struct CircuitGraphWitness<'a, E: ExtensionField> {
pub node_witnesses: Vec<Arc<CircuitWitnessV2<'a, E>>>,
pub node_witnesses: Vec<Arc<CircuitWitness<'a, E>>>,
}

pub struct CircuitGraphBuilder<'a, E: ExtensionField> {
Expand Down
4 changes: 2 additions & 2 deletions gkr/examples/keccak256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use ff::Field;
use ff_ext::ExtensionField;
use gkr::{
gadgets::keccak256::{keccak256_circuit, prove_keccak256, verify_keccak256},
structs::CircuitWitnessV2,
structs::CircuitWitness,
util::ceil_log2,
};
use goldilocks::GoldilocksExt2;
Expand Down Expand Up @@ -75,7 +75,7 @@ fn main() {
DenseMultilinearExtension::from_evaluations_vec(ceil_log2(wit_in.len()), wit_in)
})
.collect();
let mut witness = CircuitWitnessV2::new(&circuit, Vec::new());
let mut witness = CircuitWitness::new(&circuit, Vec::new());
witness.add_instance(&circuit, all_zero);
witness.add_instance(&circuit, all_one);

Expand Down
1 change: 0 additions & 1 deletion gkr/src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use crate::structs::{Gate1In, Gate2In, Gate3In, GateCIn};

mod circuit_layout;
mod circuit_witness;
mod circuit_witness_v2;

pub trait EvaluateGateCIn<E>
where
Expand Down
Loading

0 comments on commit 5874771

Please sign in to comment.