aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/crypto_test.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-12 17:19:27 +0800
committerobscuren <geffobscura@gmail.com>2015-01-12 17:19:27 +0800
commit35fe4313d57e1df6c3c8af0bc0b530bd7033e21b (patch)
treeed6b22ac3691315d0f208856bc8070bc1f5896a3 /crypto/crypto_test.go
parent7e6b72cb5c0172b8a6a15239a6628b64c8f8de23 (diff)
downloaddexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar.gz
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar.bz2
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar.lz
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar.xz
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.tar.zst
dexon-35fe4313d57e1df6c3c8af0bc0b530bd7033e21b.zip
pre-pow
Diffstat (limited to 'crypto/crypto_test.go')
-rw-r--r--crypto/crypto_test.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go
index af62a02a2..b579e6e4e 100644
--- a/crypto/crypto_test.go
+++ b/crypto/crypto_test.go
@@ -3,7 +3,9 @@ package crypto
import (
"bytes"
"encoding/hex"
+ "fmt"
"testing"
+ "time"
)
// These tests are sanity checks.
@@ -34,3 +36,14 @@ func checkhash(t *testing.T, name string, f func([]byte) []byte, msg, exp []byte
t.Errorf("hash %s returned wrong result.\ngot: %x\nwant: %x", name, sum, exp)
}
}
+
+func BenchmarkSha3(b *testing.B) {
+ a := []byte("hello world")
+ amount := 1000000
+ start := time.Now()
+ for i := 0; i < amount; i++ {
+ Sha3(a)
+ }
+
+ fmt.Println(amount, ":", time.Since(start))
+}