diff --git a/src/sonic/helped/generator.rs b/src/sonic/helped/generator.rs index e385781..723d1d9 100644 --- a/src/sonic/helped/generator.rs +++ b/src/sonic/helped/generator.rs @@ -221,8 +221,10 @@ impl<'a, E: Engine, CS: SonicConstraintSystem + 'a> crate::ConstraintSystem( +/// Get circuit information such as number of input, variables, +/// constraints, and the corresponding SONIC parameters +/// k_map, n, q +pub fn get_circuit_parameters( circuit: C, ) -> Result, SynthesisError> where E: Engine, C: Circuit @@ -239,7 +241,7 @@ fn get_circuit_parameters( impl> SonicConstraintSystem for NonassigningSynthesizer { const ONE: SonicVariable = SonicVariable::A(1); - fn alloc(&mut self, value: F) -> Result + fn alloc(&mut self, _value: F) -> Result where F: FnOnce() -> Result { @@ -287,7 +289,7 @@ fn get_circuit_parameters( } } - fn multiply(&mut self, values: F) -> Result<(SonicVariable, SonicVariable, SonicVariable), SynthesisError> + fn multiply(&mut self, _values: F) -> Result<(SonicVariable, SonicVariable, SonicVariable), SynthesisError> where F: FnOnce() -> Result<(E::Fr, E::Fr, E::Fr), SynthesisError> { @@ -347,9 +349,6 @@ fn get_circuit_parameters( _ => return Err(SynthesisError::UnconstrainedVariable) } - // let adapted_circuit = AdaptorCircuit(circuit); - - let mut assembly = GeneratorAssembly::<'_, E, _> { cs: &mut cs, num_inputs: 0, diff --git a/src/sonic/helped/mod.rs b/src/sonic/helped/mod.rs index 6f82c79..2a81c7b 100644 --- a/src/sonic/helped/mod.rs +++ b/src/sonic/helped/mod.rs @@ -17,4 +17,13 @@ pub use self::batch::{Batch}; pub use self::helper::{Aggregate, create_aggregate}; pub use self::verifier::{MultiVerifier}; pub use self::prover::{create_proof, create_advice}; +pub use self::generator::{ + CircuitParameters, + generate_parameters, + generate_parameters_on_srs, + generate_parameters_on_srs_and_information, + generate_random_parameters, + generate_srs, + get_circuit_parameters +}; pub use self::parameters::{Proof, SxyAdvice, Parameters, VerifyingKey, PreparedVerifyingKey}; \ No newline at end of file