Skip to content

Commit

Permalink
unwarp Results
Browse files Browse the repository at this point in the history
  • Loading branch information
swasilyev committed Dec 4, 2024
1 parent 395095e commit 6fe03c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 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"] }
fflonk = { git = "https://github.com/w3f/fflonk", default-features = false }
fflonk = { git = "https://github.com/w3f/fflonk", branch="return-result", default-features = false }
rayon = { version = "1", default-features = false }
8 changes: 4 additions & 4 deletions 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
2 changes: 1 addition & 1 deletion common/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ impl<F: PrimeField, CS: PCS<F>, T: PlonkTranscript<F, CS>> PlonkVerifier<F, CS,
vec![agg_y, proof.lin_at_zeta_omega],
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 ring/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 6fe03c1

Please sign in to comment.