Skip to content

Commit 6ef1b7c

Browse files
committed
Zerocheck didn't support constant expr.
1 parent ba053c2 commit 6ef1b7c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

subprotocols/src/zerocheck.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,11 @@ where
270270
let len = poly.len() + 1;
271271
// last_sigma = (1 - point[round]) * eval_at_0 + point[round] * eval_at_1
272272
// eval_at_0 = (last_sigma - point[round] * eval_at_1) * inv(1 - point[round])
273-
let eval_at_0 =
274-
(last_sigma - point[round] * poly[0]) * inv_of_one_minus_point[round];
273+
let eval_at_0 = if !poly.is_empty() {
274+
(last_sigma - point[round] * poly[0]) * inv_of_one_minus_point[round]
275+
} else {
276+
last_sigma
277+
};
275278

276279
// Evaluations on degree, degree - 1, ..., 1, 0.
277280
let evals_iter_rev = chain![poly.into_iter().rev(), iter::once(eval_at_0)];

0 commit comments

Comments
 (0)