whoops, prover needs not 3*n, but 4*n

This commit is contained in:
Alex Vlasov 2019-02-07 15:04:40 +03:00
parent 7aa7f3538d
commit dc5e5ffe31
3 changed files with 9 additions and 5 deletions

@ -381,7 +381,7 @@ pub fn generate_parameters<E, C>(
where E: Engine, C: Circuit<E>
{
let circuit_parameters = get_circuit_parameters::<E, C>(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<E: Engine>(
information: CircuitParameters<E>
) -> Result<Parameters<E>, 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<E> = SRS {
d: min_d,
@ -736,7 +736,7 @@ fn parameters_generation() {
use rand::{Rand, thread_rng};
let info = get_circuit_parameters::<Bls12, _>(MySillyCircuit { a: None, b: None }).expect("Must get circuit info");
println!("{:?}", info);
let rng = &mut thread_rng();
let x: Fr = rng.gen();

@ -267,6 +267,7 @@ fn laurent_division() {
}
pub fn multiply_polynomials<E: Engine>(a: Vec<E::Fr>, b: Vec<E::Fr>) -> Vec<E::Fr> {
println!("Multiplying polynomails of degrees {} and {}", a.len(), b.len());
let result_len = a.len() + b.len() - 1;
use crate::multicore::Worker;

@ -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::<Bn256, _>(circuit.clone()).expect("Must get circuit info");
println!("{:?}", info);
println!("creating proof");
let start = Instant::now();