Skip to content

keccakf precompile + GKR-IOP integration #893

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

Open
wants to merge 18 commits into
base: tianyi/refactor-prover
Choose a base branch
from

Conversation

mcalancea
Copy link
Collaborator

@mcalancea mcalancea commented Apr 1, 2025

Note that this PR is done against tianyi/refactor-prover and not the master branch.

Contains the following:

  • A bitwise keccakf precompile implementation.
  • A lookup-based keccakf precompile implementation.
  • Partial integration of the GKR-IOP developed in tianyi/refactor-prover in the existing Ceno proving flow.

The lookup-based impl. is the superior one performance-wise; the bitwise one is rather a proof-of-concept and it might be relevant for benchmarking the proving system itself. The lookup version should be well documented by comments.

Some highlights of the integration code for keccakf:

  • There are two components: the old-style LargeEcallDummy circuit which handles memory state by doing the appropriate reads and writes but does not connect them logically (doesn't get into keccakf). The logic is handled by the GKR-IOP circuit.
  • Witnesses, output evaluations and lookups used by the GKR-IOP circuit are committed into the RMM of the LargeEcallDummy. This ensures we can reuse the existing tower proofs in scheme/prover.rs and provides access to these polynomials for PCS logic.
  • There is a new GKRIOPInstruction trait, conceived as a subtrait of Instruction. It generally makes calls to the corresponding methods in Instruction + does some extra work to implement the functionality as described above. It also has some other methods useful for syncing state between the two protocols.

Items that still need to be addressed to complete the integration:

  • PCS opening and verification for the GKR-IOP proof. The relevant witnesses/outputs/lookups are already committed in the same row-major matrix used by LargeEcallDummy. However the opening logic is missing.
  • The GKR-IOP proof crashes when the number of instances is not a power of two, some kind of padding is needed.

@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch from 77c289e to fce4a2c Compare April 2, 2025 15:39
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch from fce4a2c to 7611e70 Compare April 2, 2025 15:44
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch from 26d44d6 to 1cedbc8 Compare April 3, 2025 16:04
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch 4 times, most recently from 0ccd1ec to 246d9d2 Compare April 15, 2025 07:48
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch from 246d9d2 to dcf7c62 Compare April 17, 2025 07:45
@kunxian-xia kunxian-xia changed the base branch from master to tianyi/refactor-prover April 17, 2025 08:57
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch 3 times, most recently from 1004d3a to 3092d80 Compare April 24, 2025 16:40
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch from 3092d80 to 29e38a4 Compare April 24, 2025 17:10
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch 3 times, most recently from 8b27f78 to 8bacff0 Compare April 27, 2025 11:40
@mcalancea mcalancea changed the title Mihai/keccakf integration keccakf precompile + GKR-IOP integration Apr 27, 2025
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch 2 times, most recently from b8e8476 to 8c29f04 Compare April 27, 2025 15:24
@mcalancea mcalancea marked this pull request as ready for review April 27, 2025 15:24
@mcalancea mcalancea requested review from hero78119 and spherel April 27, 2025 15:24
@mcalancea mcalancea force-pushed the mihai/keccakf_integration branch from c2b111b to 6b9015d Compare April 27, 2025 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants