From d09b08992c2bb5993f2779b89685ea73c0ebd4ae Mon Sep 17 00:00:00 2001 From: Artem <48178500+ElusAegis@users.noreply.github.com> Date: Tue, 1 Oct 2024 14:09:44 +0100 Subject: [PATCH] (fix: merging) Fixed an issue after merging --- src/bindings/universal.rs | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/bindings/universal.rs b/src/bindings/universal.rs index a3d84f849..2855ee46a 100644 --- a/src/bindings/universal.rs +++ b/src/bindings/universal.rs @@ -93,23 +93,29 @@ pub(crate) fn encode_verifier_calldata( /// Generate witness from compiled circuit and input json #[cfg_attr(target_os = "ios", uniffi::export)] pub(crate) fn gen_witness(compiled_circuit: Vec, input: Vec) -> Result, EZKLError> { - let mut circuit: GraphCircuit = bincode::deserialize(&compiled_circuit[..]) - .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize circuit: {}", e)))?; - + let mut circuit: crate::graph::GraphCircuit = bincode::deserialize(&compiled_circuit[..]) + .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize compiled model: {}", e)))?; let input: crate::graph::input::GraphData = serde_json::from_slice(&input[..]) .map_err(|e| EZKLError::InternalError(format!("Failed to deserialize input: {}", e)))?; let mut input = circuit .load_graph_input(&input) - .map_err(InnerEZKLError::from)?; + .map_err(|e| EZKLError::InternalError(format!("{}", e)))?; let witness = circuit - .forward::>(&mut input, None, None, RegionSettings::all_false()) - .map_err(InnerEZKLError::from)?; + .forward::>( + &mut input, + None, + None, + RegionSettings::all_true( + circuit.settings().run_args.decomp_base, + circuit.settings().run_args.decomp_legs, + ), + ) + .map_err(|e| EZKLError::InternalError(format!("{}", e)))?; serde_json::to_vec(&witness) - .map_err(InnerEZKLError::from) - .map_err(EZKLError::from) + .map_err(|e| EZKLError::InternalError(format!("Failed to serialize witness: {}", e))) } /// Generate verifying key from compiled circuit, and parameters srs