Skip to content
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

SHA-512 improvements #181

Open
wwared opened this issue Sep 30, 2024 · 0 comments
Open

SHA-512 improvements #181

wwared opened this issue Sep 30, 2024 · 0 comments

Comments

@wwared
Copy link
Contributor

wwared commented Sep 30, 2024

As a follow-up to #179, things that we can improve in the SHA-512 implementation:

  • The Add operation does not need to range check the inputs since we can assume they are bytes (either as an XOR result or because they come from the ZKVM) (comment)
  • Use an Add4 gadget that accepts 64-bit words (comment)
  • Use a garbage-in/garbage-out approach for the i iteration counter. Technically, the circuit does not need to range-check the i values since the sha-512 lib will set up the right values and we can assume they are correct. If they are incorrect, you get a garbage result, but we don't need to explicitly check it. (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant