Skip to content

chore(deps): replace golang.org/x/crypto/sha3 with go-keccak, upgrade x/crypto#1064

Merged
rvagg merged 1 commit intomainfrom
rvagg/keccak
Jan 29, 2026
Merged

chore(deps): replace golang.org/x/crypto/sha3 with go-keccak, upgrade x/crypto#1064
rvagg merged 1 commit intomainfrom
rvagg/keccak

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Jan 28, 2026

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

… 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
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 with github.com/filecoin-project/go-keccak.NewLegacyKeccak256().
  • Upgraded golang.org/x/crypto to v0.47.0 (and related indirect golang.org/x/* module versions).
  • Added github.com/filecoin-project/go-keccak v0.1.0 to 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
Copy link
Copy Markdown

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.57%. Comparing base (dc95659) to head (293f335).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
merkle/merkle.go 91.91% <100.00%> (ø)

... and 6 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-project-automation github-project-automation bot moved this from Todo to In review in F3 Jan 28, 2026
@rvagg rvagg merged commit 5ba5761 into main Jan 29, 2026
20 of 21 checks passed
@rvagg rvagg deleted the rvagg/keccak branch January 29, 2026 12:54
@github-project-automation github-project-automation bot moved this from In review to Done in F3 Jan 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants