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/mimc7 goff #16

Closed arnaucube closed 4 years ago

arnaucube commented 4 years ago

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

Also removes the field package which is no longer used.

There is still a lot of room for optimization for MiMC7 in the way that is done internally, but will be done in the future.

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

More than 18x improvement, from 1.160.298 ns/op to 61.651 ns/op.

gbotrel commented 4 years ago

@arnaucube I suggest upgrading goff to v0.2.0, you should get another significant speed up on x64