diff --git a/zcash_proofs/Cargo.toml b/zcash_proofs/Cargo.toml index 1317709db..d0677167b 100644 --- a/zcash_proofs/Cargo.toml +++ b/zcash_proofs/Cargo.toml @@ -16,7 +16,7 @@ categories = ["cryptography::cryptocurrencies"] all-features = true [dependencies] -bellman = { version = "0.13", default-features = false, features = ["groth16"] } +bellman = { version = "0.13.1", default-features = false, features = ["groth16"] } blake2b_simd = "1" bls12_381 = "0.7" byteorder = "1" diff --git a/zcash_proofs/src/sapling/verifier/batch.rs b/zcash_proofs/src/sapling/verifier/batch.rs index 0125dd556..7d3ea41c8 100644 --- a/zcash_proofs/src/sapling/verifier/batch.rs +++ b/zcash_proofs/src/sapling/verifier/batch.rs @@ -159,12 +159,19 @@ impl BatchValidator { return false; } - if self.spend_proofs.verify(&mut rng, spend_vk).is_err() { + #[cfg(feature = "multicore")] + let verify_proofs = |batch: groth16::batch::Verifier, vk| batch.verify_multicore(vk); + + #[cfg(not(feature = "multicore"))] + let mut verify_proofs = + |batch: groth16::batch::Verifier, vk| batch.verify(&mut rng, vk); + + if verify_proofs(self.spend_proofs, spend_vk).is_err() { tracing::debug!("Spend proof batch validation failed"); return false; } - if self.output_proofs.verify(&mut rng, output_vk).is_err() { + if verify_proofs(self.output_proofs, output_vk).is_err() { tracing::debug!("Output proof batch validation failed"); return false; }