binius_hash_prover/suite.rs
1// Copyright 2026 The Binius Developers
2
3//! The batched counterpart of the verifier's hash pair.
4
5use binius_hash::HashSuite;
6use digest::Output;
7
8use crate::{parallel_compression::ParallelPseudoCompression, parallel_digest::ParallelDigest};
9
10/// A hash suite with the batched hashes a prover needs on top of the sequential ones.
11///
12/// Verification walks one Merkle path, so the sequential pair is enough for it.
13/// Proving folds whole layers at once, where batching independent messages per call is what
14/// keeps the hash off the critical path.
15///
16/// Each batched hash is required to agree with its sequential counterpart byte for byte, so
17/// the two sides of a proof commit to the same tree.
18pub trait ParallelHashSuite: HashSuite {
19 /// Batched counterpart of the sequential leaf hash.
20 type ParLeafHash: ParallelDigest<Digest = Self::LeafHash> + Default;
21 /// Batched counterpart of the sequential inner-node compression.
22 ///
23 /// `Sync` because one instance is shared across threads while folding the tree.
24 type ParCompression: ParallelPseudoCompression<Output<Self::LeafHash>, 2, Compression = Self::Compression>
25 + Default
26 + Sync;
27}