Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions verifier/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ pub enum VerifierError {
/// This error occurs when base field read by a verifier from a proof does not match the
/// base field of AIR with which the verifier was instantiated.
InconsistentBaseField,
/// This error occurs when the low-degree extension domain size of the AIR does not match
/// the domain size of the FRI verifier.
InconsistentDomainSize {
/// The domain size expected by the AIR.
air_domain_size: usize,
/// The domain size used by the FRI verifier.
fri_domain_size: usize,
},
/// This error occurs when the base field in which the proof was generated does not support
/// field extension of degree specified by the proof.
UnsupportedFieldExtension(usize),
Expand Down Expand Up @@ -60,6 +68,9 @@ impl fmt::Display for VerifierError {
Self::InconsistentBaseField => {
write!(f, "base field of the proof does not match base field of the specified AIR")
}
Self::InconsistentDomainSize { air_domain_size, fri_domain_size } => {
write!(f, "inconsistent domain sizes: AIR expects domain size {air_domain_size}, but FRI verifier uses domain size {fri_domain_size}")
}
Self::UnsupportedFieldExtension(degree) => {
write!(f, "field extension of degree {degree} is not supported for the proof base field")
}
Expand Down
9 changes: 8 additions & 1 deletion verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,14 @@ where
air.trace_poly_degree(),
)
.map_err(VerifierError::FriVerificationFailed)?;
// TODO: make sure air.lde_domain_size() == fri_verifier.domain_size()

// Verify that the AIR's LDE domain size matches the FRI verifier's domain size
if air.lde_domain_size() != fri_verifier.domain_size() {
return Err(VerifierError::InconsistentDomainSize {
air_domain_size: air.lde_domain_size(),
fri_domain_size: fri_verifier.domain_size(),
});
}

// 5 ----- trace and constraint queries -------------------------------------------------------
// read proof-of-work nonce sent by the prover
Expand Down