-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sha256_var crashes in runtime #5836
Labels
bug
Something isn't working
Comments
cc @vezenovm |
Ah I think I know what this is, will push something in a moment. EDIT: I have a fix |
5 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Aug 28, 2024
…block compression under certain cases (#5838) # Description ## Problem\* Resolves #5836 ## Summary\* We accept a start index based upon the current block when parsing a message. We should accurately base the upper bound to be based upon this start index. We also have special handling for building a message block but not compressing it when the message is less than the block size. We need to also do this handling for the last message block when we have a message that is larger than the block size. ## Additional Context ~~sha256_var is currently getting warnings from the under constrained check. It looks to only be happening on the new regression test added as part of this PR that uses a larger message. The old sha256 tests do not look to trigger these warnings which is strange. I am a bit unsure why I am getting these warnings as msg block and msg block pointer are being verified on each iteration of the loop.~~ <img width="965" alt="Screenshot 2024-08-27 at 12 04 58 PM" src="https://github.com/user-attachments/assets/c71bff9d-bfea-4765-a134-91eca92c7806"> EDIT: This was only happening as my test was hashing constant values, thus it was a dumb circuit. e.g the following: ```rust fn main(result: pub [u8; 32]) { let headers = [102, 114, 111, 109, 58, 114, 117, 110, 110, 105, 101, 114, 46, 108, 101, 97, 103, 117, 101, 115, 46, 48, 106, 64, 105, 99, 108, 111, 117, 100, 46, 99, 111, 109, 13, 10, 99, 111, 110, 116, 101, 110, 116, 45, 116, 121, 112, 101, 58, 116, 101, 120, 116, 47, 112, 108, 97, 105, 110, 59, 32, 99, 104, 97, 114, 115, 101, 116]; let hash = std::hash::sha256_var(headers, headers.len() as u64); assert_eq(hash, result); } ``` The message needs to come from the inputs and the under-constrained warnings go away. ## 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.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Aim
Getting a sha256 hash of some data. I am using a new version of
sha256_var
from #5760.Expected Behavior
I got a hash
Bug
I got a runtime error:
To Reproduce
noirup -C c52dc1c
Workaround
None
Workaround Description
No response
Additional Context
Caused by #5760
Project Impact
Blocker
Blocker Context
No response
Nargo Version
No response
NoirJS Version
No response
Proving Backend Tooling & Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: