Skip to content

keccakf precompile + GKR-IOP integration#893

Merged
spherel merged 18 commits into
scroll-tech:tianyi/refactor-proverfrom
Inversed-Tech:mihai/keccakf_integration
May 2, 2025
Merged

keccakf precompile + GKR-IOP integration#893
spherel merged 18 commits into
scroll-tech:tianyi/refactor-proverfrom
Inversed-Tech:mihai/keccakf_integration

Conversation

@mcalancea

@mcalancea mcalancea commented Apr 1, 2025

Copy link
Copy Markdown
Contributor

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
Comment thread ceno_zkvm/src/structs.rs Outdated
Comment thread ceno_zkvm/src/structs.rs Outdated
Comment thread ceno_zkvm/src/structs.rs Outdated
@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
@spherel
spherel merged commit 09a1808 into scroll-tech:tianyi/refactor-prover May 2, 2025
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.

3 participants