Skip to content

Commit 91cd165

Browse files
authored
Merge pull request #5 from cardano-scaling/perturbing/fix-coeff-empty-list
add case where list is empty for coeff function
2 parents ea628ba + e705f8e commit 91cd165

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

rust_accumulator/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ pub fn fft_mul(left: &[Scalar], right: &[Scalar]) -> Vec<Scalar> {
6969
pub fn get_coeff_from_roots(roots: &[Scalar]) -> Vec<Scalar> {
7070
let n = roots.len();
7171

72+
if n == 0 {
73+
return vec![Scalar::ONE];
74+
}
75+
7276
if n == 1 {
7377
return vec![roots[0], Scalar::ONE];
7478
}

0 commit comments

Comments
 (0)