diff options
author | Jakob Unterwurzacher | 2016-07-31 13:36:38 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2016-07-31 13:36:38 +0200 |
commit | 7395b8e9905aa0f09be0646eb89a2e20afb38c0c (patch) | |
tree | 6ebb96f35640db4278989dc82cc5a8865c053e53 | |
parent | 02aab5d21f519a3f0711871266bea096daaee65c (diff) |
cryptocore: comment why 96-bit IVs are still supported
-rw-r--r-- | internal/cryptocore/cryptocore.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/cryptocore/cryptocore.go b/internal/cryptocore/cryptocore.go index a9731be..1839aa2 100644 --- a/internal/cryptocore/cryptocore.go +++ b/internal/cryptocore/cryptocore.go @@ -23,6 +23,10 @@ type CryptoCore struct { } // "New" returns a new CryptoCore object or panics. +// +// Even though the "GCMIV128" feature flag is now mandatory, we must still +// support 96-bit IVs here because they are used for encrypting the master +// key in gocryptfs.conf. func New(key []byte, useOpenssl bool, GCMIV128 bool) *CryptoCore { if len(key) != KeyLen { @@ -35,8 +39,8 @@ func New(key []byte, useOpenssl bool, GCMIV128 bool) *CryptoCore { IVLen = 128 / 8 } - // We always use built-in Go crypto for blockCipher because it is not - // performance-critical. + // Name encryption always uses built-in Go AES through BlockCipher. + // Content encryption uses BlockCipher only if useOpenssl=false. blockCipher, err := aes.NewCipher(key) if err != nil { panic(err) |