summaryrefslogtreecommitdiff
path: root/internal/cryptocore/cryptocore.go
diff options
context:
space:
mode:
authorValient Gough2016-10-01 21:14:18 -0700
committerJakob Unterwurzacher2016-10-04 23:18:33 +0200
commitb764917cd5c1b1d61b8ce08e7af0b29793fbbb80 (patch)
tree22222f3f245d43c1c534a38d7d57b900f50d0e08 /internal/cryptocore/cryptocore.go
parent31a8f8b83973867a50ac08106effb1bba3fdcb2d (diff)
lint fixes
Diffstat (limited to 'internal/cryptocore/cryptocore.go')
-rw-r--r--internal/cryptocore/cryptocore.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/internal/cryptocore/cryptocore.go b/internal/cryptocore/cryptocore.go
index 05c0704..7cb5c95 100644
--- a/internal/cryptocore/cryptocore.go
+++ b/internal/cryptocore/cryptocore.go
@@ -12,18 +12,25 @@ import (
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
)
+// BackendTypeEnum indicates the type of backend in use.
type BackendTypeEnum int
const (
- KeyLen = 32 // AES-256
+ // KeyLen is the cipher key length in bytes. 32 for AES-256.
+ KeyLen = 32
+ // AuthTagLen is the length of a GCM auth tag in bytes.
AuthTagLen = 16
- _ = iota // Skip zero
+ _ = iota // Skip zero
+ // BackendOpenSSL specifies the OpenSSL backend.
BackendOpenSSL BackendTypeEnum = iota
- BackendGoGCM BackendTypeEnum = iota
- BackendAESSIV BackendTypeEnum = iota
+ // BackendGoGCM specifies the Go based GCM backend.
+ BackendGoGCM BackendTypeEnum = iota
+ // BackendAESSIV specifies an AESSIV backend.
+ BackendAESSIV BackendTypeEnum = iota
)
+// CryptoCore is the low level crypto implementation.
type CryptoCore struct {
// AES-256 block cipher. This is used for EME filename encryption.
BlockCipher cipher.Block
@@ -36,7 +43,7 @@ type CryptoCore struct {
IVLen int
}
-// "New" returns a new CryptoCore object or panics.
+// 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