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

Feature/poseidon opt goff #15

Closed arnaucube closed 4 years ago

arnaucube commented 4 years ago

Optimize Poseidon migrating from *big.Int to goff generated finite field operations.

Also fixes #4 and updates the Mimc7 usage of the CheckBigIntArrayInField, and updates BabyJubJub EDDSA to the new Poseidon methods.

Benchmarks: Tested on a Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz, with 16GB of RAM.

More than 10x improvement (from 1.547.572 ns/op to 119.921 ns/op).

Warning: do not merge until we check the license

ed255 commented 4 years ago

The code looks good to me! Now the only remaining thing to merge this is resolve any doubt about licensing.

So I think Apache 2 would cause any problem in either the GPLv3 licensed distribution of our libraries nor a possible commercial distribution under a private license (as long as the two requirements of the Apache 2 for Goff are met).

arnaucube commented 4 years ago

After internal confirmation that there are no issues with the license, will merge this PR to master.