diff --git a/stream_test.go b/stream_test.go index 96e540c..9688376 100644 --- a/stream_test.go +++ b/stream_test.go @@ -1,6 +1,7 @@ package merkle import ( + "crypto/sha256" "crypto/sha512" "fmt" "hash" @@ -140,6 +141,7 @@ func TestMerkleHashWriter(t *testing.T) { } var benchDefault = NewHash(DefaultHashMaker, 8192) +var benchSha256 = NewHash(func() hash.Hash { return sha256.New() }, 8192) var benchSha512 = NewHash(func() hash.Hash { return sha512.New() }, 8192) var buf = make([]byte, 8192) @@ -165,6 +167,18 @@ func BenchmarkHash8K(b *testing.B) { benchmarkSize(benchDefault, b, 8192) } +func BenchmarkSha256Hash8Bytes(b *testing.B) { + benchmarkSize(benchSha256, b, 8) +} + +func BenchmarkSha256Hash1K(b *testing.B) { + benchmarkSize(benchSha256, b, 1024) +} + +func BenchmarkSha256Hash8K(b *testing.B) { + benchmarkSize(benchSha256, b, 8192) +} + func BenchmarkSha512Hash8Bytes(b *testing.B) { benchmarkSize(benchSha512, b, 8) }