Skip to content

Commit feb370e

Browse files
committed
add degree check on g_j
1 parent 2ab5ae8 commit feb370e

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

crates/provers/gkr/src/sumcheck.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ where
148148
}
149149
}
150150

151+
// Check that the degree of g_j does not exceed the theoretical bound
152+
if g_j.degree() > 2 {
153+
return Err(crate::verifier::VerifierError::InvalidDegree);
154+
}
155+
151156
// Verify `g_j(0) + g_j(1) = m_{j-1}`, where:
152157
// `m_{j-1} = g_{j-1} (s_{j-1})`, the previous claimed sum.
153158
let g_j_0 = g_j.evaluate::<F>(&FieldElement::zero());

crates/provers/gkr/src/verifier.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use lambdaworks_crypto::fiat_shamir::{
1414
#[derive(Debug)]
1515
pub enum VerifierError {
1616
InvalidProof,
17+
InvalidDegree,
1718
MultilinearPolynomialEvaluationError,
1819
SumcheckError,
1920
CircuitError,

0 commit comments

Comments
 (0)