Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions src/whir/committer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,6 @@ pub mod writer;
pub use reader::CommitmentReader;
pub use writer::CommitmentWriter;

///
/// Represents the individual leaves and merkle tree associated
/// with the polynomial.
///
#[derive(Clone)]
pub(crate) struct BatchingData<F, MerkleConfig>
where
MerkleConfig: Config,
{
pub(crate) merkle_tree: MerkleTree<MerkleConfig>,
pub(crate) merkle_leaves: Vec<F>,
}

/// Represents the commitment and evaluation data for a polynomial.
///
/// This structure holds all necessary components to verify a commitment,
Expand Down Expand Up @@ -52,21 +39,6 @@ where
/// The corresponding polynomial evaluations at the OOD challenge points.
pub(crate) ood_answers: Vec<F>,

/// The individual commitments of each batching polynomial
pub(crate) batching_data: Vec<BatchingData<F, MerkleConfig>>,

/// The batching randomness. If there's no batching, this value is zero.
pub batching_randomness: F,
}

impl<F, MerkleConfig> From<Witness<F, MerkleConfig>> for BatchingData<F, MerkleConfig>
where
MerkleConfig: Config,
{
fn from(value: Witness<F, MerkleConfig>) -> Self {
Self {
merkle_tree: value.merkle_tree,
merkle_leaves: value.merkle_leaves,
}
}
}
13 changes: 4 additions & 9 deletions src/whir/committer/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::whir::{

#[derive(Clone)]
pub struct ParsedCommitment<F, D> {
pub root: Vec<D>,
pub root: D,
pub num_variables: usize,
pub ood_points: Vec<F>,
pub ood_answers: Vec<Vec<F>>,
Expand Down Expand Up @@ -53,12 +53,7 @@ where
+ DigestToUnitDeserialize<MerkleConfig>
+ BytesToUnitDeserialize,
{
let mut roots = Vec::<MerkleConfig::InnerDigest>::with_capacity(self.0.batch_size);

for _ in 0..self.0.batch_size {
let root = verifier_state.read_digest()?;
roots.push(root);
}
let root = verifier_state.read_digest()?;

let mut ood_points = vec![F::ZERO; self.0.committment_ood_samples];
let mut ood_answers = Vec::with_capacity(self.0.batch_size);
Expand All @@ -79,7 +74,7 @@ where
};

Ok(ParsedCommitment {
root: roots,
root,
batching_randomness,
num_variables: self.0.mv_parameters.num_variables,
ood_points,
Expand Down Expand Up @@ -113,7 +108,7 @@ where

Ok(ParsedCommitment {
num_variables,
root: vec![root],
root,
ood_points,
ood_answers: vec![ood_answers],
batching_randomness: F::ZERO,
Expand Down
Loading
Loading