go-ethereum/crypto
Daniel Liu 99749a2381
feat(crypto): use the ziren keccak precompile and implement ziren keccak state #32816 #32996 (#1991)
* feat(crypto): use the ziren keccak precompile #32816

Uses the go module's `replace` directive to delegate keccak computation
to precompiles.

This is still in draft because it needs more testing. Also, it relies on
a PR that I created, that hasn't been merged yet.

_Note that this PR doesn't implement the stateful keccak state
structure, and it reverts to the current behavior. This is a bit silly
since this is what is used in the tree root computation. The runtime
doesn't currently export the sponge. I will see if I can fix that in a
further PR, but it is going to take more time. In the meantime, this is
a useful first step_

* feat(crypto): implement ziren keccak state #32996

The #32816 was only using the keccak precompile for some minor task.
This PR implements a keccak state, which is what is used for hashing the
tree.

---------

Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2026-02-05 14:43:53 +05:30
..
blake2b all: fix invalid directive syntax for golangci-lint nolint (#1799) 2025-12-08 13:02:54 +05:30
bn256 perf(all): use big.Int.Sign() to compare with 0 (#1969) 2026-02-05 11:45:44 +05:30
ecies crypto/ecies: use aes blocksize (#1946) 2026-01-19 11:25:15 +05:30
secp256k1 all: replace Div/Mul with Rsh/Lsh if possible #29911 (#1966) 2026-01-29 11:31:58 +05:30
crypto.go feat(crypto): use the ziren keccak precompile and implement ziren keccak state #32816 #32996 (#1991) 2026-02-05 14:43:53 +05:30
crypto_test.go all: using testing.B.Loop (#1554) 2025-09-24 07:59:48 +08:00
keccak.go feat(crypto): use the ziren keccak precompile and implement ziren keccak state #32816 #32996 (#1991) 2026-02-05 14:43:53 +05:30
keccak_ziren.go feat(crypto): use the ziren keccak precompile and implement ziren keccak state #32816 #32996 (#1991) 2026-02-05 14:43:53 +05:30
signature_cgo.go crypto: use pure Go signature implementation in tinygo #31878 (#1226) 2025-07-26 17:33:55 +08:00
signature_nocgo.go crypto: validate hash length in nocgo Sign #33104 (#1773) 2025-11-14 20:10:48 +05:30
signature_test.go all: using testing.B.Loop (#1554) 2025-09-24 07:59:48 +08:00