From dc5e5ffe3163384f35befb5bc4a396705633e825 Mon Sep 17 00:00:00 2001 From: Alex Vlasov Date: Thu, 7 Feb 2019 15:04:40 +0300 Subject: [PATCH] whoops, prover needs not 3*n, but 4*n --- src/sonic/helped/generator.rs | 8 ++++---- src/sonic/util.rs | 1 + tests/mimc.rs | 5 ++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/sonic/helped/generator.rs b/src/sonic/helped/generator.rs index 723d1d9..7b88823 100644 --- a/src/sonic/helped/generator.rs +++ b/src/sonic/helped/generator.rs @@ -381,7 +381,7 @@ pub fn generate_parameters( where E: Engine, C: Circuit { let circuit_parameters = get_circuit_parameters::(circuit)?; - let min_d = circuit_parameters.n * 3; + let min_d = circuit_parameters.n * 4; let srs = generate_srs(alpha, x, min_d)?; @@ -407,8 +407,8 @@ pub fn generate_parameters_on_srs_and_information( information: CircuitParameters ) -> Result, SynthesisError> { - assert!(srs.d >= information.n * 3); - let min_d = information.n * 3; + assert!(srs.d >= information.n * 4); + let min_d = information.n * 4; let trimmed_srs: SRS = SRS { d: min_d, @@ -736,7 +736,7 @@ fn parameters_generation() { use rand::{Rand, thread_rng}; let info = get_circuit_parameters::(MySillyCircuit { a: None, b: None }).expect("Must get circuit info"); - + println!("{:?}", info); let rng = &mut thread_rng(); let x: Fr = rng.gen(); diff --git a/src/sonic/util.rs b/src/sonic/util.rs index 70982d2..0903ec6 100644 --- a/src/sonic/util.rs +++ b/src/sonic/util.rs @@ -267,6 +267,7 @@ fn laurent_division() { } pub fn multiply_polynomials(a: Vec, b: Vec) -> Vec { + println!("Multiplying polynomails of degrees {} and {}", a.len(), b.len()); let result_len = a.len() + b.len() - 1; use crate::multicore::Worker; diff --git a/tests/mimc.rs b/tests/mimc.rs index 0037cd1..9d6e24f 100644 --- a/tests/mimc.rs +++ b/tests/mimc.rs @@ -578,7 +578,10 @@ fn test_inputs_into_sonic_mimc() { use bellman::sonic::cs::Basic; use bellman::sonic::sonic::AdaptorCircuit; - use bellman::sonic::helped::{create_proof, create_advice, create_aggregate, MultiVerifier}; + use bellman::sonic::helped::{create_proof, get_circuit_parameters, create_advice, create_aggregate, MultiVerifier}; + + let info = get_circuit_parameters::(circuit.clone()).expect("Must get circuit info"); + println!("{:?}", info); println!("creating proof"); let start = Instant::now();