From eb5abe67106728f9437ec08e12e18f65bbfdc2e4 Mon Sep 17 00:00:00 2001 From: guipublic Date: Mon, 4 Sep 2023 13:35:40 +0000 Subject: [PATCH 1/2] initialize recursive proof output to zero --- acvm/src/pwg/blackbox/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/acvm/src/pwg/blackbox/mod.rs b/acvm/src/pwg/blackbox/mod.rs index 511a55f32..b7ba5f653 100644 --- a/acvm/src/pwg/blackbox/mod.rs +++ b/acvm/src/pwg/blackbox/mod.rs @@ -1,10 +1,11 @@ use acir::{ circuit::opcodes::{BlackBoxFuncCall, FunctionInput}, native_types::{Witness, WitnessMap}, + FieldElement, }; use blackbox_solver::{blake2s, keccak256, sha256}; -use super::{OpcodeNotSolvable, OpcodeResolutionError}; +use super::{insert_value, OpcodeNotSolvable, OpcodeResolutionError}; use crate::BlackBoxFunctionSolver; mod fixed_base_scalar_mul; @@ -150,6 +151,13 @@ pub(crate) fn solve( BlackBoxFuncCall::FixedBaseScalarMul { input, outputs } => { fixed_base_scalar_mul(backend, initial_witness, *input, *outputs) } - BlackBoxFuncCall::RecursiveAggregation { .. } => Ok(()), + BlackBoxFuncCall::RecursiveAggregation { output_aggregation_object, .. } => { + // Solve the output of the recursive aggregation to zero to prevent missing assignement errors + // The correct value will be computed by the backend + for witness in output_aggregation_object { + insert_value(witness, FieldElement::zero(), initial_witness)?; + } + Ok(()) + } } } From 42ca36cbf7e4fa6588c0b630be581361d9d92959 Mon Sep 17 00:00:00 2001 From: guipublic Date: Mon, 4 Sep 2023 15:43:03 +0000 Subject: [PATCH 2/2] code review --- acvm/src/pwg/blackbox/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acvm/src/pwg/blackbox/mod.rs b/acvm/src/pwg/blackbox/mod.rs index b7ba5f653..f224ce0e6 100644 --- a/acvm/src/pwg/blackbox/mod.rs +++ b/acvm/src/pwg/blackbox/mod.rs @@ -152,7 +152,7 @@ pub(crate) fn solve( fixed_base_scalar_mul(backend, initial_witness, *input, *outputs) } BlackBoxFuncCall::RecursiveAggregation { output_aggregation_object, .. } => { - // Solve the output of the recursive aggregation to zero to prevent missing assignement errors + // Solve the output of the recursive aggregation to zero to prevent missing assignment errors // The correct value will be computed by the backend for witness in output_aggregation_object { insert_value(witness, FieldElement::zero(), initial_witness)?;