Skip to content

Commit

Permalink
Feat/thiserror brainfuck prover (#26)
Browse files Browse the repository at this point in the history
* feat: add thiserror to workspace

* feat: add custom error for verify_brainfuck

* refactor: only use VerificationError from stwo_prover
  • Loading branch information
zmalatrax authored Nov 7, 2024
1 parent 027540e commit 1bcdce9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions crates/brainfuck_prover/src/brainfuck_air/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,9 @@ pub fn verify_brainfuck(
let interaction_elements = BrainfuckInteractionElements::draw(channel);
// Check that the lookup sum is valid, otherwise throw
// TODO: panic! should be replaced by custom error
assert!(
!lookup_sum_valid(&claim, &interaction_elements, &interaction_claim),
"Invalid lookup sum."
);
if !lookup_sum_valid(&claim, &interaction_elements, &interaction_claim) {
return Err(VerificationError::InvalidLookup("Invalid logup sum".to_string()));
};
interaction_claim.mix_into(channel);
commitment_scheme_verifier.commit(proof.commitments[1], &sizes[1], channel);

Expand Down

0 comments on commit 1bcdce9

Please sign in to comment.