From d01d206524c55eddaed4de8b6b74e9ab3e374292 Mon Sep 17 00:00:00 2001 From: wborgeaud Date: Tue, 24 Aug 2021 18:20:47 +0200 Subject: [PATCH] Remove named connects --- src/hash/merkle_proofs.rs | 10 ---------- src/plonk/circuit_builder.rs | 27 --------------------------- src/plonk/recursive_verifier.rs | 6 +----- 3 files changed, 1 insertion(+), 42 deletions(-) diff --git a/src/hash/merkle_proofs.rs b/src/hash/merkle_proofs.rs index 43cf49e2..82f15db0 100644 --- a/src/hash/merkle_proofs.rs +++ b/src/hash/merkle_proofs.rs @@ -191,16 +191,6 @@ impl, const D: usize> CircuitBuilder { self.connect(x.elements[i], y.elements[i]); } } - - pub fn named_assert_hashes_equal(&mut self, x: HashOutTarget, y: HashOutTarget, name: String) { - for i in 0..4 { - self.named_connect( - x.elements[i], - y.elements[i], - format!("{}: {}-th hash element", name, i), - ); - } - } } #[cfg(test)] diff --git a/src/plonk/circuit_builder.rs b/src/plonk/circuit_builder.rs index 6e73de75..7a5b57bc 100644 --- a/src/plonk/circuit_builder.rs +++ b/src/plonk/circuit_builder.rs @@ -179,17 +179,6 @@ impl, const D: usize> CircuitBuilder { } } - pub fn named_connect_extension( - &mut self, - src: ExtensionTarget, - dst: ExtensionTarget, - name: String, - ) { - for i in 0..D { - self.named_connect(src.0[i], dst.0[i], format!("{}: limb {}", name, i)); - } - } - /// Adds a generator which will copy `src` to `dst`. pub fn generate_copy(&mut self, src: Target, dst: Target) { self.add_generator(CopyGenerator { src, dst }); @@ -210,22 +199,6 @@ impl, const D: usize> CircuitBuilder { .push(CopyConstraint::new((x, y), self.context_log.open_stack())); } - /// Same as connect` for a named copy constraint. - pub fn named_connect(&mut self, x: Target, y: Target, name: String) { - assert!( - x.is_routable(&self.config), - "Tried to route a wire that isn't routable" - ); - assert!( - y.is_routable(&self.config), - "Tried to route a wire that isn't routable" - ); - self.copy_constraints.push(CopyConstraint::new( - (x, y), - format!("{} > {}", self.context_log.open_stack(), name), - )); - } - pub fn assert_zero(&mut self, x: Target) { let zero = self.zero(); self.connect(x, zero); diff --git a/src/plonk/recursive_verifier.rs b/src/plonk/recursive_verifier.rs index e90bf786..f9e864b3 100644 --- a/src/plonk/recursive_verifier.rs +++ b/src/plonk/recursive_verifier.rs @@ -94,11 +94,7 @@ impl, const D: usize> CircuitBuilder { { let recombined_quotient = scale.reduce(chunk, self); let computed_vanishing_poly = self.mul_extension(z_h_zeta, recombined_quotient); - self.named_connect_extension( - vanishing_polys_zeta[i], - computed_vanishing_poly, - format!("Vanishing polynomial == Z_H * quotient, challenge {}", i), - ); + self.connect_extension(vanishing_polys_zeta[i], computed_vanishing_poly); } });