diff options
author | Jakob Unterwurzacher | 2015-10-04 21:21:32 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2015-10-04 21:21:32 +0200 |
commit | df52aab0828f4cd67e003c66668ccfcba90ab798 (patch) | |
tree | dfba83a2ca97f22c9249f3c05314fc5440a49798 /openssl_benchmark/openssl_test.go | |
parent | d1522c7992ea075ecfbc570b8f804bf468cca80e (diff) |
Clean up openssl benchmark
Diffstat (limited to 'openssl_benchmark/openssl_test.go')
-rw-r--r-- | openssl_benchmark/openssl_test.go | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/openssl_benchmark/openssl_test.go b/openssl_benchmark/openssl_test.go index e80410f..06dce03 100644 --- a/openssl_benchmark/openssl_test.go +++ b/openssl_benchmark/openssl_test.go @@ -6,6 +6,8 @@ package benchmark // go test -bench=. import ( + "fmt" + "os" "bytes" "crypto/aes" "crypto/cipher" @@ -13,7 +15,19 @@ import ( "testing" ) -func BenchmarkAESGCMSeal4K(b *testing.B) { +func TestMain(m *testing.M) { + + fmt.Printf("Benchmarking AES-GCM-128 with 4kB block size\n") + + r := m.Run() + os.Exit(r) +} + +// This gets rid of the "testing: warning: no tests to run" message +func TestDummy(t *testing.T) { +} + +func BenchmarkGoEnc4K(b *testing.B) { buf := make([]byte, 1024*4) b.SetBytes(int64(len(buf))) @@ -29,7 +43,7 @@ func BenchmarkAESGCMSeal4K(b *testing.B) { } } -func BenchmarkAESGCMOpen4K(b *testing.B) { +func BenchmarkGoDec4K(b *testing.B) { buf := make([]byte, 1024*4) b.SetBytes(int64(len(buf))) @@ -49,7 +63,7 @@ func BenchmarkAESGCMOpen4K(b *testing.B) { } } -func BenchmarkOpensslGCMenc4K(b *testing.B) { +func BenchmarkOpensslEnc4K(b *testing.B) { buf := make([]byte, 1024*4) b.SetBytes(int64(len(buf))) @@ -84,7 +98,7 @@ func BenchmarkOpensslGCMenc4K(b *testing.B) { } } -func BenchmarkOpensslGCMdec4K(b *testing.B) { +func BenchmarkOpensslDec4K(b *testing.B) { buf := makeOpensslCiphertext() b.SetBytes(int64(1024 * 4)) |