mirror of
https://github.com/arnaucube/go-iden3-crypto.git
synced 2026-02-07 03:26:39 +01:00
Optimize MiMC7 migrating from *big.Int to goff
Optimize MiMC7 migrating from *big.Int to goff generated finite field operations. 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 ```
This commit is contained in:
@@ -92,7 +92,6 @@ func ark(state [T]*ff.Element, c *ff.Element) {
|
||||
|
||||
// cubic performs x^5 mod p
|
||||
// https://eprint.iacr.org/2019/458.pdf page 8
|
||||
// var five = big.NewInt(5)
|
||||
|
||||
func cubic(a *ff.Element) {
|
||||
a.Exp(*a, 5)
|
||||
|
||||
Reference in New Issue
Block a user