summaryrefslogtreecommitdiff
path: root/internal/cryptocore/cryptocore.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-05-04 19:09:14 +0200
committerJakob Unterwurzacher2016-05-04 19:56:07 +0200
commit39f3a24484ffc343d2d5225d5c419082aabb9baa (patch)
tree04b9d7aa98ef3e18f05b00efe39e5288baeed5c4 /internal/cryptocore/cryptocore.go
parentc92190bf07d27a4c7fbecba5778d11c77c52574e (diff)
stupidgcm: completely replace spacemonkeygo/openssl
Diffstat (limited to 'internal/cryptocore/cryptocore.go')
-rw-r--r--internal/cryptocore/cryptocore.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/internal/cryptocore/cryptocore.go b/internal/cryptocore/cryptocore.go
index f286896..7e7f099 100644
--- a/internal/cryptocore/cryptocore.go
+++ b/internal/cryptocore/cryptocore.go
@@ -4,6 +4,8 @@ import (
"crypto/aes"
"crypto/cipher"
"fmt"
+
+ "github.com/rfjakob/gocryptfs/internal/stupidgcm"
)
const (
@@ -39,8 +41,9 @@ func New(key []byte, useOpenssl bool, GCMIV128 bool) *CryptoCore {
}
var gcm cipher.AEAD
- if useOpenssl {
- gcm = opensslGCM{key}
+ if useOpenssl && GCMIV128 {
+ // stupidgcm only supports 128-bit IVs
+ gcm = stupidgcm.New(key)
} else {
gcm, err = goGCMWrapper(blockCipher, IVLen)
if err != nil {