Skip to content

Commit

Permalink
Merge pull request #23 from davxy/alternative-vk-construction
Browse files Browse the repository at this point in the history
Alternative VK construction
  • Loading branch information
swasilyev committed Jul 2, 2024
2 parents b273d33 + 69f0b9a commit 96137b1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ring/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use common::Proof;
pub use piop::index;

use crate::piop::{RingCommitments, RingEvaluations};
pub use crate::piop::{params::PiopParams, ProverKey, VerifierKey};
pub use crate::piop::{params::PiopParams, ProverKey, VerifierKey, FixedColumnsCommitted};

mod piop;
pub mod ring;
Expand Down
13 changes: 12 additions & 1 deletion ring/src/piop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,23 @@ impl<E: Pairing> VerifierKey<E::ScalarField, KZG<E>> {
pub fn from_ring_and_kzg_vk<G: SWCurveConfig<BaseField=E::ScalarField>>(
ring: &Ring<E::ScalarField, E, G>,
kzg_vk: RawKzgVerifierKey<E>,
) -> Self {
Self::from_commitment_and_kzg_vk(FixedColumnsCommitted::from_ring(ring), kzg_vk)
}

pub fn from_commitment_and_kzg_vk(
commitment: FixedColumnsCommitted<E::ScalarField, KzgCommitment<E>>,
kzg_vk: RawKzgVerifierKey<E>,
) -> Self {
Self {
pcs_raw_vk: kzg_vk,
fixed_columns_committed: FixedColumnsCommitted::from_ring(ring),
fixed_columns_committed: commitment,
}
}

pub fn commitment(&self) -> FixedColumnsCommitted<E::ScalarField, KzgCommitment<E>> {
self.fixed_columns_committed.clone()
}
}


Expand Down

0 comments on commit 96137b1

Please sign in to comment.