kadena-io / pact

The Pact Smart Contract Language
https://docs.kadena.io/build/pact
BSD 3-Clause "New" or "Revised" License
579 stars 100 forks source link

feat/poseidon-hash #1274

Closed davibauer closed 9 months ago

davibauer commented 1 year ago

PR checklist:

Additionally, please justify why you should or should not do the following:

CryptoPascal31 commented 1 year ago

I am very interested by this PR.

Let me ask some questions:

You've chosen different round numbers than recommended by the Research Paper: 53 partials rounds here , vs 57 in the paper for exp=5, Security=128 bits, arity=3 (table 2). And you've chosen different constants values (for ARC layer and Mix layers) than the reference implementation proposed by the authors.

As a consequence, your tests don't match with the reference test vectors. And this is not compatible with many others implementations (eg Circom ZK circuit compiler)

Any reason for that ?

Anyway, the parameters used should be documented somewhere. Poseidon is not a standard and there are many tweakable parameters.

edmundnoble commented 9 months ago

Closing in favor of #1313, which is merged.