ferranbt / fastssz

Fast Ethereum2.0 SSZ encoder/decoder
MIT License
73 stars 44 forks source link

incompatibility between zeroHashes and custom hash function #163

Open olegrok opened 2 months ago

olegrok commented 2 months ago

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

ferranbt commented 2 months ago

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

olegrok commented 2 months ago

Hi! I want to use poseidon hash instead of sha256