Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add check for unused deserialization data (#83)
Adds an extra check for unused deserialization data to ensure proof serialization is canonical. Removes redundant length checks. Currently, serialized proof data is read as [chunks](https://github.com/tari-project/bulletproofs-plus/blob/e01c380186111c1fbe3fba213d1b492beff11b9d/src/range_proof.rs#L1017-L1020) and [tuples](https://docs.rs/itertools/latest/itertools/trait.Itertools.html#method.tuples) for parsing purposes. Each of these functions can have leftover data. However, existing length checks ensure such conditions cannot occur. This PR replaces the length checks with a final check that there is no leftover data. This helps to assert that serialization is canonical and simplifies deserialization. Closes #82.
- Loading branch information
1 parent
a81b105
commit 55191b8
Showing
1 changed file
with
25 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters