Remove named connects

This commit is contained in:
wborgeaud 2021-08-24 18:20:47 +02:00
parent 71f64329c7
commit d01d206524
3 changed files with 1 additions and 42 deletions

View File

@ -191,16 +191,6 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
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)]

View File

@ -179,17 +179,6 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
}
}
pub fn named_connect_extension(
&mut self,
src: ExtensionTarget<D>,
dst: ExtensionTarget<D>,
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<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
.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);

View File

@ -94,11 +94,7 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
{
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);
}
});