Skip to content

Commit

Permalink
Merge pull request #46 from w3f/return-result
Browse files Browse the repository at this point in the history
unwarp Results
  • Loading branch information
swasilyev authored Feb 19, 2025
2 parents daa4142 + df26f14 commit cf29e1e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ ark-ff = { version = "0.5", default-features = false }
ark-ec = { version = "0.5", default-features = false }
ark-poly = { version = "0.5", default-features = false }
ark-serialize = { version = "0.5", default-features = false, features = ["derive"] }
w3f-pcs = { version = "0.0.1", default-features = false }
w3f-pcs = { version = "0.0.2", default-features = false }
rayon = { version = "1", default-features = false }
8 changes: 4 additions & 4 deletions w3f-plonk-common/src/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<F: PrimeField, CS: PCS<F>, T: PlonkTranscript<F, CS>> PlonkProver<F, CS, T>
transcript.add_instance(&piop.result());
// ROUND 1
// The prover commits to the columns.
let column_commitments = piop.committed_columns(|p| CS::commit(&self.pcs_ck, p));
let column_commitments = piop.committed_columns(|p| CS::commit(&self.pcs_ck, p).unwrap());
transcript.add_committed_cols(&column_commitments);

// ROUND 2
Expand All @@ -52,7 +52,7 @@ impl<F: PrimeField, CS: PCS<F>, T: PlonkTranscript<F, CS>> PlonkProver<F, CS, T>
let agg_constraint_poly = agg_constraint_poly.interpolate();
let quotient_poly = piop.domain().divide_by_vanishing_poly(&agg_constraint_poly);
// The prover commits to the quotient polynomial...
let quotient_commitment = CS::commit(&self.pcs_ck, &quotient_poly);
let quotient_commitment = CS::commit(&self.pcs_ck, &quotient_poly).unwrap();
transcript.add_quotient_commitment(&quotient_commitment);

// and receives the evaluation point in response
Expand All @@ -71,8 +71,8 @@ impl<F: PrimeField, CS: PCS<F>, T: PlonkTranscript<F, CS>> PlonkProver<F, CS, T>
let polys_at_zeta = [columns_to_open, vec![quotient_poly]].concat();
let nus = transcript.get_kzg_aggregation_challenges(polys_at_zeta.len());
let agg_at_zeta = aggregate_polys(&polys_at_zeta, &nus);
let agg_at_zeta_proof = CS::open(&self.pcs_ck, &agg_at_zeta, zeta);
let lin_at_zeta_omega_proof = CS::open(&self.pcs_ck, &lin, zeta_omega);
let agg_at_zeta_proof = CS::open(&self.pcs_ck, &agg_at_zeta, zeta).unwrap();
let lin_at_zeta_omega_proof = CS::open(&self.pcs_ck, &lin, zeta_omega).unwrap();
Proof {
column_commitments,
quotient_commitment,
Expand Down
1 change: 1 addition & 0 deletions w3f-plonk-common/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ impl<F: PrimeField, CS: PCS<F>, T: PlonkTranscript<F, CS>> PlonkVerifier<F, CS,
vec![proof.agg_at_zeta_proof, proof.lin_at_zeta_omega_proof],
rng,
)
.is_ok()
}

pub fn restore_challenges<Commitments, Evaluations>(
Expand Down
6 changes: 3 additions & 3 deletions w3f-ring-proof/src/piop/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ impl<E: Pairing> FixedColumnsCommitted<E::ScalarField, KzgCommitment<E>> {
impl<F: PrimeField, G: AffineRepr<BaseField = F>> FixedColumns<F, G> {
fn commit<CS: PCS<F>>(&self, ck: &CS::CK) -> FixedColumnsCommitted<F, CS::C> {
let points = [
CS::commit(ck, self.points.xs.as_poly()),
CS::commit(ck, self.points.ys.as_poly()),
CS::commit(ck, self.points.xs.as_poly()).unwrap(),
CS::commit(ck, self.points.ys.as_poly()).unwrap(),
];
let ring_selector = CS::commit(ck, self.ring_selector.as_poly());
let ring_selector = CS::commit(ck, self.ring_selector.as_poly()).unwrap();
FixedColumnsCommitted {
points,
ring_selector,
Expand Down

0 comments on commit cf29e1e

Please sign in to comment.