[Keccak] Thinest and longest#596
Conversation
ff2b14a to
d87a5b3
Compare
6f4b841 to
e0602af
Compare
e0602af to
25cec7e
Compare
800037f to
349e2d9
Compare
349e2d9 to
b89328f
Compare
25cec7e to
dcf1f0b
Compare
dcf1f0b to
99412eb
Compare
CPerezz
left a comment
There was a problem hiding this comment.
So far looks nice.
I's always a nice and grateful job if you can chop off 1000+ lines of code!!
I've added a comment and some remarks about performance and layout structure.
Just need you to fix the comment, the other stuff is just informative :)
| let mut input_cells = vec![]; | ||
| let mut output_b9_cells = vec![]; | ||
| let mut output_b13_cells = vec![]; | ||
| for (offset, input_coef) in input_coefs.iter().enumerate() { |
There was a problem hiding this comment.
This is where I think we can optimize this a way more by not increasing the offset each time we add and input and instead increase the amount of columns used and not repeat it.
|
|
||
| pub fn assign_rho<F: Field>( | ||
| layouter: &mut impl Layouter<F>, | ||
| base13to9_config: &Base13toBase9TableConfig<F>, |
There was a problem hiding this comment.
If we pass the config with the columns already assigned instead of creating new ones, we are directly increasing the height of the entire thing.
Not saying to address it now, but these are the things that are causing us to have really tall layouts.
|
Results of the benchmarks: The results are really really nice! |
There was a problem hiding this comment.
LGTM!
To compare with #634, this implementation can process 219/64794 = 8.09 keccak_f per 2.298 seconds (≈ 3.52 keccak_f/s).
One low hanging fruit to improve is to stack all tables into one as 4-columns table, with an extra fixed tag column to select the table, it should be helpful to reduce both prove and verify.
68b30d8 to
9aabf7b
Compare
9aabf7b to
6b5de29
Compare
I think the most significant thing to address if we want to bring this impl to the competition is to fix the height of the base conversion. |
CPerezz
left a comment
There was a problem hiding this comment.
LGTM!
Nice job @ChihChengLiang 🎉
highlight:
Circuit layout: Click to expand!