Skip to content

Commit

Permalink
Added benchmark of Poseidon for 8 inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
OBrezhniev committed Feb 1, 2022
1 parent b85be5b commit d53d630
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions poseidon/poseidon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,27 @@ func BenchmarkPoseidonHash6Inputs(b *testing.B) {
b1 := utils.NewIntFromString("12242166908188651009877250812424843524687801523336557272219921456462821518061") //nolint:lll
b2 := utils.NewIntFromString("12242166908188651009877250812424843524687801523336557272219921456462821518061") //nolint:lll

bigArray4 := []*big.Int{b1, b2, b0, b0, b0, b0}
bigArray6 := []*big.Int{b1, b2, b0, b0, b0, b0}

for i := 0; i < b.N; i++ {
Hash(bigArray4) //nolint:errcheck,gosec
Hash(bigArray6) //nolint:errcheck,gosec
}
}

func BenchmarkPoseidonHash8Inputs(b *testing.B) {
bigArray8 := []*big.Int{
big.NewInt(1),
big.NewInt(2),
big.NewInt(3),
big.NewInt(4),
big.NewInt(5),
big.NewInt(6),
big.NewInt(7),
big.NewInt(8),
}

for i := 0; i < b.N; i++ {
Hash(bigArray8) //nolint:errcheck,gosec
}
}

Expand Down

0 comments on commit d53d630

Please sign in to comment.