-
Notifications
You must be signed in to change notification settings - Fork 809
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
Iota refactor #538
Iota refactor #538
Conversation
2fae2e0
to
f8b063b
Compare
f8b063b
to
5a79b05
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.
Great work! Just some comments!
keccak256/src/permutation/iota.rs
Outdated
round_constant_b13: F, | ||
round_constants_b9: [BigUint; PERMUTATION], |
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.
Why does the config need to store the constants?
We already know them right? So we can just take them directly from the constants
file where they're defined.
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.
The type of F is known at the configuration time, and we eventually need to convert them to F at some point. Config is the earliest possible place to define them.
Co-authored-by: Carlos Pérez <37264926+CPerezz@users.noreply.github.com>
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.
Nice work!
LGTM
* xx * fix: skip first 12 bytes for eth address * chore: fmt * feat: add sig table to evm circuit * impl SubCircuit trait for TxCircuitTester * fill r s v in test_util sig * lint * lint * clean code * chore: refactoring witness assignment * [fix] soundness bug in ctr int (privacy-scaling-explorations#543) * [fix] soundness bug in ctr int * [fix] clippy * move assign function to make git diff easier * Feat: assert v is odd (privacy-scaling-explorations#546) * [fix] soundness bug in ctr int * [fix] clippy * [feat] implement v_is_odd check * [fix] extract v from affine coord * [chore] cargo clippy; fmt --------- Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com> * address some comments * fix instance col * fix v permutation * sync up changes with halo2-lib; remove lifetimers (privacy-scaling-explorations#554) * [fix] sync up api changes with halo2-lib: removing lifetimes * [minor] update cargo lock * [chore] clippy; update cargo lock * Update sig_circuit.rs --------- Co-authored-by: Zhang Zhuo <mycinbrin@gmail.com> * lint * add lookup to sig table in tx circuit * add lookup to sig table in tx_circuit * remove get_num_rows_required * Update tx_circuit.rs * fix sig circuit assignment * fix: sign_data of padding tx * fmt --------- Co-authored-by: Rohit Narurkar <rohit.narurkar@protonmail.com> Co-authored-by: zhenfei <zhenfei.zhang@hotmail.com> Co-authored-by: kunxian xia <xiakunxian130@gmail.com>
What we did
Why does it work?
The original 3 gates:
The new gate
We argue the new gate can achieve all the functionalities of the old gates.
First, the values of round constants and A4 are known at the setup time. So does the multiplication of them. So we can move them into fixed columns. This saved some verifying time overheads.
Second,
(const__1 - adv__mixing)
andadv__mixing
can be achieved byadv__flag
. We can just copy the right cells to theadv__flag
respectively.Performance
Before
After
TODO