-
Notifications
You must be signed in to change notification settings - Fork 13
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: keccak/sha3 gadgets #14
Conversation
1c0e137
to
c20c66a
Compare
&a[x + 5usize], | ||
&a[x + 10usize], | ||
&a[x + 15usize], | ||
&a[x + 20usize], |
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.
These usize
type specifiers here and throughout this file seem unnecessary and just make reading/interpreting the algorithm harder.
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.
I think they're voluntary: the goal is to make it clear the operand is on an index variable, not on something supposed to represent one of the u64 or Uint64 being modeled here.
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.
It has the opposite effect for me, since without the annotation this should be fine iff x
is of the right type. The annotation makes it feel like some extra work is being done to coerce (although I know that's not the exact semantics either).
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 reasonable, and I didn't spot obvious optimization opportunities . For clarity: I didn't audit translation of the algorithm itself, just looked for low-hanging optimizations as requested.
Adds a tweaked variant of the zatoichi keccak gadget, ported to bellpepper, with added sha3 for good measure.