Merge 247acba21d796ab7edeff123dbb556eb968b216e into a8e8aab76c85d073094d7b9a915a39d3c16f996f

This commit is contained in:
Alvaro Revuelta 2024-09-26 13:14:13 +00:00 committed by GitHub
commit fa16c4ef2d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,7 @@ package rln
import (
"bytes"
"fmt"
"math/big"
"testing"
@ -51,3 +52,15 @@ func TestHashToBN255(t *testing.T) {
[32]byte{69, 7, 140, 46, 26, 131, 147, 30, 161, 68, 2, 5, 234, 195, 227, 223, 119, 187, 116, 97, 153, 70, 71, 254, 60, 149, 54, 109, 77, 79, 105, 20},
out)
}
func BenchmarkHashToBN255(b *testing.B) {
msgSizedInKB := []int{2, 25, 100, 500}
for _, size := range msgSizedInKB {
data := make([]byte, size*1024)
b.Run(fmt.Sprintf("%dKBytes", size), func(b *testing.B) {
for i := 0; i < b.N; i++ {
HashToBN255(data)
}
})
}
}