-
Notifications
You must be signed in to change notification settings - Fork 225
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sha256): Add extra checks against message size when constructing …
…msg blocks (#5861) # Description ## Problem\* Resolves <!-- Link to GitHub Issue --> Issue found in zk passport https://github.com/ocelots-app/passport-verifier/blob/47e9464e7e782b07b6d791bf1d13257fce2f486b/crates/lib/data-check/integrity/src/lib.nr#L118 when performing sha on a message with a large padding. ## Summary\* The current sha algorithm accounts for message padding, but only where ithe padding is still contained in the block we are compressing. For the case where we have a padding that extends multiple blocks past the message size we end up with a correctness error. We need to add more checks against the message size to make sure we are comrpessing the correct msg block. An increase in gate count is expected from these changes. ## Additional Context ## Documentation\* Check one: - [X] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** Documentation to be submitted in a separate PR. # PR Checklist\* - [X] I have tested the changes locally. - [X] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: Michael J Klein <michaeljklein@users.noreply.github.com>
- Loading branch information
1 parent
cfd68d4
commit 46e266a
Showing
3 changed files
with
46 additions
and
19 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
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
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