Open
Conversation
The signature is the same as for `persistentHash` (SHA-256). It is implemented in the JS target by a runtime function `keccakHash` with the same signature as the existing runtime function `persistentHash`. It is implemented in ZKIR v3 with a single new operation `keccak_hash` with the same signature as the existing `persistent_hash` operation. It is unsupported in ZKIR v2 and it is a compile-time error to use it in an impure circuit without passing the experimental feature flag `--feature-zkir-v3`. Signed-off-by: Kevin Millikin <kevin.millikin@shielded.io>
Plugin Test Summary 1 files 3 suites 1s ⏱️ Results for commit 079eba3. ♻️ This comment has been updated with latest results. |
Signed-off-by: Kevin Millikin <kevin.millikin@shielded.io>
Compactc E2E Test Summary 1 files ± 0 1 suites - 47 5m 31s ⏱️ + 3m 3s Results for commit 079eba3. ± Comparison against base commit 1db6cba. This pull request removes 481 and adds 2827 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
keccakHash to the standard librarykeccak256 to the standard library
…ependently audited library
Signed-off-by: Kevin Millikin <kevin.millikin@shielded.io>
Signed-off-by: Kevin Millikin <kevin.millikin@shielded.io>
Implement keccak256
Signed-off-by: Kevin Millikin <kevin.millikin@shielded.io>
dybvig
approved these changes
Apr 1, 2026
| `persistentHash`. Adds `keccak256` to the Compact runtime with the same | ||
| signature as `persistentHash`. `keccak256` requires the experimental feature | ||
| flag `--feature-zkir-v3` to work in an impure circuit (or called from an | ||
| impure circuit). It is a compiler error to use it in an impure circuit using |
Contributor
There was a problem hiding this comment.
I believe this should read: "impure" => "circuit that reads or writes public state". A circuit that invokes a witness but doesn't read or write public state is impure, but the restriction doesn't apply to it.
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.
The signature is the same as for
persistentHash(SHA-256). It is implemented in the JS target by a runtime functionkeccak256with the same signature as the existing runtime functionpersistentHash. It is implemented in ZKIR v3 with a single new operationkeccak256with the same signature as the existingpersistent_hashoperation.It is unsupported in ZKIR v2 and it is a compile-time error to use it in an impure circuit without passing the experimental feature flag
--feature-zkir-v3.