WEB3-398: Use tagged leaf hashing in aggregation set to improve missue resistance #526
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On
main
theRiscZeroSetVerifier.verifyIntegrity
function will accept internal nodes in the Merkle tree, and complete with reverting. This is not an intended use of this interface, and is a violation of the calling requirements as the passed hash is not the digest of a claim (this is similar to running ECDSA's verify operation on an unhashed message). However, this is misuse that can be mitigated by following the best practice of tagging Merkle tree leaves.This PR makes the aggregation set verifier more misuse resistant by tagging and hashing the leaves of the tree.
Additionally, the documentation on
IRiscZeroVerifier.verifyIntegrity
is updated to highlight the importance of the caller hashing the claim digest and to be more precise about the guarantees provided.Resolves: #525
Resolves: WEB3-397