Expose `Proof::add_to_batch` in public API

This supports downstream users that want more control over how proof
batches are processed, instead of just batch validating Orchard bundles
with `orchard::bundle::BatchValidator`.
This commit is contained in:
Jack Grigg 2022-07-04 20:05:47 +00:00
parent 3faab98e9e
commit 63fc2adc0e
2 changed files with 9 additions and 5 deletions

View File

@ -6,6 +6,8 @@ and this project adheres to Rust's notion of
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased] ## [Unreleased]
### Added
- `orchard::Proof::add_to_batch`
## [0.2.0] - 2022-06-24 ## [0.2.0] - 2022-06-24
### Added ### Added

View File

@ -866,11 +866,13 @@ impl Proof {
plonk::verify_proof(&vk.params, &vk.vk, strategy, &instances, &mut transcript) plonk::verify_proof(&vk.params, &vk.vk, strategy, &instances, &mut transcript)
} }
pub(crate) fn add_to_batch( /// Adds this proof to the given batch for verification with the given instances.
&self, ///
batch: &mut BatchVerifier<vesta::Affine>, /// Use this API if you want more control over how proof batches are processed. If you
instances: Vec<Instance>, /// just want to batch-validate Orchard bundles, use [`bundle::BatchValidator`].
) { ///
/// [`bundle::BatchValidator`]: crate::bundle::BatchValidator
pub fn add_to_batch(&self, batch: &mut BatchVerifier<vesta::Affine>, instances: Vec<Instance>) {
let instances = instances let instances = instances
.iter() .iter()
.map(|i| { .map(|i| {