feat(arithmetization): sha2 precompile - #3789
Open
arijitdutta67 wants to merge 7 commits into
Open
Conversation
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an optional SHA-256 accelerator spanning the RISC-V guest ABI, ZKC arithmetization, build configuration, and tests.
Changes:
- Implements SHA-256 constraints and custom-opcode dispatch.
- Adds Zig wrappers and selectable accelerated providers.
- Adds vectors, integration tests, and documentation.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
riscv-guests/README.md |
Documents SHA-256 acceleration. |
riscv-guests/lineth-accelerators/src/sha2.zig |
Adds the SHA-256 opcode wrapper. |
riscv-guests/lineth-accelerators/src/root.zig |
Exports the SHA-256 API. |
riscv-guests/l2-execution/src/zkvm_provide.zig |
Selects accelerated or software SHA-256. |
riscv-guests/l2-execution/README.md |
Documents accelerator options. |
riscv-guests/l2-execution/Makefile |
Adds SHA2_ACCEL support. |
riscv-guests/l2-execution/build.zig |
Defines the SHA-256 build option. |
prover-ray/zkcdriver/testdata/sha2_run.zkc |
Adds a proving test harness. |
prover-ray/zkcdriver/testdata/sha2_run.json |
Supplies SHA-256 vectors. |
prover-ray/zkcdriver/native_modules_test.go |
Registers the SHA-256 proving test. |
arithmetization/src/test/zkc/sha2/sha2_direct.zkc |
Adds direct constraint tests. |
arithmetization/src/test/zkc/sha2/sha2_direct.json |
Adds direct test vectors. |
arithmetization/src/test/zig/src/sha2/sha2_provider.zig |
Tests wrapper edge cases. |
arithmetization/src/test/zig/build.zig |
Propagates accelerator selection. |
arithmetization/src/test/README.md |
Documents SHA-256 test targets. |
arithmetization/src/test/Makefile |
Adds SHA-256 build and test targets. |
arithmetization/src/main/riscv/utils/constants.zkc |
Defines SHA-256 opcode constants. |
arithmetization/src/main/riscv/memory.zkc |
Adds SHA-256 scratch state. |
arithmetization/src/main/riscv/main.zkc |
Wires SHA-256 state into execution. |
arithmetization/src/main/riscv/interpreter.zkc |
Propagates SHA-256 interpreter state. |
arithmetization/src/main/riscv/instruction_processing/r_type.zkc |
Dispatches the custom opcode. |
arithmetization/src/main/lib/sha2/utils.zkc |
Implements SHA-256 operations. |
arithmetization/src/main/lib/sha2/impl.zkc |
Implements hashing and padding. |
arithmetization/src/main/lib/sha2/constants.zkc |
Defines SHA-256 constants. |
arithmetization/src/main/lib/README.md |
Marks SHA-256 as implemented. |
.claude/settings.json |
Adds local command permissions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
arijitdutta67
marked this pull request as ready for review
August 17, 2026 11:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements issue(s) #
Checklist
PR.