Skip to content

Commit

Permalink
poly: Rename decommit to read
Browse files Browse the repository at this point in the history
To be consistent with the other interfaces on how to 'receive' data
from the transcript.
  • Loading branch information
b13decker committed Mar 18, 2024
1 parent 12b4b5a commit b9faec0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions halo2_proofs/src/plonk/poly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 b9faec0

Please sign in to comment.