Skip to content

Commit

Permalink
Fixed error whereby boolean value returned by path.verify was neglected
Browse files Browse the repository at this point in the history
Co-authored-by: Cesar Descalzo <Cesar199999@users.noreply.github.com>

Co-authored-by: mmagician <marcin.gorny.94@protonmail.com>
  • Loading branch information
Antonio95 and mmagician committed Jun 3, 2024
1 parent a5cf4cf commit 8d356db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions poly-commit/src/linear_codes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,8 +442,12 @@ where
return Err(Error::InvalidCommitment);
}

path.verify(leaf_hash_param, two_to_one_hash_param, root, leaf.clone())
.map_err(|_| Error::InvalidCommitment)?;
if !path
.verify(leaf_hash_param, two_to_one_hash_param, root, leaf.clone())
.map_err(|_| Error::InvalidCommitment)?
{
return Ok(false);
}
}

// Helper closure: checks if a.b = c.
Expand Down

0 comments on commit 8d356db

Please sign in to comment.