aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-07-19 12:47:42 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-07-19 12:47:42 +0200
commita9fd7c740772147eea9434e5268646bf03a54ea4 (patch)
tree1f0430f88b93c35706ffc9c04f826b1aef58d033
parentf280391c51f767cfcd041728c447a46eea64ea6b (diff)
Add benchmark
-rw-r--r--bhash/bhash_test.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/bhash/bhash_test.go b/bhash/bhash_test.go
index 0535d96..a49d656 100644
--- a/bhash/bhash_test.go
+++ b/bhash/bhash_test.go
@@ -20,6 +20,13 @@ func TestHash(t *testing.T) {
}
}
+func BenchmarkHash(b *testing.B) {
+ zero := make([]byte, 32)
+ for i := 0; i < b.N; i++ {
+ Hash(zero, zero)
+ }
+}
+
func TestPbkdf(t *testing.T) {
testCases := [][]byte{
{
@@ -108,3 +115,10 @@ func TestPbkdf(t *testing.T) {
})
}
}
+
+func BenchmarkPbkdf(b *testing.B) {
+ zero := make([]byte, 32)
+ for i := 0; i < b.N; i++ {
+ Pbkdf(zero, zero, 42, 32)
+ }
+}