Skip to content

Commit

Permalink
refine the protocol prover and verifier structs
Browse files Browse the repository at this point in the history
  • Loading branch information
dreamATD committed Jan 9, 2025
1 parent 5c75107 commit 29061f1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 1 addition & 4 deletions gkr_iop/examples/multi_layer_logup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ where
res
}

fn gkr_witness(&self, phase1: &[Vec<E::BaseField>], challenges: &[E]) -> GKRCircuitWitness<E>
where
E: ExtensionField,
{
fn gkr_witness(&self, phase1: &[Vec<E::BaseField>], challenges: &[E]) -> GKRCircuitWitness<E> {
// Generate witnesses.
let table = &phase1[self.committed_table];
let count = &phase1[self.committed_count];
Expand Down
14 changes: 9 additions & 5 deletions gkr_iop/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::marker::PhantomData;

use chip::Chip;
use ff_ext::ExtensionField;
use gkr::GKRCircuitWitness;
Expand Down Expand Up @@ -47,13 +49,15 @@ where
fn phase1_witness(&self, phase1: Self::Trace) -> Vec<Vec<E::BaseField>>;

/// GKR witness.
fn gkr_witness(&self, phase1: &[Vec<E::BaseField>], challenges: &[E]) -> GKRCircuitWitness<E>
where
E: ExtensionField;
fn gkr_witness(&self, phase1: &[Vec<E::BaseField>], challenges: &[E]) -> GKRCircuitWitness<E>;
}

// TODO: the following trait consists of `commit_phase1`, `commit_phase2`, `gkr_phase` and `opening_phase`.
pub trait ProtocolProver<E: ExtensionField, Trans: Transcript<E>, PCS> {}
pub struct ProtocolProver<E: ExtensionField, Trans: Transcript<E>, PCS>(
PhantomData<(E, Trans, PCS)>,
);

// TODO: the following trait consists of `commit_phase1`, `commit_phase2`, `gkr_phase` and `opening_phase`.
pub trait ProtocolVerifier<E: ExtensionField, Trans: Transcript<E>, PCS> {}
pub struct ProtocolVerifier<E: ExtensionField, Trans: Transcript<E>, PCS>(
PhantomData<(E, Trans, PCS)>,
);

0 comments on commit 29061f1

Please sign in to comment.