Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

[WIP] Keccak circuit final assembly#542

Closed
CPerezz wants to merge 29 commits into
mainfrom
keccak_final_assembly
Closed

[WIP] Keccak circuit final assembly#542
CPerezz wants to merge 29 commits into
mainfrom
keccak_final_assembly

Conversation

@CPerezz
Copy link
Copy Markdown
Contributor

@CPerezz CPerezz commented May 30, 2022

No description provided.

@github-actions github-actions Bot added crate-gadgets Issues related to the gadgets workspace member crate-keccak Issues related to the keccak workspace member labels May 30, 2022
@CPerezz CPerezz force-pushed the keccak_final_assembly branch from e5723db to a66b2e4 Compare June 7, 2022 10:52
@CPerezz CPerezz force-pushed the keccak_final_assembly branch 2 times, most recently from 2fa5c70 to 8136cd4 Compare June 28, 2022 07:49
@CPerezz
Copy link
Copy Markdown
Contributor Author

CPerezz commented Jun 28, 2022

This currently adds all of the "costly" stuff into the circuit.
As discussed with @ChihChengLiang we will benchmark this approach and @Brechtpd 's one (https://github.com/Brechtpd/zkevm-circuits/blob/ba17637e5f13e83434223cc3335213b5c686d9d8/zkevm-circuits/src/keccak_circuit/keccak_packed_multi.rs#L899) and continue with the one that performs better.

The things missing now are copy constraints into the lookup table. But nothing regarding RLCs or permutation which are the really expensive ones.

Once we analyze the benchmark results, we will be able to see which is the solution we should invest time into finish, polish etc..

@CPerezz CPerezz added the benchmarks: Keccak Triggers a Keccak round benchmark label Jun 28, 2022
@github-actions github-actions Bot added crate-circuit-benchmarks Issues related to the circuit-benchmarks workspace member T-bench Type: benchmark improvements labels Jun 28, 2022
@CPerezz CPerezz marked this pull request as ready for review June 28, 2022 13:04
@CPerezz CPerezz added benchmarks: Keccak Triggers a Keccak round benchmark and removed benchmarks: Keccak Triggers a Keccak round benchmark labels Jun 28, 2022
CPerezz added 18 commits June 30, 2022 09:11
On this way we can collect all the expr-related functions and re-use
them cross-crates.
Since the padding of the `next_inputs` is given in base-2,
`AbsorbConfig` has been refactored to get the `next_inputs` as
`AssignedCells` as well as performing the base conversion `2->9` inside.
We need to perform RLC in order to be able to check that the
permutations are executed correctly inside keccak.

This config will enable that possibility for us.
This is the last step before integrating together all the keccak pieces
and connect them via RLC.
In order to construct witness data for the hash message, we need to be
able to split the entire hash into each permutation member to have a
better control over it's assignation in the circuit.

This is a starting point to solve the issue.
@CPerezz CPerezz force-pushed the keccak_final_assembly branch from 0266873 to c38d296 Compare June 30, 2022 13:09
@github-actions github-actions Bot removed crate-circuit-benchmarks Issues related to the circuit-benchmarks workspace member T-bench Type: benchmark improvements labels Jun 30, 2022
CPerezz added 4 commits June 30, 2022 15:46
Since the RLC result is now returned by the assignation fn, it needs to
be constrained outside in the testing config with a specific gate for
it.
@CPerezz CPerezz added benchmarks: Keccak Triggers a Keccak round benchmark and removed benchmarks: Keccak Triggers a Keccak round benchmark labels Jun 30, 2022
@github-actions github-actions Bot added crate-circuit-benchmarks Issues related to the circuit-benchmarks workspace member T-bench Type: benchmark improvements labels Jun 30, 2022
@CPerezz CPerezz added benchmarks: Keccak Triggers a Keccak round benchmark and removed benchmarks: Keccak Triggers a Keccak round benchmark labels Jul 1, 2022
@ChihChengLiang
Copy link
Copy Markdown
Collaborator

I think this is outdated. Thank you @CPerezz for working on this one.

@CPerezz CPerezz deleted the keccak_final_assembly branch November 30, 2022 11:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

benchmarks: Keccak Triggers a Keccak round benchmark crate-circuit-benchmarks Issues related to the circuit-benchmarks workspace member crate-gadgets Issues related to the gadgets workspace member crate-keccak Issues related to the keccak workspace member T-bench Type: benchmark improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants