pluto / ronkathon

Cryptography Educational Foundations
https://pluto.xyz/blog/ronkathon-learn-cryptography-from-first-principles
MIT License
135 stars 13 forks source link

feat: Tiny Poseidon #75

Closed 0xJepsen closed 4 weeks ago

0xJepsen commented 1 month ago

a toy implementation of Poseidon.

lonerapier commented 1 month ago

@0xJepsen if available, would love to hack on this.

0xJepsen commented 1 month ago

Feel free to take a crack at it :)

lonerapier commented 1 month ago

@0xJepsen should this also contain round constants generator scripts? or is it okay if we pre-generate round constants for our chosen field?

0xJepsen commented 1 month ago

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!