From 61334546b02839ce17e232c827e8cdcbea8816b2 Mon Sep 17 00:00:00 2001 From: Wyatt Benno Date: Thu, 14 Mar 2024 13:46:02 -0500 Subject: [PATCH] add small util for SuperNova testing (easy) (#358) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add small util for SuperNova testing * added another function for secondary * chore: document added method --------- Co-authored-by: Wyatt Co-authored-by: François Garillot --- src/supernova/mod.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/supernova/mod.rs b/src/supernova/mod.rs index 26e9414d6..bc109261f 100644 --- a/src/supernova/mod.rs +++ b/src/supernova/mod.rs @@ -427,6 +427,22 @@ where .expect("Failure in retrieving digest") } + /// Returns the number of constraints and variables of inner circuit based on index + pub fn num_constraints_and_variables(&self, index: usize) -> (usize, usize) { + ( + self.circuit_shapes[index].r1cs_shape.num_cons, + self.circuit_shapes[index].r1cs_shape.num_vars, + ) + } + + /// Returns the number of constraints and variables of the secondary circuit + pub fn num_constraints_and_variables_secondary(&self) -> (usize, usize) { + ( + self.circuit_shape_secondary.r1cs_shape.num_cons, + self.circuit_shape_secondary.r1cs_shape.num_vars, + ) + } + /// All of the primary circuit digests of this [`PublicParams`] pub fn circuit_param_digests(&self) -> CircuitDigests { let digests = self