The upstream libray has removed the assembly-based implementation of
keccak. We need to maintain our own library to avoid a peformance
regression.
---------
Co-authored-by: Felix Lange <fjl@twurst.com>
Co-authored-by: lightclient <lightclient@protonmail.com>
* 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>
* p2p: using testing.B.Loop
* core/state: using testing.B.Loop
* eth: using testing.B.Loop
* log: using testing.B.Loop
* core: using testing.B.Loop
* core/vm: using testing.B.Loop
* core/types: using testing.B.Loop
* crypto: using testing.B.Loop
This PR creates a global hasher pool that can be used by all packages.
It also removes a bunch of the package local pools.
It also updates a few locations to use available hashers or the global
hashing pool to reduce allocations all over the codebase.
This change should reduce global allocation count by ~1%
---------
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
Aligns the marshaling behavior of gnark to google and cloudflare
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
This PR improves the IsOnCurve methods for BN254 G2 points by:
* Clarifying its behavior the docstring, making it explicit that it
verifies both the point being on the curve and in the correct subgroup.
* Adding an in-line comment explaining the subgroup membership check
(c.Mul(Order)).
* Minor wording adjustments for readability and consistency.
Co-authored-by: Antonio Sanso <antonio.sanso@gmail.com>
Adds marshaling fuzzing for G1 and G2 to oss-fuzz.
Also aligns the behavior of the google library to that of gnark and
cloudflare, which only ever read the first 64 / 128 bytes of the input,
regardless of how long the input is
Co-authored-by: Marius van der Wijden <m.vanderwijden@live.de>