mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-05-20 08:49:29 +00:00
Avoid underflow when checking the length of terms
This commit is contained in:
parent
49e4307820
commit
799ff26e71
@ -107,7 +107,7 @@ impl<const D: usize> ReducingFactorTarget<D> {
|
|||||||
let l = terms.len();
|
let l = terms.len();
|
||||||
|
|
||||||
// For small reductions, use an arithmetic gate.
|
// For small reductions, use an arithmetic gate.
|
||||||
if l - 1 <= ArithmeticExtensionGate::<D>::new_from_config(&builder.config).num_ops {
|
if l <= ArithmeticExtensionGate::<D>::new_from_config(&builder.config).num_ops + 1 {
|
||||||
let terms_ext = terms
|
let terms_ext = terms
|
||||||
.iter()
|
.iter()
|
||||||
.map(|&t| builder.convert_to_ext(t))
|
.map(|&t| builder.convert_to_ext(t))
|
||||||
@ -162,7 +162,7 @@ impl<const D: usize> ReducingFactorTarget<D> {
|
|||||||
let l = terms.len();
|
let l = terms.len();
|
||||||
|
|
||||||
// For small reductions, use an arithmetic gate.
|
// For small reductions, use an arithmetic gate.
|
||||||
if l - 1 <= ArithmeticExtensionGate::<D>::new_from_config(&builder.config).num_ops {
|
if l <= ArithmeticExtensionGate::<D>::new_from_config(&builder.config).num_ops + 1 {
|
||||||
return self.reduce_arithmetic(terms, builder);
|
return self.reduce_arithmetic(terms, builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user