-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Blake2s round precompile #176
Conversation
2481b2d
to
ce4b853
Compare
ce4b853
to
b4c74f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks pretty good at first glance! I'll come back to this.
61fa060
to
4bcefbd
Compare
4bcefbd
to
430087a
Compare
The constraints look good, though I'm taking a better look to see if we can do some optimizations (for example, by using transition constraints and chaining the calls to the compression function, avoiding extra memory accesses). I was wondering where the test vectors came from. There are some proposed in the RFC and was wondering if they cam from there. Would it also be possible to show a full end-to-end test that computes a full hash using the precompile. The classic would be checking |
@adr1anh, this precompile implements single round function of Blake2s - not a whole compress function, so I extracted the test values by injecting printlns directly into the macro code, using |
After merging #176, the old parameters were invalidated.
After merging #176, the old parameters were invalidated. Co-authored-by: wwared <[email protected]>
This PR implements gadget and syscall for Blake2s round function.
The integrated code that allows using this syscall in external sphinx programs is located in zkvm branch of RustCrypto.
The following is a comparison of single Blake2s hashing inside Sphinx program without / with precompile:
TODO: