iden3 / go-iden3-crypto

Go implementation of some cryptographic primitives (that fit inside the SNARK field) and compatible with circomlib
Apache License 2.0
117 stars 38 forks source link

Add HashWithState to increase its scalability #60

Closed hunshenshi closed 6 months ago

jeffprestes commented 8 months ago

Please do not get me wrong on the question, but in which real-world situation would this initial state be helpful? The previous results of other hash would be enough, wouldn't they?

hunshenshi commented 8 months ago

consistent with circomlibjs. In this way, the results of the two poseidon hash can be consistent. Thank you for your review.

mdehoog commented 7 months ago

+1, this would be useful for us too. When hashing more than 16 values, it can be useful to chain hashes together, such that the hash of the last 16 values is the initial state of the next 16. Opened #61 before seeing this one.

mdehoog commented 7 months ago

cc @OBrezhniev, would love some eyes on this if possible, thank you in advance!

OBrezhniev commented 6 months ago

LGTM! @hunshenshi @mdehoog Thank you for your contributions!