Skip to content

Commit

Permalink
Merge pull request privacy-scaling-explorations#168 from input-output…
Browse files Browse the repository at this point in the history
…-hk/dev-fix/address-pr-15

Resolve "Address PR privacy-scaling-explorations#15 issues"
  • Loading branch information
b13decker authored Mar 18, 2024
2 parents 12b4b5a + e3b74de commit bcae56b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions halo2_proofs/src/plonk/poly.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/// Generic API functionality for how PLONK manages polynomials.
/// Generic API to encapsulate how a PLONK proof commits to polynomial evaluations.
use crate::{
arithmetic::{eval_polynomial, CurveAffine},
poly::{Coeff, Polynomial},
Expand All @@ -14,7 +14,7 @@ pub trait EvaluationCommitment<C: CurveAffine, E: EncodedChallenge<C>> {
T: TranscriptWrite<C, E>;

/// Extract a set of polynomial evaluations from the transcript.
fn decommit<T>(n: usize, transcript: &mut T) -> io::Result<Vec<C::Scalar>>
fn read<T>(n: usize, transcript: &mut T) -> io::Result<Vec<C::Scalar>>
where
T: TranscriptRead<C, E>;
}
Expand All @@ -36,7 +36,7 @@ impl<C: CurveAffine, E: EncodedChallenge<C>> EvaluationCommitment<C, E> for Dire
Ok(())
}

fn decommit<T>(n: usize, transcript: &mut T) -> io::Result<Vec<C::Scalar>>
fn read<T>(n: usize, transcript: &mut T) -> io::Result<Vec<C::Scalar>>
where
T: TranscriptRead<C, E>,
{
Expand Down Expand Up @@ -97,7 +97,7 @@ where
num_evals: usize,
transcript: &mut T,
) -> io::Result<Vec<C::Scalar>> {
EvalComm::decommit(num_evals, transcript)
EvalComm::read(num_evals, transcript)
}
}

Expand Down Expand Up @@ -142,7 +142,7 @@ mod proptests {

let read_evals = {
let mut reader = Blake2bRead::<_, Curve, Challenge255<_>>::init(&proof[..]);
let res = DirectCommitment::decommit(NUM_EVALS, &mut reader);
let res = DirectCommitment::read(NUM_EVALS, &mut reader);
prop_assert!(
res.is_ok(),
"Reading commitments failed: {res:?}",
Expand Down
4 changes: 2 additions & 2 deletions halo2_proofs/src/plonk/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ where
let instance_evals = if V::QUERY_INSTANCE {
(0..num_proofs)
.map(|_| -> Result<Vec<_>, _> {
Gen::EvalComm::decommit(vk.cs.instance_queries.len(), transcript)
Gen::EvalComm::read(vk.cs.instance_queries.len(), transcript)
})
.collect::<Result<Vec<_>, _>>()?
} else {
Expand Down Expand Up @@ -220,7 +220,7 @@ where

let advice_evals = (0..num_proofs)
.map(|_| -> Result<Vec<_>, _> {
Gen::EvalComm::decommit(vk.cs.advice_queries.len(), transcript)
Gen::EvalComm::read(vk.cs.advice_queries.len(), transcript)
})
.collect::<Result<Vec<_>, _>>()?;

Expand Down

0 comments on commit bcae56b

Please sign in to comment.