Skip to content

Commit

Permalink
Repair tests to wrap on overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
th4s committed Sep 16, 2023
1 parent 76ed767 commit c314fda
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mpz-core/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ mod test {
let message = [0, 1, 2, 3u8];
let (mut decommitment, commitment) = message.hash_commit();

decommitment.nonce.0[0] -= 1;
decommitment.nonce.0[0] = decommitment.nonce.0[0].wrapping_add(1);

let err = decommitment.verify(&commitment).unwrap_err();

Expand All @@ -129,7 +129,7 @@ mod test {
let message = [0, 1, 2, 3u8];
let (mut decommitment, commitment) = message.hash_commit();

decommitment.data[0] += 1;
decommitment.data[0] = decommitment.data[0].wrapping_add(1);

let err = decommitment.verify(&commitment).unwrap_err();

Expand Down

0 comments on commit c314fda

Please sign in to comment.