Skip to content

feat(arithmetization): sha2 precompile - #3789

Open
arijitdutta67 wants to merge 7 commits into
feat/ecrecover-zkc-precompfrom
feat/sha2-zkc-precompile
Open

feat(arithmetization): sha2 precompile#3789
arijitdutta67 wants to merge 7 commits into
feat/ecrecover-zkc-precompfrom
feat/sha2-zkc-precompile

Conversation

@arijitdutta67

Copy link
Copy Markdown
Contributor

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • If this change is deployed to any environment (including Devnet), E2E test coverage exists or is included in this
    PR.
  • I have informed the team of any breaking changes if there are any.

Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
@arijitdutta67 arijitdutta67 self-assigned this Aug 13, 2026
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>
Signed-off-by: arijitdutta67 <arijit.dutta67@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread prover-ray/zkcdriver/testdata/sha2_run.zkc
Comment thread arithmetization/src/test/Makefile
Comment thread .claude/settings.json Outdated
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 arijitdutta67 changed the title feat: sha2 precompile feat(arithmetization): sha2 precompile Aug 17, 2026
@arijitdutta67
arijitdutta67 marked this pull request as ready for review August 17, 2026 11: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