summaryrefslogtreecommitdiff
path: root/internal/stupidgcm/stupidgcm_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/stupidgcm/stupidgcm_test.go')
-rw-r--r--internal/stupidgcm/stupidgcm_test.go58
1 files changed, 0 insertions, 58 deletions
diff --git a/internal/stupidgcm/stupidgcm_test.go b/internal/stupidgcm/stupidgcm_test.go
index d6c0714..ba25855 100644
--- a/internal/stupidgcm/stupidgcm_test.go
+++ b/internal/stupidgcm/stupidgcm_test.go
@@ -15,9 +15,6 @@ import (
"encoding/hex"
"log"
"testing"
-
- // For benchmark comparison
- "github.com/rfjakob/gocryptfs/internal/siv_aead"
)
// Get "n" random bytes from /dev/urandom or panic
@@ -121,58 +118,3 @@ func TestCorruption(t *testing.T) {
t.Fatalf("Should have gotten error")
}
}
-
-// $ go test -bench .
-// PASS
-// Benchmark4kEncStupidGCM-2 50000 25622 ns/op 159.86 MB/s
-// Benchmark4kEncGoGCM-2 10000 116544 ns/op 35.15 MB/s
-// ok github.com/rfjakob/gocryptfs/internal/stupidgcm 3.775s
-func Benchmark4kEncStupidGCM(b *testing.B) {
- key := randBytes(32)
- authData := randBytes(24)
- iv := randBytes(16)
- in := make([]byte, 4096)
- b.SetBytes(int64(len(in)))
-
- sGCM := New(key)
-
- for i := 0; i < b.N; i++ {
- // Encrypt and append to nonce
- sGCM.Seal(iv, iv, in, authData)
- }
-}
-
-func Benchmark4kEncGoGCM(b *testing.B) {
- key := randBytes(32)
- authData := randBytes(24)
- iv := randBytes(16)
- in := make([]byte, 4096)
- b.SetBytes(int64(len(in)))
-
- gAES, err := aes.NewCipher(key)
- if err != nil {
- b.Fatal(err)
- }
- gGCM, err := cipher.NewGCMWithNonceSize(gAES, 16)
- if err != nil {
- b.Fatal(err)
- }
-
- for i := 0; i < b.N; i++ {
- // Encrypt and append to nonce
- gGCM.Seal(iv, iv, in, authData)
- }
-}
-
-func Benchmark4kEncAESSIV(b *testing.B) {
- key := randBytes(32)
- authData := randBytes(24)
- iv := randBytes(16)
- in := make([]byte, 4096)
- b.SetBytes(int64(len(in)))
- gGCM := siv_aead.New(key)
- for i := 0; i < b.N; i++ {
- // Encrypt and append to nonce
- gGCM.Seal(iv, iv, in, authData)
- }
-}