fastssz icon indicating copy to clipboard operation
fastssz copied to clipboard

incompatibility between zeroHashes and custom hash function

Open olegrok opened this issue 1 year ago • 2 comments

In case you want to provide custom hash function behavior can be quite unexpected.

It happens because zeroHashes is global variable that is initialized by default with sha256:

https://github.com/ferranbt/fastssz/blob/f43e88e3e05ffc6f01540c312653d471a10d2ff2/hasher.go#L39

olegrok avatar Jun 05 '24 13:06 olegrok

Hi, what is your use case for a custom hash function?

ferranbt avatar Jun 05 '24 16:06 ferranbt

Hi! I want to use poseidon hash instead of sha256

olegrok avatar Jun 05 '24 16:06 olegrok