Closed arnaucube closed 4 years ago
Optimize MiMC7 migrating from *big.Int to goff generated finite field operations.
*big.Int
goff
Also removes the field package which is no longer used.
field
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.
Before:
BenchmarkMIMC7-4 1026 1160298 ns/op
After this commit:
BenchmarkMIMC7-4 19263 61651 ns/op
More than 18x improvement, from 1.160.298 ns/op to 61.651 ns/op.
1.160.298 ns/op
61.651 ns/op
@arnaucube I suggest upgrading goff to v0.2.0, you should get another significant speed up on x64
Optimize MiMC7 migrating from
*big.Int
togoff
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.
Before:
After this commit:
More than 18x improvement, from
1.160.298 ns/op
to61.651 ns/op
.