aboutsummaryrefslogtreecommitdiff
path: root/internal/stupidgcm
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-09-26 23:25:13 +0200
committerJakob Unterwurzacher2016-09-26 23:25:13 +0200
commite9bb8b800c6c724125ccd862f4d20946317b31f5 (patch)
treec763fb287b0b0fc7e831b5f2a27c88801945d25f /internal/stupidgcm
parentd9fc652df0957e464d83c87a164ee2b70cb9e4ee (diff)
reverse: switch from GCM-SIV to AES-SIVv1.1-beta1
GCM-SIV is not yet finalized, and the reference implemenation is painfully slow at about 2 MB/s. Switch to AES-SIV.
Diffstat (limited to 'internal/stupidgcm')
-rw-r--r--internal/stupidgcm/stupidgcm_test.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/internal/stupidgcm/stupidgcm_test.go b/internal/stupidgcm/stupidgcm_test.go
index 1dbfccb..3c11dfe 100644
--- a/internal/stupidgcm/stupidgcm_test.go
+++ b/internal/stupidgcm/stupidgcm_test.go
@@ -15,7 +15,8 @@ import (
"encoding/hex"
"testing"
- "github.com/rfjakob/gcmsiv"
+ // For benchmark comparison
+ "github.com/rfjakob/gocryptfs/internal/siv_aead"
)
// Get "n" random bytes from /dev/urandom or panic
@@ -162,16 +163,13 @@ func Benchmark4kEncGoGCM(b *testing.B) {
}
}
-func Benchmark4kEncGCMSIV(b *testing.B) {
+func Benchmark4kEncAESSIV(b *testing.B) {
key := randBytes(32)
authData := randBytes(24)
iv := randBytes(16)
in := make([]byte, 4096)
b.SetBytes(int64(len(in)))
- gGCM, err := gcmsiv.NewGCMSIV(key)
- if err != nil {
- b.Fatal(err)
- }
+ gGCM := siv_aead.New(key)
for i := 0; i < b.N; i++ {
// Encrypt and append to nonce
gGCM.Seal(iv, iv, in, authData)