Closed 0xJepsen closed 4 weeks ago
@0xJepsen if available, would love to hack on this.
Feel free to take a crack at it :)
@0xJepsen should this also contain round constants generator scripts? or is it okay if we pre-generate round constants for our chosen field?
I think for now it make sense for this to be generic over round constants. I thought the type of abstraction in plonky3 was really nice https://github.com/Plonky3/Plonky3/blob/ed21a5e11cb20effadaab606598ccad4e70e1a3e/poseidon/src/lib.rs#L18
Then if it's generic we can implement Grain LSFR after to generate secure round constants. then we can also implement a sponge trait which would be nice in keccak.
I think making configurable so we can write tests that show it's insecure with insecure parameters is a good idea and helps us to understand the security assumptions.
This is also good in the efforts of evaluating the security properties of Poseidon more rigorously later down the line too!
a toy implementation of Poseidon.