From 8b710751541380ed64fbfd8b2bc5a3ffaab41a9b Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Tue, 16 Nov 2021 09:29:22 -0800 Subject: [PATCH] Reduce constant_gate_size to 5 (#366) This results in 8 constant polynomials, which means our Merkle tree containing preprocessed polynomials has leaves of size 80 + 8 = 88. A multiple of 8 is efficient in terms of how many gates it takes to hash a leaf. Saves 17 gates. --- src/hash/merkle_proofs.rs | 2 +- src/plonk/circuit_data.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hash/merkle_proofs.rs b/src/hash/merkle_proofs.rs index 7b766895..20e2271a 100644 --- a/src/hash/merkle_proofs.rs +++ b/src/hash/merkle_proofs.rs @@ -94,7 +94,7 @@ impl, const D: usize> CircuitBuilder { proof: &MerkleProofTarget, ) { let zero = self.zero(); - let mut state: HashOutTarget = self.hash_or_noop(leaf_data); + let mut state = self.hash_or_noop(leaf_data); for (&bit, &sibling) in leaf_index_bits.iter().zip(&proof.siblings) { let mut perm_inputs = [zero; SPONGE_WIDTH]; diff --git a/src/plonk/circuit_data.rs b/src/plonk/circuit_data.rs index e24a5c6f..6721552c 100644 --- a/src/plonk/circuit_data.rs +++ b/src/plonk/circuit_data.rs @@ -61,7 +61,7 @@ impl CircuitConfig { Self { num_wires: 135, num_routed_wires: 80, - constant_gate_size: 8, + constant_gate_size: 5, use_base_arithmetic_gate: true, security_bits: 93, rate_bits: 3,