chore(deps): replace golang.org/x/crypto/sha3 with go-keccak, upgrade x/crypto#1064
Merged
chore(deps): replace golang.org/x/crypto/sha3 with go-keccak, upgrade x/crypto#1064
Conversation
… x/crypto Replace all usage of golang.org/x/crypto/sha3.NewLegacyKeccak256() with github.com/filecoin-project/go-keccak, which vendors the assembly-optimised Keccak permutation from x/crypto@v0.43.0. Starting with x/crypto v0.44.0, the upstream package removed its amd64 assembly in favor of Go's standard library crypto/sha3, which does not provide an assembly fast path for legacy Keccak functions. With the keccak dependency decoupled, upgrade golang.org/x/crypto to v0.47.0. Ref: #1055 Ref: filecoin-project/lotus#13443 Ref: ethereum/go-ethereum#33323
There was a problem hiding this comment.
Pull request overview
Updates the project’s legacy Keccak-256 hashing implementation to preserve an amd64 assembly fast path while allowing golang.org/x/crypto to be upgraded independently.
Changes:
- Replaced
golang.org/x/crypto/sha3.NewLegacyKeccak256()usage withgithub.com/filecoin-project/go-keccak.NewLegacyKeccak256(). - Upgraded
golang.org/x/cryptotov0.47.0(and related indirectgolang.org/x/*module versions). - Added
github.com/filecoin-project/go-keccak v0.1.0to module dependencies.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| merkle/merkle.go | Switches legacy Keccak hasher construction to go-keccak while keeping the same call sites. |
| go.mod | Adds go-keccak and upgrades golang.org/x/crypto (plus indirect golang.org/x/* updates). |
| go.sum | Records checksum entries for go-keccak and updated golang.org/x/* module versions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1064 +/- ##
==========================================
+ Coverage 65.39% 65.57% +0.18%
==========================================
Files 81 81
Lines 8001 8001
==========================================
+ Hits 5232 5247 +15
+ Misses 2236 2226 -10
+ Partials 533 528 -5
🚀 New features to boost your workflow:
|
Kubuxu
approved these changes
Jan 28, 2026
This was referenced Feb 4, 2026
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.
Replace all usage of golang.org/x/crypto/sha3.NewLegacyKeccak256() with github.com/filecoin-project/go-keccak, which vendors the assembly-optimised Keccak permutation from x/crypto@v0.43.0. Starting with x/crypto v0.44.0, the upstream package removed its amd64 assembly in favor of Go's standard library crypto/sha3, which does not provide an assembly fast path for legacy Keccak functions.
With the keccak dependency decoupled, upgrade golang.org/x/crypto to v0.47.0.
Ref: #1055
Ref: filecoin-project/lotus#13443
Ref: ethereum/go-ethereum#33323