Fix tests

This commit is contained in:
wborgeaud 2021-08-13 17:41:26 +02:00
parent d0aae8c2a7
commit 68af28e9a2
2 changed files with 17 additions and 3 deletions

View File

@ -288,6 +288,7 @@ mod tests {
config: CircuitConfig {
fri_config,
num_routed_wires: 6,
zero_knowledge: true,
..CircuitConfig::large_config()
},
degree_bits,

View File

@ -14,10 +14,23 @@ impl<F: Extendable<D>, const D: usize> CircuitBuilder<F, D> {
x: ExtensionTarget<D>,
y: ExtensionTarget<D>,
) -> ExtensionTarget<D> {
let gate = self.num_gates();
// Holds `by - y`.
let first_out =
ExtensionTarget::from_range(gate, ArithmeticExtensionGate::<D>::wires_first_output());
let (gate, range) = if let Some((g, c_0, c_1)) = self.free_arithmetic {
if c_0 == F::ONE && c_1 == F::NEG_ONE {
(g, ArithmeticExtensionGate::<D>::wires_third_output())
} else {
(
self.num_gates(),
ArithmeticExtensionGate::<D>::wires_first_output(),
)
}
} else {
(
self.num_gates(),
ArithmeticExtensionGate::<D>::wires_first_output(),
)
};
let first_out = ExtensionTarget::from_range(gate, range);
self.double_arithmetic_extension(F::ONE, F::NEG_ONE, b, y, y, b, x, first_out)
.1
}