mirror of
https://github.com/arnaucube/Nova.git
synced 2026-01-11 16:41:28 +01:00
Optimizations (#100)
* avoid creating commitments to zero vectors * reduce the number of constraints in each iteration from 4 to 3
This commit is contained in:
@@ -124,14 +124,10 @@ where
|
||||
x_i_plus_1.square(cs.namespace(|| format!("x_i_plus_1_sq_iter_{}", i)))?;
|
||||
let x_i_plus_1_quad =
|
||||
x_i_plus_1_sq.square(cs.namespace(|| format!("x_i_plus_1_quad_{}", i)))?;
|
||||
let x_i_plus_1_pow_5 = x_i_plus_1_quad.mul(
|
||||
cs.namespace(|| format!("x_i_plus_1_pow_5_{}", i)),
|
||||
&x_i_plus_1,
|
||||
)?;
|
||||
cs.enforce(
|
||||
|| format!("x_i_plus_1_pow_5 = x_i + y_i_iter_{}", i),
|
||||
|lc| lc + x_i_plus_1_pow_5.get_variable(),
|
||||
|lc| lc + CS::one(),
|
||||
|| format!("x_i_plus_1_quad * x_i_plus_1 = x_i + y_i_iter_{}", i),
|
||||
|lc| lc + x_i_plus_1_quad.get_variable(),
|
||||
|lc| lc + x_i_plus_1.get_variable(),
|
||||
|lc| lc + x_i.get_variable() + y_i.get_variable(),
|
||||
);
|
||||
|
||||
@@ -211,6 +207,15 @@ fn main() {
|
||||
pp.num_constraints().1
|
||||
);
|
||||
|
||||
println!(
|
||||
"Number of variables per step (primary circuit): {}",
|
||||
pp.num_variables().0
|
||||
);
|
||||
println!(
|
||||
"Number of variables per step (secondary circuit): {}",
|
||||
pp.num_variables().1
|
||||
);
|
||||
|
||||
// produce non-deterministic advice
|
||||
let (z0_primary, minroot_iterations) = MinRootIteration::new(
|
||||
num_iters_per_step * num_steps,
|
||||
|
||||
Reference in New Issue
Block a user